Arrays of Records in PL/Perl
От | David E. Wheeler |
---|---|
Тема | Arrays of Records in PL/Perl |
Дата | |
Msg-id | 25EBA9D7-6B0F-4550-8D6F-354CB3185972@kineticode.com обсуждение исходный текст |
Ответы |
Re: Arrays of Records in PL/Perl
|
Список | pgsql-hackers |
Hackers, Given this script: BEGIN; CREATE TYPE foo AS ( this int, that int ); CREATE OR REPLACE FUNCTION dump(foo[]) returns text language plperlu AS $$ use Data::Dumper; Dumper shift; $$; CREATE OR REPLACE FUNCTION dump(foo) returns text language plperlu AS $$ use Data::Dumper; Dumper shift; $$; select dump(row(3, 5)::foo); select dump(ARRAY[row(3, 5)::foo]); ROLLBACK; The output is: dump -------------------------- $VAR1 = { + 'that' => '5',+ 'this' => '3' + }; + (1 row) Time: 0.936 ms dump ---------------------- $VAR1 = '{"(3,5)"}';+ (1 row) That is, if a record is passed to a PL/Perl function, it's correctly converted into a hash. If, however, an array of recordsare passed, the record are stringified, rather than turned into hashes. This seems inconsistent. Bug? Thanks, David
В списке pgsql-hackers по дате отправления: