[HACKERS] Inserting data into a new catalog table via source code

From: rqtx <rqtx(at)protonmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: [HACKERS] Inserting data into a new catalog table via source code
Date: 2018-02-14 19:45:30
Message-ID: r-b5xGAgXUQ_ThgYYcedBUKAsbW8kf1fMmRpUuuj8ypQCuqGtgmYC3v0HkU48GfBn4CrN3Q2wt5KYkKfoJA3fNwmp-K4q9PMvFL3fnneUd4=@protonmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-02-14 20:25:21 Re: reorganizing partitioning code (was: Re: [HACKERS] path toward faster partition pruning)
Previous Message Andres Freund 2018-02-14 18:56:51 Re: Cancelling parallel query leads to segfault