Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1baf1f

Browse files
committed
Add get_func_rettype() to general-use lsyscache routines,
since it's now needed in both optimizer and parser.
1 parentbab13a7 commitb1baf1f

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

‎src/backend/utils/cache/lsyscache.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 1994, Regents of the University of California
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.32 1999/08/09 03:13:30 tgl Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.33 1999/08/16 02:06:25 tgl Exp $
1010
*
1111
* NOTES
1212
* Eventually, the index information should go through here, too.
@@ -15,6 +15,7 @@
1515
#include"postgres.h"
1616

1717
#include"catalog/pg_operator.h"
18+
#include"catalog/pg_proc.h"
1819
#include"catalog/pg_type.h"
1920
#include"utils/lsyscache.h"
2021
#include"utils/syscache.h"
@@ -453,6 +454,31 @@ get_oprjoin(Oid opno)
453454
return (RegProcedure)NULL;
454455
}
455456

457+
/*---------- FUNCTION CACHE ---------- */
458+
459+
/*
460+
* get_func_rettype
461+
*Given procedure id, return the function's result type.
462+
*/
463+
Oid
464+
get_func_rettype(Oidfuncid)
465+
{
466+
HeapTuplefunc_tuple;
467+
Oidfuncrettype;
468+
469+
func_tuple=SearchSysCacheTuple(PROOID,
470+
ObjectIdGetDatum(funcid),
471+
0,0,0);
472+
473+
if (!HeapTupleIsValid(func_tuple))
474+
elog(ERROR,"Function OID %u does not exist",funcid);
475+
476+
funcrettype= (Oid)
477+
((Form_pg_proc)GETSTRUCT(func_tuple))->prorettype;
478+
479+
returnfuncrettype;
480+
}
481+
456482
/*---------- RELATION CACHE ---------- */
457483

458484
/*

‎src/include/utils/lsyscache.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: lsyscache.h,v 1.19 1999/08/09 03:13:28 tgl Exp $
8+
* $Id: lsyscache.h,v 1.20 1999/08/16 02:06:23 tgl Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -32,6 +32,7 @@ extern HeapTuple get_operator_tuple(Oid opno);
3232
externOidget_negator(Oidopid);
3333
externRegProcedureget_oprrest(Oidopid);
3434
externRegProcedureget_oprjoin(Oidopid);
35+
externOidget_func_rettype(Oidfuncid);
3536
externintget_relnatts(Oidrelid);
3637
externchar*get_rel_name(Oidrelid);
3738
externstructvarlena*get_relstub(Oidrelid,intno,bool*islast);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp