Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom type arrays are not expanded #59

Open
waaeer opened this issue Sep 25, 2019 · 1 comment
Open

Custom type arrays are not expanded #59

waaeer opened this issue Sep 25, 2019 · 1 comment

Comments

@waaeer
Copy link

waaeer commented Sep 25, 2019

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?

@turnstep
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants