Skip site navigation (1) Skip section navigation (2)

Re: Schemas: status report, call for developers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bill Cunningham <billc(at)ballydev(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>,pgsql-interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: Schemas: status report, call for developers
Date: 2002-04-30 21:16:33
Message-ID: 2032.1020201393@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces
Bill Cunningham <billc(at)ballydev(dot)com> writes:
> So we now have a default schema name of the current user?
> ... This is exactly how DB2 operates, implict schemas for each user.

You can operate that way.  It's not the default though; the DBA will
have to explicitly do a CREATE SCHEMA for each user.  For instance:

test=# CREATE USER tgl;
CREATE USER
test=# CREATE SCHEMA tgl AUTHORIZATION tgl;
CREATE
test=# \c - tgl
You are now connected as new user tgl.
test=> select current_schemas();
 current_schemas
-----------------
 {tgl,public}			-- my search path is now tgl, public
(1 row)

-- this creates tgl.foo:
test=> create table foo(f1 int);
CREATE
test=> select * from foo;
 f1
----
(0 rows)

test=> select * from tgl.foo;
 f1
----
(0 rows)


If you don't create schemas then you get backwards-compatible behavior
(all the users end up sharing the "public" schema as their current
schema).

See the development-docs pages I mentioned before for details.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Neil ConwayDate: 2002-05-01 00:11:10
Subject: the parsing of parameters
Previous:From: Bill CunninghamDate: 2002-04-30 20:46:34
Subject: Re: Schemas: status report, call for developers

pgsql-interfaces by date

Next:From: Ian BarwickDate: 2002-05-01 01:46:37
Subject: Re: Schemas: status report, call for developers
Previous:From: Bill CunninghamDate: 2002-04-30 20:46:34
Subject: Re: Schemas: status report, call for developers

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group