Re: "ERROR: Argument of WHERE must not be a set function"?

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: Drew Wilson <amw(at)speakeasy(dot)net>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: "ERROR: Argument of WHERE must not be a set function"?
Date: 2003-05-16 23:54:35
Message-ID: 3EC57A3B.2080909@cvc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

a view instead of the function?

Drew Wilson wrote:
> I want to use a function to generate a list of OIDs to be used in a
> subselect.
>
> However, I can't figure out what to return from my function that will
> properly work in a WHERE clause.
>
> I tried:
> CREATE FUNCTION myTest() RETURNS SETOF oid AS 'SELECT id FROM foo;'
> LANGUAGE SQL;
>
> But when I try:
> SELECT * FROM foo WHERE id in in (myTest());
>
> I get this error message:
> "ERROR: Argument of WHERE must not be a set function"
>
>
> How can I use a function to generate my subselect? (I want to cal my
> function just once, and avoid calling it once per row.)
>
> Thanks,
>
> Drew
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roman Fail 2003-05-17 01:22:12 Re: MSSQL -> PostgreSQL
Previous Message scott.marlowe 2003-05-16 23:39:10 Re: priority on a process