Re: RETURNS SETOF primitive returns results in parentheses

From: Mario Splivalo <mario(dot)splivalo(at)mobart(dot)hr>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: RETURNS SETOF primitive returns results in parentheses
Date: 2005-10-26 13:09:20
Message-ID: 1130332161.7400.56.camel@ekim
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, 2005-10-26 at 08:54 -0400, Sean Davis wrote:
> > Now, when I do this:
> >
> > biblio3=# select * from php_get_subfield_data_repeating(1,'606a');
> > php_get_subfield_data_repeating1
> > ----------------------------------
> > (Anđeli)
> > (ofsajd)
> > (2 rows)
>
> Does:
>
> select * from php_get_subfield_data_repeating(1,'606a') as s(a)
>
> do what you want (single column)?
>

Nope. I still get the results in parentheses. When I change the SETOF
from varchar to my defined type, your query [with as s(a)] I get normal
resutls, withouth parentheses. I clearly have solved a problem, I just
need to create a type containing one member only, with the type of
varchar, and instead of 'RETURNS SETOF varchar' i need to do 'RETURNS
SETOF my_varchar_type'. I'm just wondering is this like that 'by
design', or is it a bug.

I've been reproducing this on postgres versions 7.4.8, 7.4.9, 8.0.3,
8.0.4 and 8.1beta3.

Mike
--
Mario Splivalo
Mob-Art
mario(dot)splivalo(at)mobart(dot)hr

"I can do it quick, I can do it cheap, I can do it well. Pick any two."

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 2005-10-26 14:28:30 Re: pl/* overhead ...
Previous Message Sean Davis 2005-10-26 12:54:51 Re: RETURNS SETOF primitive returns results in parentheses