[HACKERS] Inserting data into a new catalog table via source code - Mailing list pgsql-hackers

From rqtx
Subject [HACKERS] Inserting data into a new catalog table via source code
Date
Msg-id r-b5xGAgXUQ_ThgYYcedBUKAsbW8kf1fMmRpUuuj8ypQCuqGtgmYC3v0HkU48GfBn4CrN3Q2wt5KYkKfoJA3fNwmp-K4q9PMvFL3fnneUd4=@protonmail.com
Whole thread Raw
List pgsql-hackers

The company I'm working is currently trying to give some external users access to our database. Said users are partners of ours (company partners).

I was tasked to create a new catalog table to log every user activity (already done) and now I'm trying to insert some information in this table using the CatalogTupleInsert function. The data in question is the query the user issues to psql and the payload of the answer.

My thought process was that I would be able to alter the source code so I would insert this kind of data for every user, him being superuser or not...

Instead, I noticed the data is only  inserted in the table if the forked process (the transaction) is from a user which has the superuser flag...

Is there a way to make this function work with any user?


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Cancelling parallel query leads to segfault
Next
From: Alvaro Herrera
Date:
Subject: Re: reorganizing partitioning code (was: Re: [HACKERS] path towardfaster partition pruning)