Re: create or replace language - Mailing list pgsql-patches

From Andreas 'ads' Scherbaum
Subject Re: create or replace language
Date
Msg-id 20080503183802.7984d44b@iridium.wars-nicht.de
Whole thread Raw
In response to Re: create language ... if not exists  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: create or replace language  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Sat, 29 Mar 2008 22:35:21 -0400 Tom Lane wrote:

> The key argument seems to be that it's quite unclear what the state
> following CREATE IF NOT EXISTS (CINE) should be, if the object does
> exist but not with the same properties specified in the CINE command.
> CREATE OR REPLACE resolves that by making it clear that it's gonna be
> what the command says.  Perhaps there is a use-case for the alternate
> behavior where the pre-existing object doesn't get modified, but I'm
> not too sure what it would be.

Attached is a first version for the "CREATE OR REPLACE LANGUAGE" patch.
It's still missing some functionality (especially the update part is
far away from being complete) and it's also missing documentation.

I just want to know if i'm heading in the right direction or if
something is totally broken in my basic approach:


In case a language is already in pg_pltemplate, the (possibly changed)
values from this table are used to update the pg_languages entry. This
gives the ability to change the owner, trust status, the language or
validator handler.

In case the language is not in pg_pltemplate, the values from the
commandline are used, just like "create language".



Thanks & kind regards

--
                Andreas 'ads' Scherbaum
German PostgreSQL User Group

Attachment

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [COMMITTERS] pgsql: Sigh ...
Next
From: Tom Lane
Date:
Subject: Re: Exposing keywords to clients