Search Postgresql Archives

arrays, composite types

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

 



I'm looking for an equivalent of my_composite_type[] for use as a
parameter of a pl/pgsql function. What do people use to dodge this
limitation?

Background: I have a few plpgsql functions that basically accept an
array of objects decomposed into arrays of the objects' attributes:

 CREATE FUNCTION do_foo(int4, int4[], int4[], varchar[]) RETURNS int4 VOLATILE

which I'd like to convert to

 CREATE FUNCTION do_foo(int4, myctype[]) RETURNS int4 VOLATILE

so that the functions only need recompilation when myctype changes.

myctype is

 CREATE TYPE myctype AS (a int4, b int4, c varchar)

Ideally, what I'm looking for will work in plpgsql, but I'm ok with
writing a bit or two in C as long as it can be made short,
selfcontained, and bugfree (crashing PostgreSQL or wrong data would be
enough rope to hang myself on I'm afraid).

BTW, I don't see arrays of composite types in the TODO, and the ability
to specify composite types indirectly through schema.rel.attr%TYPE isn't
there either. Are these two features out of the question for some
reason?

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

[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