Re: RFD: schemas and different kinds of Postgres objects - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: RFD: schemas and different kinds of Postgres objects
Date
Msg-id 200201250326.g0P3Qhw23061@candle.pha.pa.us
Whole thread Raw
In response to Re: RFD: schemas and different kinds of Postgres objects  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: RFD: schemas and different kinds of Postgres objects  (Bill Studenmund <wrstuden@netbsd.org>)
List pgsql-hackers
> > Or are you thinking about a per session behavior ?
> > I would rather envision a per database behavior.
> > Maybe the easy way out would be a "default creation schema" property for 
> > each user, that would default to the username. If you want everything in one 
> > schema simply alter the users.
> 
> I hadn't really gotten to the point of thinking about exactly what and
> where the control knobs should be.  I suspect you are right that we will
> want the default behavior to be selectable on a per-user or per-database
> basis, which seems to eliminate the option of using GUC (at least in its
> current form).  We could easily add a field to pg_shadow or pg_database
> respectively to determine the default behavior.  It'd be nice though if
> the behavior could be changed after connection by a SET statement, which
> would be lots easier if the setting were GUC-controlled.  Peter, you see
> any way to resolve that?

I think we could set the database default at db creation time, then
allow SET to modify that default per session;  seems flexible enough. 
It is basically a GUC value who's default is stored in pg_database
rather than postgresql.conf.   You could use postgresql.conf to set the
default schema type at db creation time.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: RFD: schemas and different kinds of Postgres objects
Next
From: Peter Eisentraut
Date:
Subject: Re: RFD: schemas and different kinds of Postgres objects