polymorphic parameters limits - correct solution?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: polymorphic parameters limits - correct solution?
Date: 2018-01-15 17:45:36
Message-ID: CAFj8pRDxOrWvS2+L0bE8=S1BKgre0eDRxtTc9zBk7XmAZgEBnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

I played with introduction of new pair of Polymorphic Parameters - like
anyXelement and anyXarray. Now, I don't think so enhancing PP is good way
now. Without significant redesign there are not practical append more code
there.

Why this is a issue? The extension's authors are not able to specify result
type without enumeration of all possible function signatures. Similar
situation is in argument processing - there are workaround based on "any"
type.

Can we design helper function used only for function that returns "any"
type, that returns correct result type?

some like

CREATE OR REPLACE FUNCTION fx("any", "any")
RETURNS "any" AS ...

CREATE OR REPLACE FUNCTION fx_helper(Oid[])
RETURNS Oid AS ..

ALTER FUNCTION fx("any", "any") SET ('result_helper', 'fx_helper'::regproc);

possibly, there can be some argument helper, that can specify UNKNOWN
arguments.

Notes, comments?

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-01-15 17:53:58 Re: proposal: alternative psql commands quit and exit
Previous Message Geoff Winkless 2018-01-15 17:43:39 Re: proposal: alternative psql commands quit and exit