Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9555cc8

Browse files
committed
Revert hooks for session start and end, take two
The location of the session end hook has been chosen so as it is possible to allow modules to do their own transactions, however any trying to any any subsystem which went through before_shmem_exit() would cause issues, limiting the pluggability of the hook. Per discussion with Tom Lane and Andres Freund. Discussion: https://postgr.es/m/18722.1569906636@sss.pgh.pa.us
1 parent 540f316 commit 9555cc8

File tree

11 files changed

+0
-271
lines changed

11 files changed

+0
-271
lines changed

src/backend/tcop/postgres.c

-6
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ static ProcSignalReason RecoveryConflictReason;
171171
static MemoryContext row_description_context = NULL;
172172
static StringInfoData row_description_buf;
173173

174-
/* Hook for plugins to get control at start of session */
175-
session_start_hook_type session_start_hook = NULL;
176-
177174
/* ----------------------------------------------------------------
178175
* decls for routines only used in this file
179176
* ----------------------------------------------------------------
@@ -3971,9 +3968,6 @@ PostgresMain(int argc, char *argv[],
39713968
if (!IsUnderPostmaster)
39723969
PgStartTime = GetCurrentTimestamp();
39733970

3974-
if (session_start_hook)
3975-
(*session_start_hook) ();
3976-
39773971
/*
39783972
* POSTGRES main processing loop begins here
39793973
*

src/backend/utils/init/postinit.c

-6
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ static bool ThereIsAtLeastOneRole(void);
7878
static void process_startup_options(Port *port, bool am_superuser);
7979
static void process_settings(Oid databaseid, Oid roleid);
8080

81-
/* Hook for plugins to get control at end of session */
82-
session_end_hook_type session_end_hook = NULL;
8381

8482
/*** InitPostgres support ***/
8583

@@ -1197,10 +1195,6 @@ ShutdownPostgres(int code, Datum arg)
11971195
* them explicitly.
11981196
*/
11991197
LockReleaseAll(USER_LOCKMETHOD, true);
1200-
1201-
/* Hook at session end */
1202-
if (session_end_hook)
1203-
(*session_end_hook) ();
12041198
}
12051199

12061200

src/include/tcop/tcopprot.h

-7
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ extern PGDLLIMPORT const char *debug_query_string;
3030
extern int max_stack_depth;
3131
extern int PostAuthDelay;
3232

33-
/* Hook for plugins to get control at start and end of session */
34-
typedef void (*session_start_hook_type) (void);
35-
typedef void (*session_end_hook_type) (void);
36-
37-
extern PGDLLIMPORT session_start_hook_type session_start_hook;
38-
extern PGDLLIMPORT session_end_hook_type session_end_hook;
39-
4033
/* GUC-configurable parameters */
4134

4235
typedef enum

src/test/modules/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ SUBDIRS = \
2121
test_predtest \
2222
test_rbtree \
2323
test_rls_hooks \
24-
test_session_hooks \
2524
test_shm_mq \
2625
unsafe_tests \
2726
worker_spi

src/test/modules/test_session_hooks/.gitignore

-4
This file was deleted.

src/test/modules/test_session_hooks/Makefile

-23
This file was deleted.

src/test/modules/test_session_hooks/README

-11
This file was deleted.

src/test/modules/test_session_hooks/expected/test_session_hooks.out

-37
This file was deleted.

src/test/modules/test_session_hooks/session_hooks.conf

-2
This file was deleted.

src/test/modules/test_session_hooks/sql/test_session_hooks.sql

-19
This file was deleted.

src/test/modules/test_session_hooks/test_session_hooks.c

-155
This file was deleted.

0 commit comments

Comments
 (0)