Re: polymorphic SQL functions has a problem with domains

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: polymorphic SQL functions has a problem with domains
Date: 2014-04-02 16:39:50
Message-ID: CAFj8pRCQVrRdpt=aWjR7UoJ9B0drEw6WH231truYTqVaO2Pk0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2014-04-02 18:34 GMT+02:00 David Johnston <polobo(at)yahoo(dot)com>:

> Tom Lane-2 wrote
> > David Johnston <
>
> > polobo@
>
> > > writes:
> >> Does something like:
> >> SELECT ($1 + $2)::$1%TYPE
> >> exist where you can explicitly cast to the type of the input argument?
> >
> > I don't think SQL-language functions have such a notation, but it's
> > possible in plpgsql, if memory serves.
>
> Indeed.
>
>
> http://www.postgresql.org/docs/9.3/interactive/plpgsql-declarations.html#PLPGSQL-DECLARATION-TYPE
>

This casting is indirect via assignment

>
> Section 40.3.3
>
> You lose inlining but at least it (should) work.
>
> David J.
>
>
>
>
>
>
> --
> View this message in context:
> http://postgresql.1045698.n5.nabble.com/polymorphic-SQL-functions-has-a-problem-with-domains-tp5798349p5798367.html
> Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2014-04-02 17:37:01 Re: It seems no Windows buildfarm members are running find_typedefs
Previous Message David Johnston 2014-04-02 16:34:15 Re: polymorphic SQL functions has a problem with domains