Remove obsolete uses of lanispl. Only used in pg_dump now, but can be
authorPeter Eisentraut
Tue, 13 Aug 2002 17:22:08 +0000 (17:22 +0000)
committerPeter Eisentraut
Tue, 13 Aug 2002 17:22:08 +0000 (17:22 +0000)
removed altogether if pg_dump doesn't need it anymore.

doc/src/sgml/catalogs.sgml
src/backend/commands/proclang.c
src/backend/commands/trigger.c
src/backend/utils/fmgr/fmgr.c

index 38dbe32aad7b6a492eacc104395b0d0e3b389393..e62493b525772635f9bbcff62d129dc42f24e875 100644 (file)
@@ -1,6 +1,6 @@
 
 
 
       
       
        This is false for internal languages (such as SQL) and true for
-       dynamically loaded language handler modules.  It essentially
-       means that, if it is true, the language may be dropped.
+       user-defined languages.  Currently,
+       pg_dump still uses this to determine
+       which languages need to be dumped, but this may be replaced by
+       a different mechanism sometime.
       
      
 
index 0c28dea73171e3550ea5f5d18589360ea831e05a..9672e74ea9bc9c69464db98aff3e7e3290bb5ee1 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.39 2002/08/05 03:29:17 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.40 2002/08/13 17:22:08 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -56,7 +56,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
     * Check permission
     */
    if (!superuser())
-       elog(ERROR, "Only users with Postgres superuser privilege are "
+       elog(ERROR, "Only users with superuser privilege are "
             "permitted to create procedural languages");
 
    /*
@@ -77,10 +77,10 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
    MemSet(typev, 0, sizeof(typev));
    procOid = LookupFuncName(stmt->plhandler, 0, typev);
    if (!OidIsValid(procOid))
-       elog(ERROR, "PL handler function %s() doesn't exist",
+       elog(ERROR, "function %s() doesn't exist",
             NameListToString(stmt->plhandler));
    if (get_func_rettype(procOid) != InvalidOid)
-       elog(ERROR, "PL handler function %s() does not return type \"opaque\"",
+       elog(ERROR, "function %s() does not return type \"opaque\"",
             NameListToString(stmt->plhandler));
 
    /* validate the validator function */
@@ -89,7 +89,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
        typev[0] = OIDOID;
        valProcOid = LookupFuncName(stmt->plvalidator, 1, typev);
        if (!OidIsValid(valProcOid))
-           elog(ERROR, "PL validator function %s(oid) doesn't exist",
+           elog(ERROR, "function %s(oid) doesn't exist",
                 NameListToString(stmt->plvalidator));
    }
    else
@@ -162,7 +162,7 @@ DropProceduralLanguage(DropPLangStmt *stmt)
     * Check permission
     */
    if (!superuser())
-       elog(ERROR, "Only users with Postgres superuser privilege are "
+       elog(ERROR, "Only users with superuser privilege are "
             "permitted to drop procedural languages");
 
    /*
@@ -177,10 +177,6 @@ DropProceduralLanguage(DropPLangStmt *stmt)
    if (!HeapTupleIsValid(langTup))
        elog(ERROR, "Language %s doesn't exist", languageName);
 
-   if (!((Form_pg_language) GETSTRUCT(langTup))->lanispl)
-       elog(ERROR, "Language %s isn't a created procedural language",
-            languageName);
-
    object.classId = get_system_catalog_relid(LanguageRelationName);
    object.objectId = HeapTupleGetOid(langTup);
    object.objectSubId = 0;
index 7fa570890d59879c63407d2bf7680b7bb68ce012..cc97c569ba5f3803d78c10deea8006936c8b1b3c 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.124 2002/08/05 03:29:17 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.125 2002/08/13 17:22:08 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -74,7 +74,6 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
    HeapTuple   tuple;
    Oid         fargtypes[FUNC_MAX_ARGS];
    Oid         funcoid;
-   Oid         funclang;
    Oid         trigoid;
    int         found = 0;
    int         i;
@@ -207,24 +206,8 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
    if (((Form_pg_proc) GETSTRUCT(tuple))->prorettype != 0)
        elog(ERROR, "CreateTrigger: function %s() must return OPAQUE",
             NameListToString(stmt->funcname));
-   funclang = ((Form_pg_proc) GETSTRUCT(tuple))->prolang;
    ReleaseSysCache(tuple);
 
-   if (funclang != ClanguageId && funclang != INTERNALlanguageId)
-   {
-       HeapTuple   langTup;
-
-       langTup = SearchSysCache(LANGOID,
-                                ObjectIdGetDatum(funclang),
-                                0, 0, 0);
-       if (!HeapTupleIsValid(langTup))
-           elog(ERROR, "CreateTrigger: cache lookup for language %u failed",
-                funclang);
-       if (((Form_pg_language) GETSTRUCT(langTup))->lanispl == false)
-           elog(ERROR, "CreateTrigger: only internal, C and PL functions are supported");
-       ReleaseSysCache(langTup);
-   }
-
    /*
     * Build the new pg_trigger tuple.
     */
index 1b2e0d9ef26539cd8041338d08b916e1c43d17cc..7e3204c5c0e8c2b3f5698c578478004f16d8093e 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.60 2002/06/20 20:29:39 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.61 2002/08/13 17:22:08 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -324,6 +324,7 @@ fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
    Oid         language = procedureStruct->prolang;
    HeapTuple   languageTuple;
    Form_pg_language languageStruct;
+   FmgrInfo    plfinfo;
 
    languageTuple = SearchSysCache(LANGOID,
                                   ObjectIdGetDatum(language),
@@ -332,27 +333,19 @@ fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
        elog(ERROR, "fmgr_info: cache lookup for language %u failed",
             language);
    languageStruct = (Form_pg_language) GETSTRUCT(languageTuple);
-   if (languageStruct->lanispl)
-   {
-       FmgrInfo    plfinfo;
 
-       fmgr_info(languageStruct->lanplcallfoid, &plfinfo);
-       finfo->fn_addr = plfinfo.fn_addr;
+   fmgr_info(languageStruct->lanplcallfoid, &plfinfo);
+   finfo->fn_addr = plfinfo.fn_addr;
+
+   /*
+    * If lookup of the PL handler function produced nonnull fn_extra,
+    * complain --- it must be an oldstyle function! We no longer
+    * support oldstyle PL handlers.
+    */
+   if (plfinfo.fn_extra != NULL)
+       elog(ERROR, "fmgr_info: language %u has old-style handler",
+            language);
 
-       /*
-        * If lookup of the PL handler function produced nonnull fn_extra,
-        * complain --- it must be an oldstyle function! We no longer
-        * support oldstyle PL handlers.
-        */
-       if (plfinfo.fn_extra != NULL)
-           elog(ERROR, "fmgr_info: language %u has old-style handler",
-                language);
-   }
-   else
-   {
-       elog(ERROR, "fmgr_info: function %u: unsupported language %u",
-            functionId, language);
-   }
    ReleaseSysCache(languageTuple);
 }