From: | "Guy Rouillier" <guyr(at)masergy(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [Bulk] Re: Final stored procedure question, for now anyway |
Date: | 2005-12-29 19:33:10 |
Message-ID: | CC1CF380F4D70844B01D45982E671B239E8DCA@mtxexch01.add0.masergy.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Ted Byers wrote:
>
> 2) Do I need to qualify my references to my tables in the function to
> identify the schema in which the tables exist, or will Postgres find
> the right tables with the function in its present form? If I have to
> further qualify the table references, what is the correct
> qualification of the table references within the SQL in the function
> definition?
PostgreSQL uses a search path to find DB objects. The default search
path is a schema with the same name you used to connect, followed by the
"public" schema. You can alter this search path. So you have several
options: (1) hard-code a schema name onto each table in your queries
(which I would never do and do not suggest), (2) put your DB objects
(tables, functions, etc) into the schema that you use to connect, or (3)
alter your search path.
As much as I like PG and as powerful as it is, I'm surprised the
designers have elected not to implement synonyms, which is how most
other databases address this issue.
--
Guy Rouillier
From | Date | Subject | |
---|---|---|---|
Next Message | Klein Balázs | 2005-12-29 20:46:10 | alter column datatype with cast |
Previous Message | Raymond O'Donnell | 2005-12-29 18:44:27 | Re: windows xp install problem ("failed to set |