Re: Recursive function that receives a list of IDs and returns all child IDs - Mailing list pgsql-general

From Sven Haag
Subject Re: Recursive function that receives a list of IDs and returns all child IDs
Date
Msg-id 4D8A2F00.9000605@gmx.de
Whole thread Raw
In response to Re: Recursive function that receives a list of IDs and returns all child IDs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
i guess an array is also ok. must been something like:
fn_get_subsamples(IN sample_numbers[] integer) ??

how would a query then look like?

SELECT * FROM sample WHERE sample_number IN ( fn_get_subsamples(1,2,3,4)
) ??

cheers sven




Am 23.03.2011 17:42, schrieb Tom Lane:
> "Sven Haag"<sven-haag@gmx.de>  writes:
>> hello pgsql fans out there,
>> i've already created a function that returns a list of IDs of all sub-samples based on a given sample ID. this works
fine.now i like to extend this function so that it can receive a list of sample IDs. e.g.: 
>> fn_get_subsamples(IN sample_numbers SETOF integer)
> There's no such animal as a function that accepts a set.  You could pass
> it an array of integers instead.  Or maybe just call it more than once.
>
>             regards, tom lane
>

pgsql-general by date:

Previous
From: Martín Marqués
Date:
Subject: Re: pg_dump problems
Next
From: Vick Khera
Date:
Subject: Re: pg_dump problems