PostgreSQL – Change Table Owner

Below is the syntax to change the owner of a table in Postgres database:

Alter table schemaname.tablename owner to new_owner;

You can verify the current owner of the table using below sql:

select tablename, tableowner from pg_tables where tablename='your_table_name' and schemaname='your_schema_name';

See also  Postgresql - how to declare a variable