Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
1e4c4f9e
Commit
1e4c4f9e
authored
Aug 13, 2002
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove obsolete uses of lanispl. Only used in pg_dump now, but can be
removed altogether if pg_dump doesn't need it anymore.
parent
ccf15026
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
51 deletions
+25
-51
doc/src/sgml/catalogs.sgml
doc/src/sgml/catalogs.sgml
+5
-3
src/backend/commands/proclang.c
src/backend/commands/proclang.c
+6
-10
src/backend/commands/trigger.c
src/backend/commands/trigger.c
+1
-18
src/backend/utils/fmgr/fmgr.c
src/backend/utils/fmgr/fmgr.c
+13
-20
No files found.
doc/src/sgml/catalogs.sgml
View file @
1e4c4f9e
<!--
<!--
Documentation of the system catalogs, directed toward PostgreSQL developers
Documentation of the system catalogs, directed toward PostgreSQL developers
$Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.5
2 2002/08/05 02:30:46 tgl
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.5
3 2002/08/13 17:22:08 petere
Exp $
-->
-->
<chapter id="catalogs">
<chapter id="catalogs">
...
@@ -1991,8 +1991,10 @@
...
@@ -1991,8 +1991,10 @@
<entry></entry>
<entry></entry>
<entry>
<entry>
This is false for internal languages (such as SQL) and true for
This is false for internal languages (such as SQL) and true for
dynamically loaded language handler modules. It essentially
user-defined languages. Currently,
means that, if it is true, the language may be dropped.
<application>pg_dump</application> still uses this to determine
which languages need to be dumped, but this may be replaced by
a different mechanism sometime.
</entry>
</entry>
</row>
</row>
...
...
src/backend/commands/proclang.c
View file @
1e4c4f9e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* 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)
...
@@ -56,7 +56,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
* Check permission
* Check permission
*/
*/
if
(
!
superuser
())
if
(
!
superuser
())
elog
(
ERROR
,
"Only users with
Postgres
superuser privilege are "
elog
(
ERROR
,
"Only users with superuser privilege are "
"permitted to create procedural languages"
);
"permitted to create procedural languages"
);
/*
/*
...
@@ -77,10 +77,10 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
...
@@ -77,10 +77,10 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
MemSet
(
typev
,
0
,
sizeof
(
typev
));
MemSet
(
typev
,
0
,
sizeof
(
typev
));
procOid
=
LookupFuncName
(
stmt
->
plhandler
,
0
,
typev
);
procOid
=
LookupFuncName
(
stmt
->
plhandler
,
0
,
typev
);
if
(
!
OidIsValid
(
procOid
))
if
(
!
OidIsValid
(
procOid
))
elog
(
ERROR
,
"
PL handler
function %s() doesn't exist"
,
elog
(
ERROR
,
"function %s() doesn't exist"
,
NameListToString
(
stmt
->
plhandler
));
NameListToString
(
stmt
->
plhandler
));
if
(
get_func_rettype
(
procOid
)
!=
InvalidOid
)
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
));
NameListToString
(
stmt
->
plhandler
));
/* validate the validator function */
/* validate the validator function */
...
@@ -89,7 +89,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
...
@@ -89,7 +89,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
typev
[
0
]
=
OIDOID
;
typev
[
0
]
=
OIDOID
;
valProcOid
=
LookupFuncName
(
stmt
->
plvalidator
,
1
,
typev
);
valProcOid
=
LookupFuncName
(
stmt
->
plvalidator
,
1
,
typev
);
if
(
!
OidIsValid
(
valProcOid
))
if
(
!
OidIsValid
(
valProcOid
))
elog
(
ERROR
,
"
PL validator
function %s(oid) doesn't exist"
,
elog
(
ERROR
,
"function %s(oid) doesn't exist"
,
NameListToString
(
stmt
->
plvalidator
));
NameListToString
(
stmt
->
plvalidator
));
}
}
else
else
...
@@ -162,7 +162,7 @@ DropProceduralLanguage(DropPLangStmt *stmt)
...
@@ -162,7 +162,7 @@ DropProceduralLanguage(DropPLangStmt *stmt)
* Check permission
* Check permission
*/
*/
if
(
!
superuser
())
if
(
!
superuser
())
elog
(
ERROR
,
"Only users with
Postgres
superuser privilege are "
elog
(
ERROR
,
"Only users with superuser privilege are "
"permitted to drop procedural languages"
);
"permitted to drop procedural languages"
);
/*
/*
...
@@ -177,10 +177,6 @@ DropProceduralLanguage(DropPLangStmt *stmt)
...
@@ -177,10 +177,6 @@ DropProceduralLanguage(DropPLangStmt *stmt)
if
(
!
HeapTupleIsValid
(
langTup
))
if
(
!
HeapTupleIsValid
(
langTup
))
elog
(
ERROR
,
"Language %s doesn't exist"
,
languageName
);
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
.
classId
=
get_system_catalog_relid
(
LanguageRelationName
);
object
.
objectId
=
HeapTupleGetOid
(
langTup
);
object
.
objectId
=
HeapTupleGetOid
(
langTup
);
object
.
objectSubId
=
0
;
object
.
objectSubId
=
0
;
...
...
src/backend/commands/trigger.c
View file @
1e4c4f9e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.12
4 2002/08/05 03:29:17 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.12
5 2002/08/13 17:22:08 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -74,7 +74,6 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
...
@@ -74,7 +74,6 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
HeapTuple
tuple
;
HeapTuple
tuple
;
Oid
fargtypes
[
FUNC_MAX_ARGS
];
Oid
fargtypes
[
FUNC_MAX_ARGS
];
Oid
funcoid
;
Oid
funcoid
;
Oid
funclang
;
Oid
trigoid
;
Oid
trigoid
;
int
found
=
0
;
int
found
=
0
;
int
i
;
int
i
;
...
@@ -207,24 +206,8 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
...
@@ -207,24 +206,8 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
if
(((
Form_pg_proc
)
GETSTRUCT
(
tuple
))
->
prorettype
!=
0
)
if
(((
Form_pg_proc
)
GETSTRUCT
(
tuple
))
->
prorettype
!=
0
)
elog
(
ERROR
,
"CreateTrigger: function %s() must return OPAQUE"
,
elog
(
ERROR
,
"CreateTrigger: function %s() must return OPAQUE"
,
NameListToString
(
stmt
->
funcname
));
NameListToString
(
stmt
->
funcname
));
funclang
=
((
Form_pg_proc
)
GETSTRUCT
(
tuple
))
->
prolang
;
ReleaseSysCache
(
tuple
);
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.
* Build the new pg_trigger tuple.
*/
*/
...
...
src/backend/utils/fmgr/fmgr.c
View file @
1e4c4f9e
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.6
0 2002/06/20 20:29:39 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.6
1 2002/08/13 17:22:08 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -324,6 +324,7 @@ fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
...
@@ -324,6 +324,7 @@ fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
Oid
language
=
procedureStruct
->
prolang
;
Oid
language
=
procedureStruct
->
prolang
;
HeapTuple
languageTuple
;
HeapTuple
languageTuple
;
Form_pg_language
languageStruct
;
Form_pg_language
languageStruct
;
FmgrInfo
plfinfo
;
languageTuple
=
SearchSysCache
(
LANGOID
,
languageTuple
=
SearchSysCache
(
LANGOID
,
ObjectIdGetDatum
(
language
),
ObjectIdGetDatum
(
language
),
...
@@ -332,27 +333,19 @@ fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
...
@@ -332,27 +333,19 @@ fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
elog
(
ERROR
,
"fmgr_info: cache lookup for language %u failed"
,
elog
(
ERROR
,
"fmgr_info: cache lookup for language %u failed"
,
language
);
language
);
languageStruct
=
(
Form_pg_language
)
GETSTRUCT
(
languageTuple
);
languageStruct
=
(
Form_pg_language
)
GETSTRUCT
(
languageTuple
);
if
(
languageStruct
->
lanispl
)
{
FmgrInfo
plfinfo
;
fmgr_info
(
languageStruct
->
lanplcallfoid
,
&
plfinfo
);
fmgr_info
(
languageStruct
->
lanplcallfoid
,
&
plfinfo
);
finfo
->
fn_addr
=
plfinfo
.
fn_addr
;
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
);
ReleaseSysCache
(
languageTuple
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment