]> granicus.if.org Git - postgresql/commit
Add an OR REPLACE option to CREATE LANGUAGE.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 23 Feb 2010 22:51:43 +0000 (22:51 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 23 Feb 2010 22:51:43 +0000 (22:51 +0000)
commit11b58470581f1c8cfad670c57ac3ffe77d1f0cdd
tree8fc7b3c2995b08720d6cd6ff48aa11dfec6187b2
parentc4fc082a5ac11c1206ed6707e3644914db36c6c3
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.
doc/src/sgml/ref/create_language.sgml
src/backend/commands/proclang.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/parser/gram.y
src/include/nodes/parsenodes.h