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

Commit93902e9

Browse files
committed
Make usesysid consistently int4, not oid.
Catalog patch from Alvaro Herrera for same.catversion updated. initdb required.
1 parent91f508a commit93902e9

File tree

11 files changed

+45
-42
lines changed

11 files changed

+45
-42
lines changed

‎src/backend/catalog/aclchk.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.78 2002/09/24 23:14:25 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.79 2002/12/04 05:18:31 momjian Exp $
1212
*
1313
* NOTES
1414
* See acl.h.
@@ -893,7 +893,7 @@ aclcheck_error(AclResult errcode, const char *objectname)
893893
* Exported routine for checking a user's access privileges to a table
894894
*/
895895
AclResult
896-
pg_class_aclcheck(Oidtable_oid,Oiduserid,AclModemode)
896+
pg_class_aclcheck(Oidtable_oid,AclIduserid,AclModemode)
897897
{
898898
AclResultresult;
899899
boolusesuper,
@@ -991,7 +991,7 @@ pg_class_aclcheck(Oid table_oid, Oid userid, AclMode mode)
991991
* Exported routine for checking a user's access privileges to a database
992992
*/
993993
AclResult
994-
pg_database_aclcheck(Oiddb_oid,Oiduserid,AclModemode)
994+
pg_database_aclcheck(Oiddb_oid,AclIduserid,AclModemode)
995995
{
996996
AclResultresult;
997997
Relationpg_database;
@@ -1054,7 +1054,7 @@ pg_database_aclcheck(Oid db_oid, Oid userid, AclMode mode)
10541054
* Exported routine for checking a user's access privileges to a function
10551055
*/
10561056
AclResult
1057-
pg_proc_aclcheck(Oidproc_oid,Oiduserid,AclModemode)
1057+
pg_proc_aclcheck(Oidproc_oid,AclIduserid,AclModemode)
10581058
{
10591059
AclResultresult;
10601060
HeapTupletuple;
@@ -1107,7 +1107,7 @@ pg_proc_aclcheck(Oid proc_oid, Oid userid, AclMode mode)
11071107
* Exported routine for checking a user's access privileges to a language
11081108
*/
11091109
AclResult
1110-
pg_language_aclcheck(Oidlang_oid,Oiduserid,AclModemode)
1110+
pg_language_aclcheck(Oidlang_oid,AclIduserid,AclModemode)
11111111
{
11121112
AclResultresult;
11131113
HeapTupletuple;
@@ -1157,7 +1157,7 @@ pg_language_aclcheck(Oid lang_oid, Oid userid, AclMode mode)
11571157
* Exported routine for checking a user's access privileges to a namespace
11581158
*/
11591159
AclResult
1160-
pg_namespace_aclcheck(Oidnsp_oid,Oiduserid,AclModemode)
1160+
pg_namespace_aclcheck(Oidnsp_oid,AclIduserid,AclModemode)
11611161
{
11621162
AclResultresult;
11631163
HeapTupletuple;
@@ -1218,7 +1218,7 @@ pg_namespace_aclcheck(Oid nsp_oid, Oid userid, AclMode mode)
12181218
* Ownership check for a relation (specified by OID).
12191219
*/
12201220
bool
1221-
pg_class_ownercheck(Oidclass_oid,Oiduserid)
1221+
pg_class_ownercheck(Oidclass_oid,AclIduserid)
12221222
{
12231223
HeapTupletuple;
12241224
AclIdowner_id;
@@ -1244,7 +1244,7 @@ pg_class_ownercheck(Oid class_oid, Oid userid)
12441244
* Ownership check for a type (specified by OID).
12451245
*/
12461246
bool
1247-
pg_type_ownercheck(Oidtype_oid,Oiduserid)
1247+
pg_type_ownercheck(Oidtype_oid,AclIduserid)
12481248
{
12491249
HeapTupletuple;
12501250
AclIdowner_id;
@@ -1270,7 +1270,7 @@ pg_type_ownercheck(Oid type_oid, Oid userid)
12701270
* Ownership check for an operator (specified by OID).
12711271
*/
12721272
bool
1273-
pg_oper_ownercheck(Oidoper_oid,Oiduserid)
1273+
pg_oper_ownercheck(Oidoper_oid,AclIduserid)
12741274
{
12751275
HeapTupletuple;
12761276
AclIdowner_id;
@@ -1296,7 +1296,7 @@ pg_oper_ownercheck(Oid oper_oid, Oid userid)
12961296
* Ownership check for a function (specified by OID).
12971297
*/
12981298
bool
1299-
pg_proc_ownercheck(Oidproc_oid,Oiduserid)
1299+
pg_proc_ownercheck(Oidproc_oid,AclIduserid)
13001300
{
13011301
HeapTupletuple;
13021302
AclIdowner_id;
@@ -1322,7 +1322,7 @@ pg_proc_ownercheck(Oid proc_oid, Oid userid)
13221322
* Ownership check for a namespace (specified by OID).
13231323
*/
13241324
bool
1325-
pg_namespace_ownercheck(Oidnsp_oid,Oiduserid)
1325+
pg_namespace_ownercheck(Oidnsp_oid,AclIduserid)
13261326
{
13271327
HeapTupletuple;
13281328
AclIdowner_id;
@@ -1349,7 +1349,7 @@ pg_namespace_ownercheck(Oid nsp_oid, Oid userid)
13491349
* Ownership check for an operator class (specified by OID).
13501350
*/
13511351
bool
1352-
pg_opclass_ownercheck(Oidopc_oid,Oiduserid)
1352+
pg_opclass_ownercheck(Oidopc_oid,AclIduserid)
13531353
{
13541354
HeapTupletuple;
13551355
AclIdowner_id;

‎src/backend/catalog/namespace.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
1515
* IDENTIFICATION
16-
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.40 2002/11/11 22:19:21 tgl Exp $
16+
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.41 2002/12/04 05:18:31 momjian Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -1365,7 +1365,7 @@ FindDefaultConversionProc(int4 for_encoding, int4 to_encoding)
13651365
staticvoid
13661366
recomputeNamespacePath(void)
13671367
{
1368-
OiduserId=GetUserId();
1368+
AclIduserId=GetUserId();
13691369
char*rawname;
13701370
List*namelist;
13711371
List*oidlist;

‎src/backend/catalog/pg_conversion.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_conversion.c,v 1.8 2002/11/0218:41:21 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_conversion.c,v 1.9 2002/12/04 05:18:32 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -37,7 +37,7 @@
3737
*/
3838
Oid
3939
ConversionCreate(constchar*conname,Oidconnamespace,
40-
int32conowner,
40+
AclIdconowner,
4141
int32conforencoding,int32contoencoding,
4242
Oidconproc,booldef)
4343
{

‎src/backend/commands/cluster.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.97 2002/11/2318:26:45 tgl Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.98 2002/12/04 05:18:33 momjian Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -804,11 +804,11 @@ check_cluster_ownership(Oid relOid)
804804

805805
/* Get a list of tables that the current user owns and
806806
* have indisclustered set. Return the list in a List * of rvsToCluster
807-
* with the tableOid and the indexOid on which the table is already
807+
* with the tableOid and the indexOid on which the table is already
808808
* clustered.
809809
*/
810810
List*
811-
get_tables_to_cluster(Oidowner)
811+
get_tables_to_cluster(AclIdowner)
812812
{
813813
RelationindRelation;
814814
HeapScanDescscan;

‎src/backend/utils/adt/pgstatfuncs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ pg_stat_get_backend_userid(PG_FUNCTION_ARGS)
272272
if ((beentry=pgstat_fetch_stat_beentry(beid))==NULL)
273273
PG_RETURN_NULL();
274274

275-
PG_RETURN_OID(beentry->userid);
275+
PG_RETURN_INT32(beentry->userid);
276276
}
277277

278278

‎src/include/catalog/catversion.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $Id: catversion.h,v 1.166 2002/11/2518:12:11 tgl Exp $
40+
* $Id: catversion.h,v 1.167 2002/12/04 05:18:35 momjian Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200211251
56+
#defineCATALOG_VERSION_NO200212031
5757

5858
#endif

‎src/include/catalog/pg_conversion.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_conversion.h,v 1.7 2002/11/02 02:33:03 tgl Exp $
11+
* $Id: pg_conversion.h,v 1.8 2002/12/04 05:18:35 momjian Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -19,6 +19,8 @@
1919
#ifndefPG_CONVERSION_H
2020
#definePG_CONVERSION_H
2121

22+
#include"miscadmin.h"
23+
2224
/* ----------------
2325
*postgres.h contains the system type definitions and the
2426
*CATALOG(), BOOTSTRAP and DATA() sugar words so this file
@@ -84,7 +86,7 @@ typedef FormData_pg_conversion *Form_pg_conversion;
8486
#include"nodes/parsenodes.h"
8587

8688
externOidConversionCreate(constchar*conname,Oidconnamespace,
87-
int32conowner,
89+
AclIdconowner,
8890
int32conforencoding,int32contoencoding,
8991
Oidconproc,booldef);
9092
externvoidConversionDrop(OidconversionOid,DropBehaviorbehavior);

‎src/include/catalog/pg_proc.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_proc.h,v 1.276 2002/11/08 17:27:03 momjian Exp $
10+
* $Id: pg_proc.h,v 1.277 2002/12/04 05:18:36 momjian Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2738,7 +2738,7 @@ DATA(insert OID = 1937 ( pg_stat_get_backend_pidPGNSP PGUID 12 f f t f s 1 23
27382738
DESCR("Statistics: PID of backend");
27392739
DATA(insertOID=1938 (pg_stat_get_backend_dbidPGNSPPGUID12fftfs126"23"pg_stat_get_backend_dbid-_null_ ));
27402740
DESCR("Statistics: Database ID of backend");
2741-
DATA(insertOID=1939 (pg_stat_get_backend_useridPGNSPPGUID12fftfs126"23"pg_stat_get_backend_userid-_null_ ));
2741+
DATA(insertOID=1939 (pg_stat_get_backend_useridPGNSPPGUID12fftfs123"23"pg_stat_get_backend_userid-_null_ ));
27422742
DESCR("Statistics: User ID of backend");
27432743
DATA(insertOID=1940 (pg_stat_get_backend_activityPGNSPPGUID12fftfs125"23"pg_stat_get_backend_activity-_null_ ));
27442744
DESCR("Statistics: Current query of backend");

‎src/include/miscadmin.h‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: miscadmin.h,v 1.111 2002/10/03 17:07:53 momjian Exp $
15+
* $Id: miscadmin.h,v 1.112 2002/12/04 05:18:34 momjian Exp $
1616
*
1717
* NOTES
1818
* some of the information in this file should be moved to
@@ -202,7 +202,13 @@ extern void SetDatabasePath(const char *path);
202202

203203
externchar*GetUserNameFromId(Oiduserid);
204204

205-
externOidGetUserId(void);
205+
/*
206+
* AclIdsystem identifier for the user, group, etc.
207+
*XXX Perhaps replace this type by OID?
208+
*/
209+
typedefuint32AclId;
210+
211+
externAclIdGetUserId(void);
206212
externvoidSetUserId(Oiduserid);
207213
externOidGetSessionUserId(void);
208214
externvoidSetSessionUserId(Oiduserid);

‎src/include/utils/acl.h‎

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: acl.h,v 1.47 2002/09/0420:31:45 momjian Exp $
10+
* $Id: acl.h,v 1.48 2002/12/0405:18:38 momjian Exp $
1111
*
1212
* NOTES
1313
* For backward-compatibility purposes we have to allow there
@@ -22,16 +22,11 @@
2222
#ifndefACL_H
2323
#defineACL_H
2424

25+
#include"miscadmin.h"
2526
#include"nodes/parsenodes.h"
2627
#include"utils/array.h"
2728

2829

29-
/*
30-
* AclIdsystem identifier for the user, group, etc.
31-
*XXX Perhaps replace this type by OID?
32-
*/
33-
typedefuint32AclId;
34-
3530
#defineACL_ID_WORLD0/* placeholder for id in a WORLD acl item */
3631

3732
/*
@@ -204,11 +199,11 @@ extern AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid userid, AclMode mode);
204199
externvoidaclcheck_error(AclResulterrcode,constchar*objectname);
205200

206201
/* ownercheck routines just return true (owner) or false (not) */
207-
externboolpg_class_ownercheck(Oidclass_oid,Oiduserid);
208-
externboolpg_type_ownercheck(Oidtype_oid,Oiduserid);
209-
externboolpg_oper_ownercheck(Oidoper_oid,Oiduserid);
210-
externboolpg_proc_ownercheck(Oidproc_oid,Oiduserid);
211-
externboolpg_namespace_ownercheck(Oidnsp_oid,Oiduserid);
212-
externboolpg_opclass_ownercheck(Oidopc_oid,Oiduserid);
202+
externboolpg_class_ownercheck(Oidclass_oid,AclIduserid);
203+
externboolpg_type_ownercheck(Oidtype_oid,AclIduserid);
204+
externboolpg_oper_ownercheck(Oidoper_oid,AclIduserid);
205+
externboolpg_proc_ownercheck(Oidproc_oid,AclIduserid);
206+
externboolpg_namespace_ownercheck(Oidnsp_oid,AclIduserid);
207+
externboolpg_opclass_ownercheck(Oidopc_oid,AclIduserid);
213208

214209
#endif/* ACL_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp