Re: schema name in SQL statement.

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: johnf <jfabiani(at)yolo(dot)com>
Subject: Re: schema name in SQL statement.
Date: 2008-08-20 14:13:58
Message-ID: 200808200713.58783.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 19 August 2008 9:53:11 pm johnf wrote:
> On Tuesday 19 August 2008 04:01:55 pm Adrian Klaver wrote:
> > -------------- Original message ----------------------
> > From: "Masis, Alexander (US SSA)" <alexander(dot)masis(at)baesystems(dot)com>
> >
> > > I have to explicitly specify the schema name to make SQL statement to
> > > work.
> > > Can I set the schema before the query, or set a default schema?
> > > My current statement:
> > > "SELECT col FROM schema.table"
> > > I like to be able to use generic SQL statement like:
> > > "SELECT col FROM table"
> > >
> > >
> > >
> > > --
> >
> > See search_path in:
> > http://www.postgresql.org/docs/8.3/interactive/runtime-config-client.html
> >
> >
> > --
> > Adrian Klaver
> > aklaver(at)comcast(dot)net
>
> I see answers like this all the time. When I review the doc's I still
> don't know how to set the "search_path" because there is no example in the
> doc's. Do I do something like this:
> "select search_path=(public)" or "select search_path="public" . So how is
> the search_path set?
>
> --
> John Fabiani

From postgresql.conf.sample in ~pgsql/share:

#---------------------------------------------------------------------------
# CLIENT CONNECTION DEFAULTS
#---------------------------------------------------------------------------

# - Statement Behavior -

#search_path = '"$user",public' # schema names

This is how the initial postgresql.conf is set up when you do an initdb. I
have found the postgresql.conf to be quite well commented.

--
Adrian Klaver
aklaver(at)comcast(dot)net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kincaid, Larry 2008-08-20 14:42:26 Modeling tools
Previous Message regme please 2008-08-20 14:07:32 CREATE DOMAIN with referential integrity