Re: public schema doubt

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: mailtolouis2020-postgres(at)yahoo(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: public schema doubt
Date: 2007-11-16 16:16:31
Message-ID: dcc563d10711160816n1d46bc7agb1f54c7b520e2831@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Nov 16, 2007 8:56 AM, <mailtolouis2020-postgres(at)yahoo(dot)com> wrote:
>
>
> Hello,
>
> I did a migration from 8.2.4 to 8.2.5,

Just FYI, from 8.2.4 to 8.2.5 doesn't require a dump / restore, you
can update minor versions in place.

> I used pg_dumpall to backup all the
> db and then restore it into 8.2.5. In my 8.2.4 db, I don't have public
> schema (it was dropped when I create the db, so only myschema is there), but
> when I restore to 8.2.5, I found that it created a public schema for me.

A freshly created database has a public schema by default, because it
is created form the template1 database which has a public schema. If
you want a new database to have a different schema than public, you
can make that change to template1 and your new dbs will have that
setup.

> Should I just let the public schema there? Will it cause any problem?

Generally, no.

> In the
> postgres doc http://www.postgresql.org/docs/8.2/interactive/ddl-schemas.html
> (5.7.2) it said if I create a table without specify any schema name, it will
> put it into public schema, so I test it in my case, but it not doing it, the
> table is create under myschema, strange. And I check the search_path, it
> show "$user",public .

Then the user you're creating the table with has a different
search_path set than the default one of 'public',$user. Most likely
the result of an alter user command. Could also be an alter database
command.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-11-16 16:19:15 Re: Substitute column in SELECT with static value?
Previous Message Dhas Jeba G 2007-11-16 16:13:26 PostgreSQL - Services delivery query ?