pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #13583: Documentation "5.8.2. The Public Schema" misleading
5+ messages / 5 participants
[nested] [flat]

* BUG #13583: Documentation "5.8.2. The Public Schema" misleading
@ 2015-08-20 17:51  mina@naguib.ca
  0 siblings, 2 replies; 5+ messages in thread

From: mina@naguib.ca @ 2015-08-20 17:51 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      13583
Logged by:          Mina Naguib
Email address:      mina@naguib.ca
PostgreSQL version: 9.5alpha2
Operating system:   N/A
Description:        

This section of the documentation states:

"...  we created tables without specifying any schema ... are automatically
put into a schema named "public" ..."

This is not true.  At least from my tests, the search_path is taken into
account.

My search_path is set to "$user",public, and therefore a barebones "create
table foo();" creates the table foo in the "mina" schema, not the "public"
schema.




-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #13583: Documentation "5.8.2. The Public Schema" misleading
@ 2015-08-20 18:11  Jeff Janes <jeff.janes@gmail.com>
  parent: mina@naguib.ca
  1 sibling, 0 replies; 5+ messages in thread

From: Jeff Janes @ 2015-08-20 18:11 UTC (permalink / raw)
  To: mina@naguib.ca; +Cc: pgsql-bugs

On Thu, Aug 20, 2015 at 10:51 AM, <mina@naguib.ca> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      13583
> Logged by:          Mina Naguib
> Email address:      mina@naguib.ca
> PostgreSQL version: 9.5alpha2
> Operating system:   N/A
> Description:
>
> This section of the documentation states:
>
> "...  we created tables without specifying any schema ... are automatically
> put into a schema named "public" ..."
>
> This is not true.  At least from my tests, the search_path is taken into
> account.
>
> My search_path is set to "$user",public, and therefore a barebones "create
> table foo();" creates the table foo in the "mina" schema, not the "public"
> schema.
>

By default, there is no schema named "mina".  That part of the
documentation is describing the behavior under this default condition.  The
next section goes on to explain what happens when you have created a schema
that matches your user name.

Cheers,

Jeff

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #13583: Documentation "5.8.2. The Public Schema" misleading
@ 2015-08-20 18:14  John McKown <john.archie.mckown@gmail.com>
  parent: mina@naguib.ca
  1 sibling, 1 reply; 5+ messages in thread

From: John McKown @ 2015-08-20 18:14 UTC (permalink / raw)
  To: mina@naguib.ca; +Cc: pgsql-bugs

On Thu, Aug 20, 2015 at 12:51 PM, <mina@naguib.ca> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      13583
> Logged by:          Mina Naguib
> Email address:      mina@naguib.ca
> PostgreSQL version: 9.5alpha2
> Operating system:   N/A
> Description:
>
> This section of the documentation states:
>
> "...  we created tables without specifying any schema ... are automatically
> put into a schema named "public" ..."
>
> This is not true.  At least from my tests, the search_path is taken into
> account.
>
> My search_path is set to "$user",public, and therefore a barebones "create
> table foo();" creates the table foo in the "mina" schema, not the "public"
> schema.
>
>
>
​I think this depends on you, the user, creating the proper schema. I don't
think that an "initdb" creates any schemas other than "public". At least,
that has been my experience so far.​

-- 

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #13583: Documentation "5.8.2. The Public Schema" misleading
@ 2015-08-20 19:03  David G. Johnston <david.g.johnston@gmail.com>
  parent: John McKown <john.archie.mckown@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2015-08-20 19:03 UTC (permalink / raw)
  To: John McKown <john.archie.mckown@gmail.com>; +Cc: pgsql-bugs

On Thu, Aug 20, 2015 at 2:14 PM, John McKown <john.archie.mckown@gmail.com>
wrote:

> On Thu, Aug 20, 2015 at 12:51 PM, <mina@naguib.ca> wrote:
>
>> The following bug has been logged on the website:
>>
>> Bug reference:      13583
>> Logged by:          Mina Naguib
>> Email address:      mina@naguib.ca
>> PostgreSQL version: 9.5alpha2
>> Operating system:   N/A
>> Description:
>>
>> This section of the documentation states:
>>
>> "...  we created tables without specifying any schema ... are
>> automatically
>> put into a schema named "public" ..."
>>
>> This is not true.  At least from my tests, the search_path is taken into
>> account.
>>
>> My search_path is set to "$user",public, and therefore a barebones "create
>> table foo();" creates the table foo in the "mina" schema, not the "public"
>> schema.
>>
>>
>>
> ​I think this depends on you, the user, creating the proper schema. I
> don't think that an "initdb" creates any schemas other than "public". At
> least, that has been my experience so far.​
>

So basically the key phrase in that paragraph is "by default".  The reader
is intended to take that to mean "with only the schemas created by initdb".

Now, maybe this should be explained before teaching the user to create
schemas...

​The assumption of there not being a username schema is implicit here and
everything works if that is true.  But the most of this could be better
written to either directly account for the username schema or separately
explain the interaction when one is present.

​Room for improvement but not exactly critical.

David J.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #13583: Documentation "5.8.2. The Public Schema" misleading
@ 2015-08-20 21:44  Tom Lane <tgl@sss.pgh.pa.us>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2015-08-20 21:44 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: John McKown <john.archie.mckown@gmail.com>; pgsql-bugs

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> So basically the key phrase in that paragraph is "by default".  The reader
> is intended to take that to mean "with only the schemas created by initdb".

There are actually three assumptions underlying "by default":
1. You haven't changed the default search_path setting.
2. You haven't created a schema matching your own username.
3. You haven't removed the public schema.

The section after this one goes into these details.  I don't think that
explaining them all right here would be an improvement in readability.
You have to start somewhere ...

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2015-08-20 21:44 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 17:51 BUG #13583: Documentation "5.8.2. The Public Schema" misleading mina@naguib.ca
2015-08-20 18:11 ` Jeff Janes <jeff.janes@gmail.com>
2015-08-20 18:14 ` John McKown <john.archie.mckown@gmail.com>
2015-08-20 19:03   ` David G. Johnston <david.g.johnston@gmail.com>
2015-08-20 21:44     ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox