diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-02-23 22:51:43 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-02-23 22:51:43 +0000 |
commit | 11b58470581f1c8cfad670c57ac3ffe77d1f0cdd (patch) | |
tree | 8fc7b3c2995b08720d6cd6ff48aa11dfec6187b2 /src/include/nodes/parsenodes.h | |
parent | c4fc082a5ac11c1206ed6707e3644914db36c6c3 (diff) |
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.
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r-- | src/include/nodes/parsenodes.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index ca229c8e23d..5a5c040c251 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -13,7 +13,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.430 2010/02/16 22:34:57 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.431 2010/02/23 22:51:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1623,6 +1623,7 @@ typedef struct CreateTrigStmt typedef struct CreatePLangStmt { NodeTag type; + bool replace; /* T => replace if already exists */ char *plname; /* PL name */ List *plhandler; /* PL call handler function (qual. name) */ List *plinline; /* optional inline function (qual. name) */ |