Skip to content

Suggestion: functions that make use of 'any' pseudotype #5

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

Closed
decibel opened this issue Dec 10, 2016 · 5 comments
Closed

Suggestion: functions that make use of 'any' pseudotype #5

decibel opened this issue Dec 10, 2016 · 5 comments

Comments

@decibel
Copy link

decibel commented Dec 10, 2016

Just a suggestion... if you used the 'any' pseudotype (or one of it's variants), you could eliminate a lot of code and allow users to store any arbitrary type that they wanted.

@za-arthur
Copy link
Contributor

Thank you for the suggestion! Didn't think about it. I will try to implement it.

@za-arthur
Copy link
Contributor

Thank you for useful links!
I remembered, I tried to use 'any' pseudotype. But I met an issue. If I try to create function:

CREATE FUNCTION pgv_get(package text, name text, strict bool default true)
RETURNS anynonarray
AS 'MODULE_PATHNAME', 'variable_get_any'
LANGUAGE C VOLATILE;

I get the error:

ERROR:  cannot determine result data type
DETAIL:  A function returning a polymorphic type must have at least one polymorphic argument.

And the documentation confirms it.
Do you know how to handle it?

@decibel
Copy link
Author

decibel commented Dec 12, 2016 via email

@za-arthur
Copy link
Contributor

Thank you for your help!
Commited.

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

No branches or pull requests

2 participants