Re: Event-Triggers for DB owners instead of just SUPERUSER

2025-04-14 Thread Wolfgang Walther
Dominique Devienne: Can't event-triggers also be available to DB owners, instead of just SUPERUSER? There's a recent -hackers thread exactly about this: https://www.postgresql.org/message-id/flat/CAGRrpzbtYDkg7_xwfzrqByYgCJQbbL38tADyuN%2B6tAkbA-Pnkg%40mail.gmail.com Best, Wolfgang

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-14 Thread Wolfgang Walther
Tom Lane: If you err in the other direction, you don't get slapped on the wrist that way. We're willing to inline VOLATILE functions, for instance, whether or not the contained expression is volatile. Similarly for STRICT, and I think parallel safety as well. So my own habit when writing a SQL f

Re: Backward compat issue with v16 around ROLEs

2024-09-11 Thread Wolfgang Walther
Dominique Devienne: Hi David. I did as you suggested, and it fails the same way. Did I misunderstand you? --DD [..] ddevienne=> grant dd_owner to dd_admin with admin option; -- I think this needs to be the other way around: grant dd_admin to dd_owner with admin option; Best, Wol

Re: DROP OWNED BY fails with #53200: ERROR: out of shared memory

2022-01-11 Thread Wolfgang Walther
Dominique Devienne: I wish for DB-specific ROLEs BTW... Same here. That would be so useful.

Re: ALTER ROLE ... SET in current database only

2021-02-16 Thread Wolfgang Walther
Abdul Qoyyuum: Wouldnt you need to connect to the database first before you can ALTER ROLE anything? Of course, otherwise the notion of "current database" wouldn't make sense at all. But that's only before executing the code. I am not writing and executing this code at the same time. In my

ALTER ROLE ... SET in current database only

2021-02-15 Thread Wolfgang Walther
Hi, I'm trying to set a GUC for a role in the current database only - but don't know the name of the database at the time of writing code. Could be development, staging, ... I would basically like to do something like this: ALTER ROLE a IN CURRENT DATABASE SET b TO c; Although that syntax d

Re: Execution order of CTEs / set_config and current_setting in the same query

2020-12-09 Thread Wolfgang Walther
Tom Lane: I think you're on fairly shaky ground here. Generally speaking, a CTE will be executed/read only when the parent query needs the next row from it. Your examples ensure that the CTE is read before the parent query's results are computed; but in realistic usage you'd presumably be joini

Execution order of CTEs / set_config and current_setting in the same query

2020-12-09 Thread Wolfgang Walther
Hi, with PostgREST [1] we are translating HTTP requests into SQL queries. For each request we are setting some metadata (headers, ...) as GUCs. We used to do it like this: SET LOCAL request.headers.x = 'y'; ... Since this is user-provided data, we want to use parametrized/prepared statements