From: | Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> |
---|---|
To: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: Prefixing schema name |
Date: | 2018-03-08 07:02:30 |
Message-ID: | e46adbdf-07bf-2c0b-f63e-5de0f34311c2@matrix.gatewaynet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 08/03/2018 01:13, David G. Johnston wrote:
> On Wed, Mar 7, 2018 at 4:05 PM, Tiffany Thang <tiffanythang(at)gmail(dot)com <mailto:tiffanythang(at)gmail(dot)com>>wrote:
>
>
> The search_path configuration works only for queries.
>
>
> Um....
>
> https://www.postgresql.org/docs/10/static/sql-createschema.html
>
> "A CREATE command specifying an unqualified object name creates the object in the current schema (the one at the front of the search path, which can be determined with the function current_schema)"
>
In pg_dump relies heavily on search_path for all CREATE statements.
>
> For example:
> Is there a way to run the create/insert statements below without prefixing the schema name, user1?
>
>
> As the user, user1:
> Create table user1.table1 (id int);
> Insert into user1.table1 values (1);
>
>
> Just omitting "user1" and seeing what happens would be informative. You should find it does exactly what you think - namely because the default search_path will cause "user1" to appear first.
>
> Insert is more similar to Select than it is to Create - the object being inserted into must already exist
>
> David J.
>
--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt
From | Date | Subject | |
---|---|---|---|
Next Message | Dylan Luong | 2018-03-08 07:41:31 | RE: Resync second slave to new master |
Previous Message | PegoraroF10 | 2018-03-08 00:55:06 | Replication push instead of pull |