mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Replace pg_shadow and pg_group by new role-capable catalogs pg_authid
and pg_auth_members. There are still many loose ends to finish in this patch (no documentation, no regression tests, no pg_dump support for instance). But I'm going to commit it now anyway so that Alvaro can make some progress on shared dependencies. The catalog changes should be pretty much done.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.6 2005/06/19 22:34:56 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.7 2005/06/28 05:08:51 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Each global transaction is associated with a global transaction
|
||||
@@ -107,7 +107,7 @@ typedef struct GlobalTransactionData
|
||||
PGPROC proc; /* dummy proc */
|
||||
TimestampTz prepared_at; /* time of preparation */
|
||||
XLogRecPtr prepare_lsn; /* XLOG offset of prepare record */
|
||||
AclId owner; /* ID of user that executed the xact */
|
||||
Oid owner; /* ID of user that executed the xact */
|
||||
TransactionId locking_xid; /* top-level XID of backend working on xact */
|
||||
bool valid; /* TRUE if fully prepared */
|
||||
char gid[GIDSIZE]; /* The GID assigned to the prepared xact */
|
||||
@@ -206,7 +206,7 @@ TwoPhaseShmemInit(void)
|
||||
*/
|
||||
GlobalTransaction
|
||||
MarkAsPreparing(TransactionId xid, const char *gid,
|
||||
TimestampTz prepared_at, AclId owner, Oid databaseid)
|
||||
TimestampTz prepared_at, Oid owner, Oid databaseid)
|
||||
{
|
||||
GlobalTransaction gxact;
|
||||
int i;
|
||||
@@ -350,7 +350,7 @@ MarkAsPrepared(GlobalTransaction gxact)
|
||||
* Locate the prepared transaction and mark it busy for COMMIT or PREPARE.
|
||||
*/
|
||||
static GlobalTransaction
|
||||
LockGXact(const char *gid, AclId user)
|
||||
LockGXact(const char *gid, Oid user)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -559,7 +559,7 @@ pg_prepared_xact(PG_FUNCTION_ARGS)
|
||||
TupleDescInitEntry(tupdesc, (AttrNumber) 3, "prepared",
|
||||
TIMESTAMPTZOID, -1, 0);
|
||||
TupleDescInitEntry(tupdesc, (AttrNumber) 4, "ownerid",
|
||||
INT4OID, -1, 0);
|
||||
OIDOID, -1, 0);
|
||||
TupleDescInitEntry(tupdesc, (AttrNumber) 5, "dbid",
|
||||
OIDOID, -1, 0);
|
||||
|
||||
@@ -601,7 +601,7 @@ pg_prepared_xact(PG_FUNCTION_ARGS)
|
||||
values[0] = TransactionIdGetDatum(gxact->proc.xid);
|
||||
values[1] = DirectFunctionCall1(textin, CStringGetDatum(gxact->gid));
|
||||
values[2] = TimestampTzGetDatum(gxact->prepared_at);
|
||||
values[3] = Int32GetDatum(gxact->owner);
|
||||
values[3] = ObjectIdGetDatum(gxact->owner);
|
||||
values[4] = ObjectIdGetDatum(gxact->proc.databaseId);
|
||||
|
||||
tuple = heap_form_tuple(funcctx->tuple_desc, values, nulls);
|
||||
@@ -690,7 +690,7 @@ typedef struct TwoPhaseFileHeader
|
||||
TransactionId xid; /* original transaction XID */
|
||||
Oid database; /* OID of database it was in */
|
||||
TimestampTz prepared_at; /* time of preparation */
|
||||
AclId owner; /* user running the transaction */
|
||||
Oid owner; /* user running the transaction */
|
||||
int32 nsubxacts; /* number of following subxact XIDs */
|
||||
int32 ncommitrels; /* number of delete-on-commit rels */
|
||||
int32 nabortrels; /* number of delete-on-abort rels */
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.207 2005/06/19 20:00:38 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.208 2005/06/28 05:08:51 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -121,7 +121,7 @@ typedef struct TransactionStateData
|
||||
* context */
|
||||
ResourceOwner curTransactionOwner; /* my query resources */
|
||||
List *childXids; /* subcommitted child XIDs */
|
||||
AclId currentUser; /* subxact start current_user */
|
||||
Oid currentUser; /* subxact start current_user */
|
||||
bool prevXactReadOnly; /* entry-time xact r/o state */
|
||||
struct TransactionStateData *parent; /* back link to parent */
|
||||
} TransactionStateData;
|
||||
@@ -1488,8 +1488,10 @@ CommitTransaction(void)
|
||||
/* NOTIFY commit must come before lower-level cleanup */
|
||||
AtCommit_Notify();
|
||||
|
||||
/* Update flat files if we changed pg_database, pg_shadow or pg_group */
|
||||
/* This should be the last step before commit */
|
||||
/*
|
||||
* Update flat files if we changed pg_database, pg_authid or
|
||||
* pg_auth_members. This should be the last step before commit.
|
||||
*/
|
||||
AtEOXact_UpdateFlatFiles(true);
|
||||
|
||||
/* Prevent cancel/die interrupt while cleaning up */
|
||||
@@ -3847,7 +3849,7 @@ PushTransaction(void)
|
||||
{
|
||||
TransactionState p = CurrentTransactionState;
|
||||
TransactionState s;
|
||||
AclId currentUser;
|
||||
Oid currentUser;
|
||||
|
||||
/*
|
||||
* At present, GetUserId cannot fail, but let's not assume that. Get
|
||||
|
||||
Reference in New Issue
Block a user