Patch: create or replace language

Lists: pgsql-hackers
From: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Patch: create or replace language
Date: 2009-10-06 11:57:06
Message-ID: 20091006135706.2350f979@iridium.wars-nicht.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Hello,

following this old discussion:

http://archives.postgresql.org/pgsql-patches/2008-03/msg00402.php

i modifies the patch to use the "CREATE [OR REPLACE] LANGUAGE" syntax.
If the patch is ok, i will add the documentation too.

Kind regards

--
Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project

PGDay.eu 2009 in Paris, Nov. 6/7, http://www.pgday.eu/

Attachment Content-Type Size
create_or_replace_language_2009-10-06.patch text/x-patch 1.8 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: create or replace language
Date: 2009-10-06 14:13:54
Message-ID: 917.1254838434@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de> writes:
> following this old discussion:
> http://archives.postgresql.org/pgsql-patches/2008-03/msg00402.php
> i modifies the patch to use the "CREATE [OR REPLACE] LANGUAGE" syntax.

This is not an "OR REPLACE" operation, because it doesn't replace
the existing definition. What you've got here is a CREATE IF NOT EXISTS
implementation that arbitrarily uses the other syntax. The point of
the previous discussion was summed up here:
http://archives.postgresql.org/pgsql-patches/2008-03/msg00416.php
namely that CREATE OR REPLACE should leave the object having the
properties specified in the command.

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: create or replace language
Date: 2009-10-06 14:24:50
Message-ID: 20091006142450.GE5929@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andreas 'ads' Scherbaum wrote:
>
> Hello,
>
> following this old discussion:
>
> http://archives.postgresql.org/pgsql-patches/2008-03/msg00402.php
>
> i modifies the patch to use the "CREATE [OR REPLACE] LANGUAGE" syntax.
> If the patch is ok, i will add the documentation too.

Please send a context diff (however much ED IS THE STANDARD!!! TEXT
EDITOR, we don't like its patches here). Note that you probably missed
updates to other functions touching the node to which you add the
boolean. Also, per Tom's followup,

> Index: src/include/nodes/parsenodes.h
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/include/nodes/parsenodes.h,v
> retrieving revision 1.402
> diff -r1.402 parsenodes.h
> 1570a1571
> > bool replace; /* T => replace if already exists */

this comment needs fixed.

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


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: create or replace language
Date: 2009-10-06 14:30:45
Message-ID: 603c8f070910060730oe9a761eo31bb36d1893d4d4e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Oct 6, 2009 at 10:24 AM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com> wrote:
> Andreas 'ads' Scherbaum wrote:
>>
>> Hello,
>>
>> following this old discussion:
>>
>> http://archives.postgresql.org/pgsql-patches/2008-03/msg00402.php
>>
>> i modifies the patch to use the "CREATE [OR REPLACE] LANGUAGE" syntax.
>> If the patch is ok, i will add the documentation too.
>
> Please send a context diff (however much ED IS THE STANDARD!!! TEXT
> EDITOR, we don't like its patches here).  Note that you probably missed
> updates to other functions touching the node to which you add the
> boolean.  Also, per Tom's followup,
>
>> Index: src/include/nodes/parsenodes.h
>> ===================================================================
>> RCS file: /projects/cvsroot/pgsql/src/include/nodes/parsenodes.h,v
>> retrieving revision 1.402
>> diff -r1.402 parsenodes.h
>> 1570a1571
>> >     bool            replace;                /* T => replace if already exists */
>
> this comment needs fixed.

Maybe I'm out of line to say this, but it seems to me that we should
not even be looking at newly-submitted patches at this point.

...Robert


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: create or replace language
Date: 2009-10-06 14:41:21
Message-ID: 20091006144121.GG5929@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas escribió:
> On Tue, Oct 6, 2009 at 10:24 AM, Alvaro Herrera
> <alvherre(at)commandprompt(dot)com> wrote:

> > this comment needs fixed.
>
> Maybe I'm out of line to say this, but it seems to me that we should
> not even be looking at newly-submitted patches at this point.

Yeah, it was so short I didn't see any point in not commenting.

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: create or replace language
Date: 2009-10-06 14:48:39
Message-ID: 1543.1254840519@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Maybe I'm out of line to say this, but it seems to me that we should
> not even be looking at newly-submitted patches at this point.

It would have been more work to put it in the queue to reject later
than to reject it now ;-). Besides, this way Andreas has a chance
to rewrite it into something acceptable before the next CF.

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: create or replace language
Date: 2009-10-06 14:49:46
Message-ID: 603c8f070910060749t45122a1dg1808aac159bf053e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Oct 6, 2009 at 10:48 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Maybe I'm out of line to say this, but it seems to me that we should
>> not even be looking at newly-submitted patches at this point.
>
> It would have been more work to put it in the queue to reject later
> than to reject it now ;-).  Besides, this way Andreas has a chance
> to rewrite it into something acceptable before the next CF.

Fair enough.

...Robert


From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: create or replace language
Date: 2009-10-06 17:00:52
Message-ID: 73BB26D1EE46BABBDD55EC6D@amenophis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

--On 6. Oktober 2009 10:13:54 -0400 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> http://archives.postgresql.org/pgsql-patches/2008-03/msg00416.php
> namely that CREATE OR REPLACE should leave the object having the
> properties specified in the command.

Maybe when implementing this, it can be worth to keep an eye on ALTER
LANGUAGE too ?

--
Thanks

Bernd