dbdpg icon indicating copy to clipboard operation
dbdpg copied to clipboard

Custom type arrays are not expanded

Open waaeer opened this issue 5 years ago • 1 comments

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?

waaeer avatar Sep 25 '19 20:09 waaeer

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).

turnstep avatar Apr 28 '20 13:04 turnstep