Re: Arrays of Records in PL/Perl

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Arrays of Records in PL/Perl
Date: 2011-07-12 19:19:43
Message-ID: CAFaPBrSAvxpk=kU8pPcznJdTr-+959MWG+o95gHaM6vLytD-Qw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 12, 2011 at 12:45, David E. Wheeler <david(at)kineticode(dot)com> wrote:
> Hackers,

> That is, if a record is passed to a PL/Perl function, it's correctly converted into a hash. If, however, an array of records are passed, the record are stringified, rather than turned into hashes. This seems inconsistent. Bug?

All Arrays in 9.0 and lower are strings, regardless of if they are
comprised of composite types. Its not so much a bug as a limitation.
Alexey Klyukin fixed this for 9.1 :-)

[ In 9.1 we could not make them straight perl arrayrefs as we needed
to keep the string representation for backwards compatibility. What we
did in 9.1 is overload the arrayref and string operations on blessed
object so you can treat it as either. ]

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-07-12 19:24:17 Re: reducing the overhead of frequent table locks, v4
Previous Message Joshua D. Drake 2011-07-12 19:13:08 Re: Full GUID support