Search Postgresql Archives

Re: [Bulk] Re: Final stored procedure question, for now anyway

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux