Skip to content

Commit 1e4c4f9

Browse files
committed
Remove obsolete uses of lanispl. Only used in pg_dump now, but can be
removed altogether if pg_dump doesn't need it anymore.
1 parent ccf1502 commit 1e4c4f9

File tree

4 files changed

+25
-51
lines changed

4 files changed

+25
-51
lines changed

doc/src/sgml/catalogs.sgml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
Documentation of the system catalogs, directed toward PostgreSQL developers
3-
$Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.52 2002/08/05 02:30:46 tgl Exp $
3+
$Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.53 2002/08/13 17:22:08 petere Exp $
44
-->
55

66
<chapter id="catalogs">
@@ -1991,8 +1991,10 @@
19911991
<entry></entry>
19921992
<entry>
19931993
This is false for internal languages (such as SQL) and true for
1994-
dynamically loaded language handler modules. It essentially
1995-
means that, if it is true, the language may be dropped.
1994+
user-defined languages. Currently,
1995+
<application>pg_dump</application> still uses this to determine
1996+
which languages need to be dumped, but this may be replaced by
1997+
a different mechanism sometime.
19961998
</entry>
19971999
</row>
19982000

src/backend/commands/proclang.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.39 2002/08/05 03:29:17 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.40 2002/08/13 17:22:08 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -56,7 +56,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
5656
* Check permission
5757
*/
5858
if (!superuser())
59-
elog(ERROR, "Only users with Postgres superuser privilege are "
59+
elog(ERROR, "Only users with superuser privilege are "
6060
"permitted to create procedural languages");
6161

6262
/*
@@ -77,10 +77,10 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
7777
MemSet(typev, 0, sizeof(typev));
7878
procOid = LookupFuncName(stmt->plhandler, 0, typev);
7979
if (!OidIsValid(procOid))
80-
elog(ERROR, "PL handler function %s() doesn't exist",
80+
elog(ERROR, "function %s() doesn't exist",
8181
NameListToString(stmt->plhandler));
8282
if (get_func_rettype(procOid) != InvalidOid)
83-
elog(ERROR, "PL handler function %s() does not return type \"opaque\"",
83+
elog(ERROR, "function %s() does not return type \"opaque\"",
8484
NameListToString(stmt->plhandler));
8585

8686
/* validate the validator function */
@@ -89,7 +89,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
8989
typev[0] = OIDOID;
9090
valProcOid = LookupFuncName(stmt->plvalidator, 1, typev);
9191
if (!OidIsValid(valProcOid))
92-
elog(ERROR, "PL validator function %s(oid) doesn't exist",
92+
elog(ERROR, "function %s(oid) doesn't exist",
9393
NameListToString(stmt->plvalidator));
9494
}
9595
else
@@ -162,7 +162,7 @@ DropProceduralLanguage(DropPLangStmt *stmt)
162162
* Check permission
163163
*/
164164
if (!superuser())
165-
elog(ERROR, "Only users with Postgres superuser privilege are "
165+
elog(ERROR, "Only users with superuser privilege are "
166166
"permitted to drop procedural languages");
167167

168168
/*
@@ -177,10 +177,6 @@ DropProceduralLanguage(DropPLangStmt *stmt)
177177
if (!HeapTupleIsValid(langTup))
178178
elog(ERROR, "Language %s doesn't exist", languageName);
179179

180-
if (!((Form_pg_language) GETSTRUCT(langTup))->lanispl)
181-
elog(ERROR, "Language %s isn't a created procedural language",
182-
languageName);
183-
184180
object.classId = get_system_catalog_relid(LanguageRelationName);
185181
object.objectId = HeapTupleGetOid(langTup);
186182
object.objectSubId = 0;

src/backend/commands/trigger.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.124 2002/08/05 03:29:17 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.125 2002/08/13 17:22:08 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -74,7 +74,6 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
7474
HeapTuple tuple;
7575
Oid fargtypes[FUNC_MAX_ARGS];
7676
Oid funcoid;
77-
Oid funclang;
7877
Oid trigoid;
7978
int found = 0;
8079
int i;
@@ -207,24 +206,8 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
207206
if (((Form_pg_proc) GETSTRUCT(tuple))->prorettype != 0)
208207
elog(ERROR, "CreateTrigger: function %s() must return OPAQUE",
209208
NameListToString(stmt->funcname));
210-
funclang = ((Form_pg_proc) GETSTRUCT(tuple))->prolang;
211209
ReleaseSysCache(tuple);
212210

213-
if (funclang != ClanguageId && funclang != INTERNALlanguageId)
214-
{
215-
HeapTuple langTup;
216-
217-
langTup = SearchSysCache(LANGOID,
218-
ObjectIdGetDatum(funclang),
219-
0, 0, 0);
220-
if (!HeapTupleIsValid(langTup))
221-
elog(ERROR, "CreateTrigger: cache lookup for language %u failed",
222-
funclang);
223-
if (((Form_pg_language) GETSTRUCT(langTup))->lanispl == false)
224-
elog(ERROR, "CreateTrigger: only internal, C and PL functions are supported");
225-
ReleaseSysCache(langTup);
226-
}
227-
228211
/*
229212
* Build the new pg_trigger tuple.
230213
*/

src/backend/utils/fmgr/fmgr.c

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.60 2002/06/20 20:29:39 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.61 2002/08/13 17:22:08 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -324,6 +324,7 @@ fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
324324
Oid language = procedureStruct->prolang;
325325
HeapTuple languageTuple;
326326
Form_pg_language languageStruct;
327+
FmgrInfo plfinfo;
327328

328329
languageTuple = SearchSysCache(LANGOID,
329330
ObjectIdGetDatum(language),
@@ -332,27 +333,19 @@ fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
332333
elog(ERROR, "fmgr_info: cache lookup for language %u failed",
333334
language);
334335
languageStruct = (Form_pg_language) GETSTRUCT(languageTuple);
335-
if (languageStruct->lanispl)
336-
{
337-
FmgrInfo plfinfo;
338336

339-
fmgr_info(languageStruct->lanplcallfoid, &plfinfo);
340-
finfo->fn_addr = plfinfo.fn_addr;
337+
fmgr_info(languageStruct->lanplcallfoid, &plfinfo);
338+
finfo->fn_addr = plfinfo.fn_addr;
339+
340+
/*
341+
* If lookup of the PL handler function produced nonnull fn_extra,
342+
* complain --- it must be an oldstyle function! We no longer
343+
* support oldstyle PL handlers.
344+
*/
345+
if (plfinfo.fn_extra != NULL)
346+
elog(ERROR, "fmgr_info: language %u has old-style handler",
347+
language);
341348

342-
/*
343-
* If lookup of the PL handler function produced nonnull fn_extra,
344-
* complain --- it must be an oldstyle function! We no longer
345-
* support oldstyle PL handlers.
346-
*/
347-
if (plfinfo.fn_extra != NULL)
348-
elog(ERROR, "fmgr_info: language %u has old-style handler",
349-
language);
350-
}
351-
else
352-
{
353-
elog(ERROR, "fmgr_info: function %u: unsupported language %u",
354-
functionId, language);
355-
}
356349
ReleaseSysCache(languageTuple);
357350
}
358351

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy