Re: Allow database owners to CREATE EVENT TRIGGER

2025-04-28 Thread Steve Chavez
th inherit false will make the role members targets of the evtrigger? Are there any other options? On Tue, 22 Apr 2025 at 20:18, David G. Johnston wrote: > On Tuesday, April 22, 2025, David G. Johnston > wrote: > >> On Tuesday, April 22, 2025, David G. Johnston >> wrote: >&

Re: Allow database owners to CREATE EVENT TRIGGER

2025-04-22 Thread Steve Chavez
ranted ownership, and both create tables, to demonstrate that a non-superuser and non-owner is unaffected by the trigger. I've updated the tests accordingly. Please let me know if that's what you had in mind. Best regards, Steve Chavez On Sun, 20 Apr 2025 at 23:13, David G. Johnst

Re: Allow database owners to CREATE EVENT TRIGGER

2025-04-20 Thread Steve Chavez
025 at 22:55, Steve Chavez wrote: > Sorry, attached the output file. > > From 2d0ee67eb7c2d005ca5011c2a9ae01933dc5dba4 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Sun, 20 Apr 2025 19:46:00 -0500 Subject: [PATCH] Allow regular users to create event triggers --- src/b

Re: Allow database owners to CREATE EVENT TRIGGER

2025-04-20 Thread Steve Chavez
Sorry, attached the output file. From 2165513e858a5a6c7a620b1499b2f634c4f2ab44 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Sun, 20 Apr 2025 19:46:00 -0500 Subject: [PATCH] Allow regular users to create event triggers --- src/backend/commands/event_trigger.c | 33 +++-- src

Re: Allow database owners to CREATE EVENT TRIGGER

2025-04-20 Thread Steve Chavez
ified. - A new file event_trigger_nosuper.sql is added for the new tests. Any feedback is welcomed. I'll also gladly modify the docs if the patch looks good. Best regards, Steve Chavez On Sat, 8 Mar 2025 at 00:03, Steve Chavez wrote: > Hi Tom, > > > Well, no. That still allows

Re: [PATCH] clarify palloc comment on quote_literal_cstr

2025-04-07 Thread Steve Chavez
I haven't found a similar style of comment on any other function call. I've attached a new patch using the style you suggest. That being said, I do find the first form much more readable, but I understand this is a debatable subject. Best regards, Steve Chavez On Mon, 7 Apr 202

[PATCH] clarify palloc comment on quote_literal_cstr

2025-04-06 Thread Steve Chavez
rds, Steve From 1eb0a72ea819ee9217d84abb8112e72bf0df61d8 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Sun, 6 Apr 2025 12:33:55 -0500 Subject: [PATCH] clarify palloc comment on quote_literal_cstr --- src/backend/utils/adt/quote.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/ad

Re: Allow database owners to CREATE EVENT TRIGGER

2025-03-07 Thread Steve Chavez
requiring superuser and not bother to adopt this new feature. >From a PoLP perspective it would be a desirable side-effect of this feature to stop requiring superuser for certain extensions too. Best regards, Steve Chavez On Fri, 7 Mar 2025 at 15:19, Tom Lane wrote: > Steve Chavez writ

Re: Allow database owners to CREATE EVENT TRIGGER

2025-03-07 Thread Steve Chavez
explicit list of roles. How about requiring explicit non-superuser execution for the database owner evtrig? It would be like: CREATE EVENT TRIGGER name ... FOR NOSUPERUSER; I welcome any alternative ideas. Best regards, Steve Chavez On Wed, 5 Mar 2025 at 08:54, David G. Johnston wrote: > On

Allow database owners to CREATE EVENT TRIGGER

