Home:ALL Converter>What is a PostgreSQL table owner?

What is a PostgreSQL table owner?

Ask Time:2015-11-21T17:10:08         Author:Jonathan Ginsburg

Json Formatter

I am unsure about what does a PostgreSQL table owner means. I notice that it changes an attribute of the table itself and not about the owner because it is specified through an

ALTER TABLE table_name OWNER TO role_name;

Author:Jonathan Ginsburg,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/33841647/what-is-a-postgresql-table-owner
Scirocco :

You can see who is owner in certain table:\n\nselect * from pg_tables where tablename = 'my_tbl';\n\n\nor you can see all tables by certain owner:\n\nselect * from pg_tables where tableowner = 'username';\n",
2018-08-07T09:08:33
a_horse_with_no_name :

The owner is (if nothing else happened) the user (role) that created the table. So if user arthur runs CREATE TABLE foo (id INTEGER), arthur owns the table.\nThe owner of a table has all privileges on it - including the privilege to drop it. Or the privilege to grant other users (roles) access to the table.\nThe SQL script generated by pg_dump typically includes the ALTER TABLE ... OWNER TO ... statement as those scripts are intended to be run by the DBA and in that case all tables would be owned by the DBA - which means the "real" owner could not change or access the tables.",
2015-11-21T09:32:31
yy