Re: Schemas to Search_path

From: "Subbiah, Stalin" <SSubbiah(at)netopia(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Schemas to Search_path
Date: 2005-03-10 01:21:05
Message-ID: 6B26A56846293C4488B54CF3E4403354339DF2@mxca2.corp.netopia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I created schema name "foo_schema" different from user name "foo".
However, when I created the schema, I had specified authorization set to
foo user.

Does that mean, if the owner of the schema and schema name are
different, then only way, is to set through alter user set or search
path correct ?

Thanks Much!

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Wednesday, March 09, 2005 4:57 PM
To: Subbiah, Stalin
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Schemas to Search_path

"Subbiah, Stalin" <SSubbiah(at)netopia(dot)com> writes:
> I logged into foodb as foo user and tried to create a table. Bang!
> ERROR: no schema has been selected to create in. search_path had
> $user, public the default ones, shouldn't the table get created in
> user's authorized schema.

Which one?

Now, if you make the schema name the same as the user name, it will do
what you want --- that's what the $user is for. If you want some other
schema that happens to belong to that user to be the default, you have
to adjust the normal value of search_path. (See ALTER USER SET if you'd
like that adjustment to be done for you automatically at each login.)

regards, tom lane

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ben Kim 2005-03-10 05:32:33 Re: Visual data model creation / maintenance tools
Previous Message Tom Lane 2005-03-10 00:57:23 Re: Schemas to Search_path