2025-03-05 Thread Steve Chavez
se. (Previous thread that also discussed allowing event triggers for non-superusers: https://www.postgresql.org/message-id/flat/81C10FFB-5ADC-4956-9337-FA248A4CC20D%40enterprisedb.com#77738d12b82c9a403ea2c56ed09949a3 ) Best regards, Steve Chavez From 84965d3ad70c4794f93473b939f5437c0d154826 Mon Se

Re: psql: add \create_function command

2024-03-10 Thread Steve Chavez
ards, Steve Chavez On Mon, 29 Jan 2024 at 12:29, Pavel Stehule wrote: > > > po 29. 1. 2024 v 18:11 odesílatel Tom Lane napsal: > >> Steve Chavez writes: >> > However, :{?variable_name} is already taken by psql to test whether a >> > variable is defined or not.

psql: fix variable existence tab completion

2024-03-02 Thread Steve Chavez
Hello hackers, psql has the :{?name} syntax for testing a psql variable existence. But currently doing \echo :{?VERB doesn't trigger tab completion. This patch fixes it. I've also included a TAP test. Best regards, Steve Chavez From adb1f997b67d8ef603017ab34e1b9061e4e229ea Mon Sep 1

Re: psql: add \create_function command

2024-01-29 Thread Steve Chavez
ear that you're using a file path, e.g. :{filename} vs :./filename. Examples: select jsonb_to_recordset(:./contents.json); create function foo() returns text AS :/absolute/path/contents.py language plpython3u; Any thoughts? Best regards, Steve Chavez On Mon, 29 Jan 2024 at 08:42, Andrew D

psql: add \create_function command

2024-01-26 Thread Steve Chavez
GUAGE plpython3u Its design is similar to the `\copy` command, which is a frontend version of the COPY statement. This patch is at an initial stage but includes tests with plpython3u, pltcl, plperl and tab completion. Any feedback is welcomed. Best regards, Steve Chavez

Re: Add pg_basetype() function to obtain a DOMAIN base type

2023-09-19 Thread Steve Chavez
aring any feedback. Or if this would be a bad idea. Best regards, Steve Chavez On Sat, 9 Sept 2023 at 01:17, Steve Chavez wrote: > Hello hackers, > > Currently obtaining the base type of a domain involves a somewhat long > recursive query. Consider: > > ``` > create domai

Add pg_basetype() function to obtain a DOMAIN base type

2023-09-08 Thread Steve Chavez
that exposes a `pg_basetype` SQL function that uses `getBaseType`, so the long query above just becomes: ``` select pg_basetype('mytext_child_2'::regtype); pg_basetype - text (1 row) ``` Tests and docs are added. Best regards, Steve Chavez From 9be553c2a3896c12d959bc722a808

Fwd: Castable Domains for different JSON representations

2023-06-26 Thread Steve Chavez
> The bigger picture here, though, is what are you really buying compared to just invoking the special conversion function explicitly? > If you have to write "sometsrangecolumn::mytsrange::json", that's not shorter and certainly not clearer than writing a function call. The main benefit is to be a

Castable Domains for different JSON representations

2023-06-25 Thread Steve Chavez
Hello hackers, Currently domain casts are ignored. Yet this would be very useful for representing data in different formats such as json. Let's take a tsrange as an example. Its json output by default: select to_json('(2022-12-31 11:00, 2023-01-01 06:00)'::tsrange); to_jso

Re: 'converts internal representation to "..."' comment is confusing

2023-06-25 Thread Steve Chavez
Hello hackers, Tom, could we apply this patch since Robert agrees it's an improvement? Best regards, Steve On Tue, 16 May 2023 at 07:49, Robert Haas wrote: > On Sun, May 14, 2023 at 9:37 PM Tom Lane wrote: > > Steve Chavez writes: > > > I found "..." co

Re: 'converts internal representation to "..."' comment is confusing

2023-05-14 Thread Steve Chavez
Thanks a lot for the clarification! The "..." looks enigmatic right now. I think cstring would save newcomers some head-scratching. Open to suggestions though. Best regards, Steve On Sun, 14 May 2023 at 22:36, Tom Lane wrote: > Steve Chavez writes: > > I found &quo

Re: Using make_ctags leaves tags files in git

2023-05-14 Thread Steve Chavez
e it's reasonable to ignore these as they're produced by make_ctags. Best regards, Steve On Sun, 14 May 2023 at 20:44, Michael Paquier wrote: > On Sun, May 14, 2023 at 06:13:21PM -0300, Steve Chavez wrote: > > I use postgres/src/tools/make_ctags and it works great. But it leaves t

Using make_ctags leaves tags files in git

2023-05-14 Thread Steve Chavez
Hello hackers, I use postgres/src/tools/make_ctags and it works great. But it leaves the tags files ready to be committed in git. So, I've added 'tags' to .gitignore. Best regards, Steve

'converts internal representation to "..."' comment is confusing

2023-05-14 Thread Steve Chavez
Hello hackers, I found "..." confusing in some comments, so this patch changes it to "cstring". Which seems to be the intention after all. Best regards, Steve From cb1792c45ea9a2fbd2c08e185653b60dc262a17d Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Sun, 14 May 2023 18

Re: Allow placeholders in ALTER ROLE w/o superuser

2022-11-22 Thread Steve Chavez
Hey Alexander, Looks like your latest patch addresses the original issue I posted! So now I can create a placeholder with the USERSET modifier without a superuser, while non-USERSET placeholders still require superuser: ```sql create role foo noinherit; set role to foo; alter role foo set prefi

csv_populate_recordset and csv_agg

2022-10-23 Thread Steve Chavez
Hello hackers, The `json_populate_recordset` and `json_agg` functions allow systems to process/generate json directly on the database. This "cut outs the middle tier"[1] and notably reduces the complexity of web applications. CSV processing is also a common use case and PostgreSQL has the COPY ..

Re: Allow placeholders in ALTER ROLE w/o superuser

2022-07-18 Thread Steve Chavez
applied at login time right? So at this point we can WARN or ERR about the defined role GUCs. What do you think? On Mon, 18 Jul 2022 at 19:03, Nathan Bossart wrote: > On Fri, Jul 01, 2022 at 04:40:27PM -0700, Nathan Bossart wrote: > > On Sun, Jun 05, 2022 at 11:20:38PM -0500, Steve Chavez

Fwd: Add red-black tree missing comparison searches

2022-07-06 Thread Steve Chavez
-- Forwarded message - From: Steve Chavez Date: Wed, 6 Jul 2022 at 18:14 Subject: Re: Add red-black tree missing comparison searches To: Alexander Korotkov Thanks Alexander! wrt to the new patch. I think the following comment is misleading since keyDeleted can be true or false

Re: Add red-black tree missing comparison searches

2022-07-02 Thread Steve Chavez
e! On Thu, 30 Jun 2022 at 14:34, Alexander Korotkov wrote: > Hi, Steve! > > Thank you for working on this. > > On Thu, Jun 30, 2022 at 7:51 PM Steve Chavez wrote: > > Currently the red-black tree implementation only has an equality search. > Other extensions might need o

Re: Add red-black tree missing comparison searches

2022-06-30 Thread Steve Chavez
Yes, I've already added it here: https://commitfest.postgresql.org/38/3742/ Thanks! On Thu, 30 Jun 2022 at 12:09, Greg Stark wrote: > Please add this to the commitfest at > https://commitfest.postgresql.org/38/ so it doesn't get missed. The > commitfest starts imminently so best add it today. >

Add red-black tree missing comparison searches

2022-06-30 Thread Steve Chavez
eemed worth it. Also I refactored the sentinel used in the rbtree.c to use C99 designators. Thanks in advance for any feedback! -- Steve Chavez Engineering at https://supabase.com/ From 85435fe0fad92d593940f98a493d1acd973ccda2 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 28 Jun 2022

Allow placeholders in ALTER ROLE w/o superuser

2022-06-05 Thread Steve Chavez
fect permission checking when an extension defines its custom GUC variables. DefineCustomStringVariable("my.custom", NULL, NULL, &my_custom, NULL, PGC_SUSET, ..); Using PGC_SUSET or PGC_SIGHUP will fail accordingly. Also no tests fail when doing "make installcheck". ---

Re: Assert name/short_desc to prevent SHOW ALL segfault

2022-05-25 Thread Steve Chavez
Thank you for the reviews Nathan, Michael. I agree with handling NULL in ShowAllGUCConfig() instead. I've attached the updated patch. -- Steve Chavez Engineering at https://supabase.com/ On Tue, 24 May 2022 at 20:21, Michael Paquier wrote: > On Tue, May 24, 2022 at 11:41:49AM -0700

Assert name/short_desc to prevent SHOW ALL segfault

2022-05-24 Thread Steve Chavez
with --enable-cassert can prevent the above issue. --- Steve Chavez Engineering at https://supabase.com/ From ad8a61125a0fe33853d459f12e521dff771130d4 Mon Sep 17 00:00:00 2001 From: Steve Chavez Date: Thu, 19 May 2022 08:59:46 -0500 Subject: [PATCH] Assert name/short_desc to prevent SHOWALL seg