Re: SYSTEM_USER reserved word implementation
Drouvot, Bertrand <bdrouvot@amazon.com>
From: "Drouvot, Bertrand" <bdrouvot@amazon.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Jacob Champion <jchampion@timescale.com>, Joe Conway <mail@joeconway.com>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-06-28T07:18:05Z
Lists: pgsql-hackers
Attachments
- v2-0003-system_user-implementation.patch (text/plain) patch v2-0003
Hi, On 6/27/22 7:32 PM, Alvaro Herrera wrote: > On 2022-Jun-25, Drouvot, Bertrand wrote: > >> diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h >> index 0af130fbc5..8d761512fd 100644 >> --- a/src/include/miscadmin.h >> +++ b/src/include/miscadmin.h >> @@ -364,6 +364,10 @@ extern void InitializeSessionUserIdStandalone(void); >> extern void SetSessionAuthorization(Oid userid, bool is_superuser); >> extern Oid GetCurrentRoleId(void); >> extern void SetCurrentRoleId(Oid roleid, bool is_superuser); >> +/* kluge to avoid including libpq/libpq-be.h here */ >> +typedef struct Port MyPort; >> +extern void InitializeSystemUser(const MyPort *port); >> +extern const char* GetSystemUser(void); > This typedef here looks quite suspicious. I think this should suffice: > > +/* kluge to avoid including libpq/libpq-be.h here */ > +struct Port; > +extern void InitializeSystemUser(struct Port *port); > > I suspect that having a typedef called MyPort is going to wreak serious > havoc for pgindent. Good catch, thanks! Attached new version to fix it as suggested. Regards, Bertrand
Commits
-
Introduce SYSTEM_USER
- 0823d061b0b7 16.0 landed
-
Add some information about authenticated identity via log_connections
- 9afffcb833d3 14.0 cited