Re: plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types
Date
Msg-id CAFj8pRBDoXuqrTg-6qCOWECJmKDKBzHOMgoE868TZxqVGDoAXg@mail.gmail.com
Whole thread Raw
In response to Re: plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types  (Artur Zakirov <a.zakirov@postgrespro.ru>)
Responses Re: plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types
List pgsql-hackers
Hi

I am sending updated version - the changes are related to fix comments.

2016-02-19 10:41 GMT+01:00 Artur Zakirov <a.zakirov@postgrespro.ru>:
It seems all fixes are done. I tested the patch and regression tests passed.

I think here Alvaro means that you should keep original comment without the ROW. Like this:

/* XXX perhaps allow REC here? */

I tried rewording this comment




    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.
 



I noticed a little typo in the comment in the derive_type():
/* Return base_type, when it is a array already */

should be:
/* Return base_type, when it is an array already */


fixed

Regards

Pavel
 

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

Attachment

pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: checkpointer continuous flushing - V18
Next
From: Robert Haas
Date:
Subject: Re: postgres_fdw join pushdown (was Re: Custom/Foreign-Join-APIs)