Search Postgresql Archives

Re: JOIN Record returning Function

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

 



Daniel Schuchardt <d.schuchardt@xxxxxxxxxxxxx> wrote:

> i have a function that returns a record.

> myfunc(IN id INTEGER) RETURNS RECORD.

> in that function the record is build from some subquery's in
> dependence of data.

> Now i need to join that function to its correponding main
> table that holds the id.

> SELECT myfunc.* FROM maintable JOIN myfunc(maintable.pk) ON
> true WHERE maintable.field=statisticdata;

> ERROR:  invalid reference to FROM-clause entry for table "maintable"
> TIP:  There is an entry for table "maintable", but it cannot
> be referenced from this part of the query.

> so far so good, thats clear. But does anyone know a tricky
> solution for that problem?

"SELECT myfunc(pk) FROM maintable WHERE field =
statisticdata;"?

Tim


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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