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

Поиск
Список
Период
Сортировка
Искать
От
Drew Wilson
Тема
Re: "ERROR: Argument of WHERE must not be a set function"?
Дата
Msg-id
56DA69AE-7067-11D7-AB01-00039342B2CE@speakeasy.net
Ответ на
Список
Дерево обсуждения
Passing nulls into PL/pgSQL functions Adam Witney <awitney@sghms.ac.uk>
Re: Passing nulls into PL/pgSQL functions Tom Lane <tgl@sss.pgh.pa.us>
"ERROR: Argument of WHERE must not be a set function"? Drew Wilson <amw@speakeasy.net>
Re: "ERROR: Argument of WHERE must not be a set function"? Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: "ERROR: Argument of WHERE must not be a set function"? Drew Wilson <amw@speakeasy.net>
Re: "ERROR: Argument of WHERE must not be a set function"? Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: "ERROR: Argument of WHERE must not be a set function"? Dennis Gearon <gearond@cvc.net>
Re: "ERROR: Argument of WHERE must not be a set function"? Drew Wilson <amw@speakeasy.net>
Re: "ERROR: Argument of WHERE must not be a set function"? Drew Wilson <amw@speakeasy.net>
I have to insert/update/delete into these tables. If I use views, I'd 
have to write rules to handle the write-through operations.

I'd like to avoid that extra code.

Drew

On Friday, May 16, 2003, at 04:54 PM, Dennis Gearon wrote:

> 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
>
>
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to 
> majordomo@postgresql.org
>

В списке pgsql-general по дате отправления
От: Dennis Gearon
Дата:
От: Stephan Szabo
Дата:
FAQ