Re: Expressing a result set as an array (and vice versa)? - Mailing list pgsql-sql

From george young
Subject Re: Expressing a result set as an array (and vice versa)?
Date
Msg-id 20060325221102.31de88d7.gry@ll.mit.edu
Whole thread Raw
In response to Expressing a result set as an array (and vice versa)?  (Don Maier <dMaier@genome.stanford.edu>)
Responses Re: Expressing a result set as an array (and vice versa)?
List pgsql-sql
On Thu, 23 Mar 2006 11:44:32 -0800
Don Maier <dMaier@genome.stanford.edu> threw this fish to the penguins:

> Is it possible to construct an array from an appropriate select  
> expression that generates a result set of unknown cardinality?
> To focus on the simple case:  Is it possible to construct a one- 
> dimensional array from a select of a single column in a table with an  
> unknown number of rows?
  select array(select some_int_field from my_table where something);

produces an array of integers.  No user defined function is required.

> Conversely, is it possible to construct a (single column) result set  
> from a select expression on a one-dimensional array with an unknown  
> number of elements?
Not so easy without a custom function.

> Thanks for any hints!
> 
> Regards,
> Don Maier
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that your
>        message can get through to the mailing list cleanly
> 


-- 
"Are the gods not just?"  "Oh no, child.
What would become of us if they were?" (CSL)


pgsql-sql by date:

Previous
From: Daniel CAUNE
Date:
Subject: Re: Index on nullable column
Next
From: Volkan YAZICI
Date:
Subject: Re: Expressing a result set as an array (and vice versa)?