Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: BUG #2123: join between stored procedures


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: "Konstantin S. Zhinko [tIT]" <k(dot)zhinko(at)grape(dot)ru>
  • Cc: pgsql-bugs(at)postgresql(dot)org
  • Subject: Re: BUG #2123: join between stored procedures
  • Date: Tue, 27 Dec 2005 10:15:28 -0500
  • Message-id: <23007.1135696528@sss.pgh.pa.us> <text/plain>

"Konstantin S. Zhinko [tIT]" <k(dot)zhinko(at)grape(dot)ru> writes:
> SELECT b.*
> FROM get_obj_list a
>   LEFT JOIN get_obj(a.id) b ON 1=1
> Error: relation "a" does not exists.

This is not a bug.  You cannot make use of values from one <table
reference> inside the definition of another <table reference>.
So the reference "a.id" is taken to be to a real table named "a",
not to the "a" alias elsewhere in the query.

You could do something like

	SELECT (get_obj(id)).* FROM get_obj_list();

instead.

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group