Search Postgresql Archives

Re: public schema doubt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 16, 2007 8:56 AM,  <mailtolouis2020-postgres@xxxxxxxxx> 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.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux