Postgresql creates all tables in the schema with the owner of the schema, not the default postgres

How to get all the tables that I create in order to have the owner of the schema as the owner of the table?

In a database called layers, I have a hi_ow schema and a hi_ow owner. when I run the create table command, it creates a table in the hi_ow schema, but the owner uses Postgres by default

example:

drop table if exists hi_ow.how_dump;
create table hi_ow.how_dump as
select (st_dump(geom)).geom geom from hi_ow.how;

I know that I can just run

alter table hi_ow.how owner to hi_ow

but I want the default owner for this scheme only to be hi_ow

Is there some kind set owner = hi_owbefore running multiple queries? Or something in the circuit settings that I need to enable?

The reassign command does not work for me, because the tables I'm trying to switch belong to Postgres.

+4

Source: https://habr.com/ru/post/1681895/


All Articles