2008/11/13 Tom Lane <[EMAIL PROTECTED]>:
> "Pavel Stehule" <[EMAIL PROTECTED]> writes:
>> 2008/11/13 Tom Lane <[EMAIL PROTECTED]>:
>>> My example was done in 8.3.
>
>> I tested it with error:
>
>> postgres=# select array(select row(a,b) from f);
>> ERROR: could not find array type for datatype rec
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
> 2008/11/13 Tom Lane <[EMAIL PROTECTED]>:
>> My example was done in 8.3.
> I tested it with error:
> postgres=# select array(select row(a,b) from f);
> ERROR: could not find array type for datatype record
You left out the cast to a named rowtype ---
2008/11/13 Tom Lane <[EMAIL PROTECTED]>:
> "Pavel Stehule" <[EMAIL PROTECTED]> writes:
>> 2008/11/13 Tom Lane <[EMAIL PROTECTED]>:
>>> Sure you can, if you're using a version new enough to have arrays of
>>> composite types.
>
>> I don't expect so user use devel version ;)
>
> My example was done i
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
> 2008/11/13 Tom Lane <[EMAIL PROTECTED]>:
>> Sure you can, if you're using a version new enough to have arrays of
>> composite types.
> I don't expect so user use devel version ;)
My example was done in 8.3.
> - and result is array of
> some composite
2008/11/13 Tom Lane <[EMAIL PROTECTED]>:
> "Pavel Stehule" <[EMAIL PROTECTED]> writes:
>> 2008/11/13 Marcin Krawczyk <[EMAIL PROTECTED]>:
>>> Because if I try this :
>>> a := ARRAY(SELECT id, p FROM idx);
>>> I get
>>> ERROR: subquery must return only one column
>
>> you can't do it directly :( now
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
> 2008/11/13 Marcin Krawczyk <[EMAIL PROTECTED]>:
>> Because if I try this :
>> a := ARRAY(SELECT id, p FROM idx);
>> I get
>> ERROR: subquery must return only one column
> you can't do it directly :( now.
Sure you can, if you're using a version new eno
Στις Thursday 13 November 2008 11:13:30 ο/η Marcin Krawczyk έγραψε:
> I know I can do one column like this :
>
> a := ARRAY(SELECT id FROM idx);
>
> but how about more than one ?
> Because if I try this :
>
> a := ARRAY(SELECT id, p FROM idx);
>
> I get
> ERROR: subquery must return only one co
Thank you guys, I appreciate your help.
regards
mk
Hello
2008/11/13 Marcin Krawczyk <[EMAIL PROTECTED]>:
> I know I can do one column like this :
>
> a := ARRAY(SELECT id FROM idx);
>
> but how about more than one ?
> Because if I try this :
>
> a := ARRAY(SELECT id, p FROM idx);
>
> I get
> ERROR: subquery must return only one column
> SQL state:
I know I can do one column like this :
a := ARRAY(SELECT id FROM idx);
but how about more than one ?
Because if I try this :
a := ARRAY(SELECT id, p FROM idx);
I get
ERROR: subquery must return only one column
SQL state: 42601
regards
mk
Hi all. Can anyone help me solve this problem ? Say I have something like
this:
CREATE TEMP TABLE idx (id integer, p integer, idd integer);
INSERT INTO idx (id, p, idd) VALUES (3048, 1, 12043);
INSERT INTO idx (id, p, idd) VALUES (3048, 2, 2321);
INSERT INTO idx (id, p, idd) VALUES (3048, 5, 12002
11 matches
Mail list logo