mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-12 09:27:04 +08:00
as per recent discussions. Invent SubTransactionIds that are managed like CommandIds (ie, counter is reset at start of each top transaction), and use these instead of TransactionIds to keep track of subtransaction status in those modules that need it. This means that a subtransaction does not need an XID unless it actually inserts/modifies rows in the database. Accordingly, don't assign it an XID nor take a lock on the XID until it tries to do that. This saves a lot of overhead for subtransactions that are only used for error recovery (eg plpgsql exceptions). Also, arrange to release a subtransaction's XID lock as soon as the subtransaction exits, in both the commit and abort cases. This avoids holding many unique locks after a long series of subtransactions. The price is some additional overhead in XactLockTableWait, but that seems acceptable. Finally, restructure the state machine in xact.c to have a more orthogonal set of states for subtransactions.
40 lines
1.2 KiB
C
40 lines
1.2 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* user.h
|
|
* Commands for manipulating users and groups.
|
|
*
|
|
*
|
|
* $PostgreSQL: pgsql/src/include/commands/user.h,v 1.25 2004/09/16 16:58:39 tgl Exp $
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef USER_H
|
|
#define USER_H
|
|
|
|
#include "fmgr.h"
|
|
#include "nodes/parsenodes.h"
|
|
|
|
|
|
extern char *group_getfilename(void);
|
|
extern char *user_getfilename(void);
|
|
|
|
extern void CreateUser(CreateUserStmt *stmt);
|
|
extern void AlterUser(AlterUserStmt *stmt);
|
|
extern void AlterUserSet(AlterUserSetStmt *stmt);
|
|
extern void DropUser(DropUserStmt *stmt);
|
|
extern void RenameUser(const char *oldname, const char *newname);
|
|
|
|
extern void CreateGroup(CreateGroupStmt *stmt);
|
|
extern void AlterGroup(AlterGroupStmt *stmt, const char *tag);
|
|
extern void DropGroup(DropGroupStmt *stmt);
|
|
extern void RenameGroup(const char *oldname, const char *newname);
|
|
|
|
extern Datum update_pg_pwd_and_pg_group(PG_FUNCTION_ARGS);
|
|
|
|
extern void AtEOXact_UpdatePasswordFile(bool isCommit);
|
|
extern void AtEOSubXact_UpdatePasswordFile(bool isCommit,
|
|
SubTransactionId mySubid,
|
|
SubTransactionId parentSubid);
|
|
|
|
#endif /* USER_H */
|