dbdpg
dbdpg copied to clipboard
Custom type arrays are not expanded
If a user defines a new type, say
CREATE DOMAIN positive_int AS int CHECK (value >= 0);
and then selects an array of such type, like
SELECT ARRAY[1,2,3]::positive_int[];
this array will not be expanded, while arrays of int are expanded as pg_expand_array is true.
The user expects that array of any type should be expanded to a Perl array.
Definitely, this is a consequence of hardcoding the datatypes data in types.c
My proposal is to extend the pg_type_data() implementation in order to search for the unknown data types in the database.
What is your opinion on this?
One of the problems is when and how does DBD::Pg search for custom types? On startup? As a special user-invoked function? As they are detected? (ideal, but too late).