[HACKERS] [PATCH] Cleanup of PLpgSQL_recfield

2008-11-04 Thread Jonah H. Harris
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 and doesn't seem along the same lines as the patches
in CommitFest... should I add it to the wiki anyway?

-- 
Jonah H. Harris, Senior DBA
myYearbook.com


plpgsql_unused_recrfno.patch
Description: Binary data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [PATCH] Cleanup of PLpgSQL_recfield

2008-11-04 Thread Tom Lane
Jonah H. Harris [EMAIL PROTECTED] 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*/
intdtype;
intdno;
} 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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [PATCH] Cleanup of PLpgSQL_recfield

2008-11-04 Thread Alvaro Herrera
Jonah H. Harris escribió:
 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 and doesn't seem along the same lines as the patches
 in CommitFest... should I add it to the wiki anyway?

Nah -- I just applied it.  Thanks.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [PATCH] Cleanup of PLpgSQL_recfield

2008-11-04 Thread Alvaro Herrera
Tom Lane escribió:
 Jonah H. Harris [EMAIL PROTECTED] 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.

Oops.  Reverting.


-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [PATCH] Cleanup of PLpgSQL_recfield

2008-11-04 Thread Jonah H. Harris
On Tue, Nov 4, 2008 at 3:57 PM, Tom Lane [EMAIL PROTECTED] wrote:
 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.

Attached.  Passed regressions and basic testing.

-- 
Jonah H. Harris, Senior DBA
myYearbook.com


plpgsql_datumnaming_cleanup.patch
Description: Binary data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [PATCH] Cleanup of PLpgSQL_recfield

2008-11-04 Thread Tom Lane
Jonah H. Harris [EMAIL PROTECTED] writes:
 On Tue, Nov 4, 2008 at 3:57 PM, Tom Lane [EMAIL PROTECTED] wrote:
 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.

 Attached.  Passed regressions and basic testing.

Looks good, applied.

regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers