1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Make LANCOMPILER clause in CREATE LANGUAGE optional. Allow "identifier"

syntax for language names (instead of 'string').

createlang now handles the case where a second language uses the same call
handler as an already installed language (e.g., plperl/plperlu).

droplang now handles the reverse case, i.e., dropping a language where
the call handler is still used by another language.  Moreover, droplang
can now be used to drop any user-defined language, not just the supplied
ones.
This commit is contained in:
Peter Eisentraut
2001-08-13 21:34:54 +00:00
parent 38cfc95865
commit ee8ed85da3
7 changed files with 118 additions and 123 deletions

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.243 2001/08/10 18:57:36 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.244 2001/08/13 21:34:51 petere Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -163,7 +163,8 @@ static void doNegateFloat(Value *v);
%type <list> OptUserList
%type <defelt> OptUserElem
%type <boolean> TriggerActionTime, TriggerForSpec, PLangTrusted, opt_procedural
%type <boolean> TriggerActionTime, TriggerForSpec, opt_trusted, opt_procedural
%type <str> opt_lancompiler
%type <str> OptConstrFromTable
@@ -1688,23 +1689,26 @@ IntegerOnly: Iconst
*
*****************************************************************************/
CreatePLangStmt: CREATE PLangTrusted opt_procedural LANGUAGE Sconst
HANDLER func_name LANCOMPILER Sconst
CreatePLangStmt: CREATE opt_trusted opt_procedural LANGUAGE ColId_or_Sconst
HANDLER func_name opt_lancompiler
{
CreatePLangStmt *n = makeNode(CreatePLangStmt);
n->plname = $5;
n->plhandler = $7;
n->plcompiler = $9;
n->plcompiler = $8;
n->pltrusted = $2;
$$ = (Node *)n;
}
;
PLangTrusted: TRUSTED { $$ = TRUE; }
opt_trusted: TRUSTED { $$ = TRUE; }
| /*EMPTY*/ { $$ = FALSE; }
;
DropPLangStmt: DROP opt_procedural LANGUAGE Sconst
opt_lancompiler: LANCOMPILER Sconst { $$ = $2; }
| /*EMPTY*/ { $$ = ""; }
DropPLangStmt: DROP opt_procedural LANGUAGE ColId_or_Sconst
{
DropPLangStmt *n = makeNode(DropPLangStmt);
n->plname = $4;
@@ -2511,7 +2515,7 @@ RecipeStmt: EXECUTE RECIPE recipe_name
*****************************************************************************/
ProcedureStmt: CREATE FUNCTION func_name func_args
RETURNS func_return AS func_as LANGUAGE Sconst opt_with
RETURNS func_return AS func_as LANGUAGE ColId_or_Sconst opt_with
{
ProcedureStmt *n = makeNode(ProcedureStmt);
n->funcname = $3;