Skip to content

Commit

Permalink
add shared_lib preload test
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Boudehen committed Oct 6, 2023
1 parent 7310200 commit c4aa592
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion pg_query_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <storage/predicate.h>
#include <utils/builtins.h>
#include <utils/guc.h>
#include <utils/queryjumble.h>
#include <lib/ilist.h>
#include <access/genam.h>
#include <utils/fmgroids.h>
Expand Down Expand Up @@ -162,6 +163,10 @@ void pgqs_shmem_request_hook(void){

};

/*
* Here we allocate somme shared memory for the hash table
* and it's entries during the shmem srtatup hook.
*/
void pgqs_shmem_startup_hook(void){
if (debug) elog(DEBUG1,"Entering shmem_startup_hook");

Expand Down Expand Up @@ -519,6 +524,19 @@ PlanTuner_ExecutorEnd(QueryDesc *q)
void
_PG_init(void)
{


if (debug) elog(DEBUG1,"Entering _PG_init()");

if (!process_shared_preload_libraries_in_progress)
return;

/*
* Inform the postmaster that we want to enable query_id calculation if
* compute_query_id is set to auto.
*/
EnableQueryId();

/* Create a GUC variable named pg_query_settings.enabled
* used to enable or disable this module. */
DefineCustomBoolVariable(
Expand Down Expand Up @@ -604,7 +622,8 @@ pg_query_settings_reload(PG_FUNCTION_ARGS)
if (debug) elog (DEBUG1,"Reload");

/* FIXME:
Here we must reload the table pgqs_config and store it into the shmem
* Here we must reload the table pgqs_config and store it into the shmem
* hastable from scratch, after a locking exclusively
*/


Expand Down

0 comments on commit c4aa592

Please sign in to comment.