Skip to main content

Troubleshoot `must be owner of table` in PostgreSQL exports

Fix a PostgreSQL export that fails because the database user doesn't own the destination table.

Problem summary

Your PostgreSQL export can't change the destination table because the Funnel database user doesn't own it.

​

Error message or symptoms

The export fails with an error that contains:

​

must be owner of table

​

When does this occur

  • You export to a table that another database user created, and then add a field to the export so Funnel needs to add a column.

​

Root cause

PostgreSQL only lets the table owner add columns. When the Funnel user doesn't own the table, Funnel can't update its structure.

​

Solution

Do one of the following, then run the export again:

​

  • Transfer ownership: Make the Funnel database user the owner of the table.

  • Use a new table: Change the export's Table name template to a table that doesn't exist yet. Funnel creates the table on the next run.

​

To transfer ownership, run this command. Replace the schema, table and user names with your own.

ALTER TABLE <schema>.<table> OWNER TO funnel_export;
Did this answer your question?