Re: plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types

From: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types
Date: 2016-02-24 09:48:43
Message-ID: 56CD7C7B.6060304@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 21.02.2016 11:31, Pavel Stehule wrote:
> Hi
>
> I am sending updated version - the changes are related to fix comments.
>

Great.

I am new in reviewing, I think Pavel took into account all comments.
This patch is compiled and regression tests are passed. So I change its
status to "Ready for Committer".

>
>
> By the way, these functions are misnamed after this patch.
> They are
> called "wordtype" and "cwordtype" originally because they
> accept
> "word%TYPE" and "compositeword%TYPE", but after the patch
> they not only
> accept TYPE at the right of the percent sign but also
> ELEMENTTYPE and
> ARRAYTYPE. Not sure that this is something we want to be
> too strict
> about.
>
>
> Understand - used name ***reftype instead ****type
>
>
> I am not sure, but it seems that new names is a little worse. I
> think original names are good too. They accept a word and return the
> PLpgSQL_type structure.
>
>
> The "TYPE" word in this name was related to syntax %TYPE. And because
> new syntax allows more constructs, then the change name is correct. I am
> think. But choosing names is hard work. The new name little bit more
> strongly show relation to work with referenced types.
>

Agree.

--
Artur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2016-02-24 10:02:09 Re: WIP: Failover Slots
Previous Message Oleg Bartunov 2016-02-24 09:35:15 Re: The plan for FDW-based sharding