Re: More schema queries - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: More schema queries
Date
Msg-id 1021907872.14279.278.camel@taru.tm.ee
Whole thread Raw
In response to Re: More schema queries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, 2002-05-18 at 01:01, Tom Lane wrote:
> "Dave Page" <dpage@vale-housing.co.uk> writes:
> > It doesn't work quite like that anyway.
> 
> Oh, so essentially you want to simulate the namespace search on the
> application side.  I see.
> 
> > Anyway, current_schemas() seems ideal, thanks.
> 
> It may not be exactly what you need, because it doesn't tell you about
> implicitly searched schemas --- which always includes pg_catalog and
> will include a temp namespace if you've activated one.  For instance,
> if current_schemas claims the search path is
> 
> regression=> select current_schemas();
>  current_schemas
> -----------------
>  {tgl,public}
> (1 row)
> 
> then the real path is effectively {pg_catalog,tgl,public}, or possibly
> {pg_temp_NNN,pg_catalog,tgl,public}.
> 
> There was already some discussion about making a variant version of
> current_schemas() that would tell you the Whole Truth, including the
> implicitly searched schemas.  Seems like we'd better do that; otherwise
> we'll find people hardwiring knowledge of these implicit search rules
> into their apps, which is probably a bad idea.
> 
> Anyone have a preference about what to call it?  I could see making a
> version of current_schemas() that takes a boolean parameter, or we
> could choose another function name for the implicit-schemas-too version.

or we could make another function with the same name :)

current_schemas('full')

--------------
Hannu




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: More schema queries
Next
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql/src/interfaces/ecpg ChangeLog preproc/ec ...