Re: [PATCH] Cleanup of PLpgSQL_recfield

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: "Pg Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Cleanup of PLpgSQL_recfield
Date: 2008-11-04 20:57:52
Message-ID: 27613.1225832272@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Jonah H. Harris" <jonah(dot)harris(at)gmail(dot)com> writes:
> While looking to add some functionality to PL/pgSQL, I found that the
> rfno member of the PLpgSQL_recfield structure is unused. This patch
> is just a cleanup

No, that'd be wrong. Note here:

/*
* PLpgSQL_datum is the common supertype for PLpgSQL_expr, PLpgSQL_var,
* PLpgSQL_row, PLpgSQL_rec, PLpgSQL_recfield, PLpgSQL_arrayelem, and
* PLpgSQL_trigarg
*/
typedef struct
{ /* Generic datum array item */
int dtype;
int dno;
} PLpgSQL_datum;

I am not real sure why the code is inconsistent about spelling the
second field's name differently in some of the structs, but it seems
like a bad idea --- as you've demonstrated, it invites confusion.
What would probably be better is a patch to rename exprno, rfno, etc
to all be called dno to make this connection more obvious.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-11-04 20:58:56 Re: [PATCH] Cleanup of PLpgSQL_recfield
Previous Message Robert Haas 2008-11-04 20:57:34 Re: [WIP] In-place upgrade