Re: psql: add \create_function command

2024-03-10 Thread Steve Chavez
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. It mi

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 17 00:00:00

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 Dunstan wr

psql: add \create_function command

2024-01-26 Thread Steve Chavez
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 From

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

2023-09-19 Thread Steve Chavez
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 domain myt

Add pg_basetype() function to obtain a DOMAIN base type

2023-09-08 Thread Steve Chavez
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 9be553c2a3896c12d959bc722a808589765f3db0 Mon Sep 17 00

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

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);

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
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 the > > tags files ready

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

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
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 wrote: >

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
Done! 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
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 23:46

Allow placeholders in ALTER ROLE w/o superuser

2022-06-05 Thread Steve Chavez
variables. DefineCustomStringVariable("my.custom", NULL, NULL, _custom, NULL, PGC_SUSET, ..); Using PGC_SUSET or PGC_SIGHUP will fail accordingly. Also no tests fail when doing "make installcheck". --- Steve Chavez Engineering at https://supabase.com/ From c3493373a8cddf

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, Nat

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 segfault