Thread: pgsql: Add an OR REPLACE option to CREATE LANGUAGE.

pgsql: Add an OR REPLACE option to CREATE LANGUAGE.

From
tgl@postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Add an OR REPLACE option to CREATE LANGUAGE.

This operates in the same way as other CREATE OR REPLACE commands, ie,
it replaces everything but the ownership and ACL lists of an existing
entry, and requires the caller to have owner privileges for that entry.

While modifying an existing language has some use in development scenarios,
in typical usage all the "replaced" values come from pg_pltemplate so there
will be no actual change in the language definition.  The reason for adding
this is mainly to allow programs to ensure that a language exists without
triggering an error if it already does exist.

This commit just adds and documents the new option.  A followon patch
will use it to clean up some unpleasant cases in pg_dump and pg_regress.

Modified Files:
--------------
    pgsql/doc/src/sgml/ref:
        create_language.sgml (r1.48 -> r1.49)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/create_language.sgml?r1=1.48&r2=1.49)
    pgsql/src/backend/commands:
        proclang.c (r1.89 -> r1.90)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/proclang.c?r1=1.89&r2=1.90)
    pgsql/src/backend/nodes:
        copyfuncs.c (r1.462 -> r1.463)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c?r1=1.462&r2=1.463)
        equalfuncs.c (r1.383 -> r1.384)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c?r1=1.383&r2=1.384)
    pgsql/src/backend/parser:
        gram.y (r2.710 -> r2.711)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y?r1=2.710&r2=2.711)
    pgsql/src/include/nodes:
        parsenodes.h (r1.430 -> r1.431)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/parsenodes.h?r1=1.430&r2=1.431)