mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-01 19:45:33 +08:00
Use "Oid" type where applicable and %ud instead of %d. Thanks Darren King.
This commit is contained in:
parent
9b41da6ce4
commit
7439ba64b1
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.5 1996/11/10 02:59:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.6 1996/12/11 03:17:17 bryanh Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -68,7 +68,7 @@ DefineVirtualRelation(char *relname, List *tlist)
|
||||
entry = lfirst(t);
|
||||
res = entry->resdom;
|
||||
resname = res->resname;
|
||||
restypename = tname(get_id_type((long)res->restype));
|
||||
restypename = tname(get_id_type(res->restype));
|
||||
|
||||
typename = makeNode(TypeName);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.3 1996/11/10 03:00:44 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.4 1996/12/11 03:17:42 bryanh Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||
@ -247,13 +247,13 @@ _outMergeJoin(StringInfo str, MergeJoin *node)
|
||||
appendStringInfo(str,buf);
|
||||
_outNode(str, node->mergeclauses);
|
||||
|
||||
sprintf(buf, " :mergesortop %d", node->mergesortop);
|
||||
sprintf(buf, " :mergesortop %ud", node->mergesortop);
|
||||
appendStringInfo(str,buf);
|
||||
|
||||
sprintf(buf, " :mergerightorder %d", node->mergerightorder[0]);
|
||||
sprintf(buf, " :mergerightorder %ud", node->mergerightorder[0]);
|
||||
appendStringInfo(str, buf);
|
||||
|
||||
sprintf(buf, " :mergeleftorder %d", node->mergeleftorder[0]);
|
||||
sprintf(buf, " :mergeleftorder %ud", node->mergeleftorder[0]);
|
||||
appendStringInfo(str, buf);
|
||||
}
|
||||
|
||||
@ -273,7 +273,7 @@ _outHashJoin(StringInfo str, HashJoin *node)
|
||||
appendStringInfo(str,buf);
|
||||
_outNode(str, node->hashclauses);
|
||||
|
||||
sprintf(buf, " :hashjoinop %d",node->hashjoinop);
|
||||
sprintf(buf, " :hashjoinop %ud",node->hashjoinop);
|
||||
appendStringInfo(str,buf);
|
||||
sprintf(buf, " :hashjointable 0x%x", (int) node->hashjointable);
|
||||
appendStringInfo(str,buf);
|
||||
@ -357,7 +357,7 @@ _outTemp(StringInfo str, Temp *node)
|
||||
appendStringInfo(str,buf);
|
||||
_outPlanInfo(str, (Plan*) node);
|
||||
|
||||
sprintf(buf, " :tempid %d", node->tempid);
|
||||
sprintf(buf, " :tempid %ud", node->tempid);
|
||||
appendStringInfo(str,buf);
|
||||
sprintf(buf, " :keycount %d", node->keycount);
|
||||
appendStringInfo(str,buf);
|
||||
@ -376,7 +376,7 @@ _outSort(StringInfo str, Sort *node)
|
||||
appendStringInfo(str,buf);
|
||||
_outPlanInfo(str, (Plan*) node);
|
||||
|
||||
sprintf(buf, " :tempid %d", node->tempid);
|
||||
sprintf(buf, " :tempid %ud", node->tempid);
|
||||
appendStringInfo(str,buf);
|
||||
sprintf(buf, " :keycount %d", node->keycount);
|
||||
appendStringInfo(str,buf);
|
||||
@ -425,7 +425,7 @@ _outUnique(StringInfo str, Unique *node)
|
||||
appendStringInfo(str,buf);
|
||||
_outPlanInfo(str, (Plan*) node);
|
||||
|
||||
sprintf(buf, " :tempid %d", node->tempid);
|
||||
sprintf(buf, " :tempid %ud", node->tempid);
|
||||
appendStringInfo(str,buf);
|
||||
sprintf(buf, " :keycount %d", node->keycount);
|
||||
appendStringInfo(str,buf);
|
||||
@ -497,7 +497,7 @@ _outResdom(StringInfo str, Resdom *node)
|
||||
appendStringInfo(str,buf);
|
||||
sprintf(buf, " :resno %hd", node->resno);
|
||||
appendStringInfo(str,buf);
|
||||
sprintf(buf, " :restype %d", node->restype);
|
||||
sprintf(buf, " :restype %ud", node->restype);
|
||||
appendStringInfo(str,buf);
|
||||
sprintf(buf, " :reslen %d", node->reslen);
|
||||
appendStringInfo(str,buf);
|
||||
@ -506,7 +506,7 @@ _outResdom(StringInfo str, Resdom *node)
|
||||
appendStringInfo(str,buf);
|
||||
sprintf(buf, " :reskey %d", node->reskey);
|
||||
appendStringInfo(str,buf);
|
||||
sprintf(buf, " :reskeyop %ld", (long int) node->reskeyop);
|
||||
sprintf(buf, " :reskeyop %ud", node->reskeyop);
|
||||
appendStringInfo(str,buf);
|
||||
sprintf(buf, " :resjunk %d", node->resjunk);
|
||||
appendStringInfo(str,buf);
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.12 1996/11/30 18:06:31 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.13 1996/12/11 03:17:49 bryanh Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -120,7 +120,7 @@ static void make_lowercase(char *string);
|
||||
* what's going on - jolly
|
||||
*/
|
||||
bool
|
||||
check_typeid(long id)
|
||||
check_typeid(Oid id)
|
||||
{
|
||||
return (SearchSysCacheTuple(TYPOID,
|
||||
ObjectIdGetDatum(id),
|
||||
@ -130,13 +130,13 @@ check_typeid(long id)
|
||||
|
||||
/* return a Type structure, given an typid */
|
||||
Type
|
||||
get_id_type(long id)
|
||||
get_id_type(Oid id)
|
||||
{
|
||||
HeapTuple tup;
|
||||
|
||||
if (!(tup = SearchSysCacheTuple(TYPOID, ObjectIdGetDatum(id),
|
||||
0,0,0))) {
|
||||
elog ( WARN, "type id lookup of %d failed", id);
|
||||
elog ( WARN, "type id lookup of %ud failed", id);
|
||||
return(NULL);
|
||||
}
|
||||
return((Type) tup);
|
||||
@ -144,14 +144,14 @@ get_id_type(long id)
|
||||
|
||||
/* return a type name, given a typeid */
|
||||
char*
|
||||
get_id_typname(long id)
|
||||
get_id_typname(Oid id)
|
||||
{
|
||||
HeapTuple tup;
|
||||
TypeTupleForm typetuple;
|
||||
|
||||
if (!(tup = SearchSysCacheTuple(TYPOID, ObjectIdGetDatum(id),
|
||||
0,0,0))) {
|
||||
elog ( WARN, "type id lookup of %d failed", id);
|
||||
elog ( WARN, "type id lookup of %ud failed", id);
|
||||
return(NULL);
|
||||
}
|
||||
typetuple = (TypeTupleForm)GETSTRUCT(tup);
|
||||
@ -1165,8 +1165,8 @@ func_get_detail(char *funcname,
|
||||
} else {
|
||||
pform = (Form_pg_proc) GETSTRUCT(ftup);
|
||||
*funcid = ftup->t_oid;
|
||||
*rettype = (Oid) pform->prorettype;
|
||||
*retset = (Oid) pform->proretset;
|
||||
*rettype = pform->prorettype;
|
||||
*retset = pform->proretset;
|
||||
|
||||
return (true);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: catalog_utils.h,v 1.5 1996/11/30 18:06:58 momjian Exp $
|
||||
* $Id: catalog_utils.h,v 1.6 1996/12/11 03:18:12 bryanh Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -19,9 +19,9 @@
|
||||
typedef HeapTuple Type;
|
||||
typedef HeapTuple Operator;
|
||||
|
||||
extern bool check_typeid(long id);
|
||||
extern Type get_id_type(long id);
|
||||
extern char *get_id_typname(long id);
|
||||
extern bool check_typeid(Oid id);
|
||||
extern Type get_id_type(Oid id);
|
||||
extern char *get_id_typname(Oid id);
|
||||
extern Type type(char *);
|
||||
extern Oid att_typeid(Relation rd, int attid);
|
||||
extern int att_attnelems(Relation rd, int attid);
|
||||
|
Loading…
Reference in New Issue
Block a user