pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bill Cunningham <billc@ballydev.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: pgsql-interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: Schemas: status report, call for developers
Date: Tue, 30 Apr 2002 17:16:33 -0400
Message-ID: <2032.1020201393@sss.pgh.pa.us> (raw)
In-Reply-To: <3CCF02AA.2000209@ballydev.com>
References: <21020.1020187890@sss.pgh.pa.us>
	<3CCED849.5040400@ballydev.com>
	<21260.1020191025@sss.pgh.pa.us>
	<3CCF02AA.2000209@ballydev.com>

Bill Cunningham <billc@ballydev.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



view thread (7+ messages)

Message-ID: <2032.1020201393@sss.pgh.pa.us>
Permalink:  ../2032.1020201393@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2032.1020201393@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, billc@ballydev.com, pgsql-hackers@postgresql.org
  Subject: Re: Schemas: status report, call for developers
  In-Reply-To: <2032.1020201393@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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