Re: Record with a field consisting of table rows

From: Jon Smark <jon(dot)smark(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Record with a field consisting of table rows
Date: 2011-01-13 17:58:25
Message-ID: 846280.61221.qm@web112803.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

> That is certainly not going to work: that select does not produce an
> array, it produces a column of user_t (of which SELECT INTO is only
> gonna take the first, anyway).
>
> Untested, but I think you'd have better results with
>
>     _page.users := array(select users from users limit 10);

The above does work, thanks. There is however one drawback: the type
associated with _page.users is now an array. Is there a way to make
it a 'SETOF user_t'?

Best regards,
Jon

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2011-01-13 18:25:04 Re: Record with a field consisting of table rows
Previous Message Allen Chen 2011-01-13 17:34:45 Inconsistent time interval formatting