Search Postgresql Archives

Re: Record with a field consisting of table rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> A tuple wouldn't be unusual, but you're not asking for a
> simple tuple here. What you're asking for is a value and a
> set of tuples.

Which is in itself a tuple!  This discussion is again veering slightly
off-topic, but note that tuples as mathematical objects do not have such
arbitrary limitations.


> And what's worse, after the first returned tuple you only
> seem to want the users value, without the total value. I
> don't know of any language that can do that and I'm pretty
> sure the languages you mentioned can't do that either. It
> makes parsing the return values unnecessary difficult, I bet
> that's a compelling enough reason that nobody seems to have
> implemented it.

Again, you're making it sound like I'm requesting something exotic,
while any language with a modern type system allows this and much
more without blinking.  In Ocaml, for example, the return type 'page_t'
of my function could be defined as follows:

type user_t = { uid: int; name: string; age: int; }
type page_t = int * user_t list

('user_'t is declared as a record with fields 'uid', 'name', and 'age';
'page_t' is defined as a tuple consisting of an integer and a list of
'user_t').

Moreover, we've already established that PL/pgSQL also allows the return
of a tuple consisting of an integer and an array of tuples.  All I wanted
was to change the latter portion into SETOF tuples...

Best regards,
Jon



      

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux