Re: Patch: Add parse_type Function

2024-02-05 Thread Jim Jones
Hi David, Thanks for the patch. On 04.02.24 18:51, David E. Wheeler wrote: > Hackers, > > Attached is a patch to add a new function, `parse_type()`. It parses a type > string and returns a record with the typid and typmod for the type, or raises > an error if the type is invalid. It’s effectivel

Re: Patch: Add parse_type Function

2024-02-05 Thread Jim Jones
On 05.02.24 15:10, David E. Wheeler wrote: > Excellent, thank you very much! Updated patch attached. > > Best, > > David v2 no longer crashes with a null parameter. docs and regress tests were updated accordingly. patch no longer applies cleanly (tiny little indentation issue): /home/jim/Downl

Re: Patch: Add parse_type Function

2024-02-05 Thread Jim Jones
On 05.02.24 15:32, Dagfinn Ilmari Mannsåker wrote: > Once the function is declared strict, I don't think either of these is > necessary: function strictness is tested elsewhere, and it's the default > behaviour. The only functions that explicitly say they return NULL on > NULL inputs are quote_l

Re: Patch: Add parse_type Function

2024-02-05 Thread Jim Jones
On 05.02.24 16:14, David E. Wheeler wrote: > Right, done, and cleaned up the redundant comments. > > Best, > > David Nice. The patch applies cleanly and it no longer crashes with NULL parameters. Docs render fine and regression tests pass. I have nothing more to add. Let's now wait for Pavel's r

Re: Psql meta-command conninfo+

2024-02-08 Thread Jim Jones
Hi Maiquel On 07.02.24 21:13, Maiquel Grassi wrote: > > I believe in v7 patch we have a quite substantial meta-command feature. > > Thanks for implementing this. I find it very handy. I was just wondering if a "permission denied" error for non-superusers is the best choice for "\conninfo+": post

Re: Psql meta-command conninfo+

2024-02-08 Thread Jim Jones
On 08.02.24 16:50, Maiquel Grassi wrote: > Hi Jim, > Thank you for your support on this patch! > As I believe in its usability, I have been dedicating efforts to make > it really interesting. > I hadn't thought about the permissioning issue for > "unix_socket_directories". I appreciate that. > I

Re: Psql meta-command conninfo+

2024-02-08 Thread Jim Jones
Hi Erik On 08.02.24 21:37, Erik Wienhold wrote: > Modifiers such as + or S in \dS are not covered by autocompletion. > src/bin/psql/tab-complete.c only specifies backslash commands in their > basic form (without modifiers). > > (\dS actually autocompletes to \ds to my surprise) > Aha... I never no

Re: Psql meta-command conninfo+

2024-02-08 Thread Jim Jones
Hi Nathan On 09.02.24 03:41, Nathan Bossart wrote: > Separately, does > the server version really belong here? I'm not sure I would consider that > to be connection information. > I tend to agree with you. The info there wouldn't hurt, but perhaps the client version would be a better fit. -- J

Re: [PATCH] Add CANONICAL option to xmlserialize

2024-02-09 Thread Jim Jones
On 05.10.23 09:38, Jim Jones wrote: > > v8 attached changes de default behaviour to WITH COMMENTS. v9 attached with rebase due to changes done to primnodes.h in 615f5f6 -- Jim From fe51a1826b75b778c21f559236b23d340a10d703 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 9 Feb 2024 13

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Jim Jones
On 22.02.23 08:05, Nikolay Samokhvalov wrote: But is this as expected? Shouldn't it be like this:   text   13 ? Oracle and other parsers I know also do not work well with mixed contents.[1,2] I believe libxml2's parser does not know where to put the newline, as mixed values can contain mor

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Jim Jones
ved. == src/backend/utils/adt/xml. 4. xmlformat +#else + NO_XML_SUPPORT(); +return 0; +#endif Wrong indentation (return 0) in the indentation function? ;-) indentation corrected. v16 attached. Thanks a lot! Jim From a4fef3cdadd3d2f7abe530f5b07bf8c536689d83 Mon Sep 17 00:00:00 2001 From:

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Jim Jones
-- t (1 row) Actually NO INDENT just ignores this feature and doesn't call the function at all, so in this particular case the result sets will always be identical. But yes, I totally agree that a test case for that is also important. v17 attached. Thanks! Best, Jim From 98524ed5e39

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Jim Jones
separate the xmlserialize test cases from the rest. Thanks! Best, Jim From a37e8cea68e9e6032e29b555b986c28d12f4a16b Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 20 Feb 2023 23:35:22 +0100 Subject: [PATCH v18] Add pretty-printed XML output option This patch implements the XML/SQL:2011

Re: [PATCH] Add pretty-printed XML output option

2023-02-23 Thread Jim Jones
ze_indent()), so the association is clearer. xmlserialize_indent sounds much better and makes the association indeed clearer. Changed in v19. v19 attached. Thanks for the review! Best, Jim From ed1e4a9fc94a6b65a9be6b125ae5fa8af1aa9d68 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 20 Feb

Re: Proposal: :SQL_EXEC_TIME (like :ROW_COUNT) Variable (psql)

2023-02-24 Thread Jim Jones
On 23.02.23 20:55, Kirk Wolak wrote: Everyone,   I love that my proposal for %T in the prompt, triggered some great conversations.   This is not instead of that.  That lets me run a query and come back HOURS later, and know it finished before 7PM like it was supposed to!   This feature is s

[PoC] Add CANONICAL option to xmlserialize

2023-02-27 Thread Jim Jones
Hi, In order to compare pairs of XML documents for equivalence it is necessary to convert them first to their canonical form, as described at W3C Canonical XML 1.1.[1] This spec basically defines a standard physical representation of xml documents that have more then one possible representati

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-03-01 Thread Jim Jones
On 01.03.23 01:47, Kirk Wolak wrote: Patch Posted with one edit, for line editings (Thanks Jim!) The patch didn't pass the SanityCheck: https://cirrus-ci.com/task/5445242183221248?logs=build#L1337 missing a header perhaps? #include "time.h" Best, Jim

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-03-01 Thread Jim Jones
On 01.03.23 01:59, Kirk Wolak wrote: I cannot get the last email to show up for the commitfest. This is version 2 of the original patch. [1] Thanks Jim! [1]https://postgr.es/m/CACLU5mSRwHr_8z%3DenMj-nXF1tmC7%2BJn5heZQNiKuLyxYUtL2fg%40mail.gmail.com Regards Kirk. The patch didn't pass the Sani

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-03-01 Thread Jim Jones
On 01.03.23 17:13, Kirk Wolak wrote: Thanks, corrected, and confirmed Unix line endings. FWIW, the simplest way to test it is with this command (I usually get it wrong on the first guess) \set PROMPT1 %T ' ' :PROMPT1 Kirk Nice. The patch applies clean and the cfbots seem much happier now -

[PATCH] Add CANONICAL option to xmlserialize

2023-03-05 Thread Jim Jones
xmlcanonical(doc xml, keep_comments boolean), but I'm not sure if this would be the right approach. Attached a very short draft. What do you think? Best, Jim 1- https://www.w3.org/TR/xml-c14n11/ The attached version includes documentation and tests to the patch. I hope things are cleare

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-03-05 Thread Jim Jones
On 05.03.23 22:00, Thomas Munro wrote: The CI run for that failed in an interesting way, only on Debian + Meson, 32 bit. The diffs appear to show that psql has a different opinion of the column width, while building its header (the "--" you get at the top of psql's output), even though the a

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-03-06 Thread Jim Jones
ON_DOCUMENT, false, encoding, NULL); v2 attached. Thanks! Best, Jim From 23ed616809b319bb175473bd210d81ad95af21ff Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Tue, 28 Feb 2023 23:06:30 +0100 Subject: [PATCH v2] Add CANONICAL format to xmlserialize This patch introduces the CANONICAL option t

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-03-06 Thread Jim Jones
anged the test case to a character that both encodings can deal with. v3 attached. From 759bacecb7e9355f41ebd02cbca38cf893e3cfc0 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 6 Mar 2023 14:08:54 +0100 Subject: [PATCH v3] Add CANONICAL format to xmlserialize This patch introduces the

Re: [PATCH] Add pretty-printed XML output option

2023-03-09 Thread Jim Jones
On 09.03.23 18:38, Tom Lane wrote: While reviewing this patch, I started to wonder why we don't eliminate the maintenance hassle of xml_1.out by putting in a short-circuit at the top of the test, similar to those in some other scripts: /* skip test if XML support not compiled in */ SELECT 'one':

Re: [PATCH] Add pretty-printed XML output option

2023-03-10 Thread Jim Jones
ess any of the above, however. I swear to god I have no idea what "add-at-the-end-itis" means :) regards, tom lane Thanks a lot! Best, Jim 1 - https://dbfiddle.uk/WUOWtjBU 2 - https://www.samltool.com/prettyprint.php 3 - https://xmlpretty.com/xmlpretty From 5d

Re: [PATCH] Add pretty-printed XML output option

2023-03-13 Thread Jim Jones
On 10.03.23 15:32, Tom Lane wrote: Jim Jones writes: On 09.03.23 21:21, Tom Lane wrote: I've looked through this now, and have some minor complaints and a major one. The major one is that it doesn't work for XML that doesn't satisfy IS DOCUMENT. For example, How do you sug

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-03-14 Thread Jim Jones
v4 attached fixes an encoding issue at the xml_parse call. It now uses GetDatabaseEncoding(). Best, Jim From 3ff8e7bd9a9e43194d834ba6b125841539d5df1c Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 6 Mar 2023 14:08:54 +0100 Subject: [PATCH v4] Add CANONICAL format to xmlserialize This

Re: [PATCH] Add pretty-printed XML output option

2023-03-14 Thread Jim Jones
On 09.03.23 21:21, Tom Lane wrote: Peter Smith writes: The patch v19 LGTM. Another thing that's mildly irking me is that the current factorization of this code will result in xml_parse'ing the data twice, if you have both DOCUMENT and INDENT specified. We could consider avoiding that if we me

Re: [PATCH] Add pretty-printed XML output option

2023-03-14 Thread Jim Jones
On 14.03.23 18:40, Tom Lane wrote: Jim Jones writes: [ v22-0001-Add-pretty-printed-XML-output-option.patch ] I poked at this for awhile and ran into a problem that I'm not sure how to solve: it misbehaves for input with embedded DOCTYPE. regression=# SELECT xmlserialize(DOCUMENT '

Re: [PATCH] Add pretty-printed XML output option

2023-03-16 Thread Jim Jones
On 15.03.23 22:13, Tom Lane wrote: I wrote: It occurred to me to test v23 for memory leaks, and it had bad ones: * the "newline" node used in the CONTENT case never got freed. Making another one for each line wasn't helping, either. Oh, I did really miss that one. Thanks! Pushed with those chan

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-03-17 Thread Jim Jones
v5 attached is a rebase over the latest changes in xmlserialize (INDENT output).From 24f045ccf7ac000a509910cb32c54ce4c91e2c33 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 17 Mar 2023 10:23:48 +0100 Subject: [PATCH v5] Add CANONICAL output format to xmlserialize This patch introduces the

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-03-17 Thread Jim Jones
After some more testing I realized that v5 was leaking the xmlDocPtr. Now fixed in v6. From d04d8fdcbedbd5ed88469bd22e079467c26ab7a4 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 17 Mar 2023 10:23:48 +0100 Subject: [PATCH v6] Add CANONICAL output format to xmlserialize This patch

[PATCH] Add XMLText function (SQL/XML X038)

2023-03-25 Thread Jim Jones
documentation and regression tests. Any thoughts? Best, Jim 1 - https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-entities.html#xmlEncodeSpecialChars From 84d6e026724d7e3869f28b09c686e2fc4da67873 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Sat, 25 Mar 2023 12:24:49 +0100 Subject: [PATCH v1

Re: [PATCH] Add XMLText function (SQL/XML X038)

2023-03-25 Thread Jim Jones
On 25.03.23 12:53, Pavel Stehule wrote: so 25. 3. 2023 v 12:49 odesílatel Jim Jones napsal: Hi, This small patch proposes the implementation of the standard SQL/XML function XMLText (X038). It basically converts a text parameter into an xml text node. It uses the

Re: Adding comments to help understand psql hidden queries

2024-03-15 Thread Jim Jones
Hi Greg, hi David On 01.02.24 23:39, David Christensen wrote: > On Thu, Feb 1, 2024 at 4:34 PM Greg Sabino Mullane wrote: >> The use of the --echo-hidden flag in psql is used to show people the way >> psql performs its magic for its backslash commands. None of them has more >> magic than "\d re

Re: Psql meta-command conninfo+

2024-02-14 Thread Jim Jones
On 12.02.24 15:16, Maiquel Grassi wrote: > > (v14) > > v14 applies cleanly and the SSL info is now shown as previously suggested. Here is a more comprehensive test: $ /usr/local/postgres-dev/bin/psql -x "\     host=server.uni-muenster.de     hostaddr=172.19.42.1     user=jim dbname=postgres    

Re: Psql meta-command conninfo+

2024-02-16 Thread Jim Jones
On 15.02.24 23:16, Maiquel Grassi wrote: > > Hi! > > (v16) > > In this version, I made a small adjustment to the indentation > of the \conninfo code and described the columns as returned > by \conninfo+ as suggested by Jim Jones. > > I've performed the fol

Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

2024-02-16 Thread Jim Jones
Hi! On 12.02.24 01:00, jian he wrote: > attached v2. > syntax: `on_error set_to_null` > based on upthread discussion, now if you specified `on_error > set_to_null` and your column has `not > null` constraint, we convert the error field to null, so it may error > while bulk inserting for violating

Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

2024-02-16 Thread Jim Jones
On 16.02.24 21:31, David G. Johnston wrote: > Yes.  In particular not all columns in the table need be specified in > the copy command so while the parsed input data is all nulls the > record itself may not be. Yeah, you have a point there. I guess if users want to avoid it to happen they can r

Re: Patch: Add parse_type Function

2024-02-24 Thread Jim Jones
On 24.02.24 14:46, David E. Wheeler wrote: > What’s the protocol for marking a patch ready for committer? I guess after the review of the last assigned reviewer v9 applies cleanly, all tests pass and documentation builds correctly. Just a very small observation: The fact that a completely in

Re: Reducing the log spam

2024-03-05 Thread Jim Jones
Hi Laurenz On 05.03.24 13:55, Laurenz Albe wrote: Inspired by feedback to [1], I thought about how to reduce log spam. My experience from the field is that a lot of log spam looks like database/table/... "xy" does not exist duplicate key value violates unique constraint "xy" So what abo

Re: Authentication fails for md5 connections if ~/.postgresql/postgresql.{crt and key} exist

2023-01-06 Thread Jim Jones
ri, 6 Jan 2023 at 09:15, Jim Jones wrote: Dear PostgreSQL Hackers, Some time ago we faced a small issue in libpq regarding connections configured in the pg_hba.conf as type *hostssl* and using *md5* as authentication method. One of our users placed the client certifica

Re: [PATCH] psql: Add tab-complete for optional view parameters

2023-01-09 Thread Jim Jones
Hi Christoph, Thanks for the patch! I just tested it and I could reproduce the expected behaviour in these cases: postgres=# CREATE VIEW w AS  WITH ( postgres=# CREATE OR REPLACE VIEW w AS  WITH ( postgres=# CREATE VIEW w WITH ( CHECK_OPTION  SECURITY_BARRIER  SECURITY_INVOKER p

Re: Make EXPLAIN generate a generic plan for a parameterized query

2023-01-16 Thread Jim Jones
Hi Laurenz, I'm testing your patch and the GENERIC_PLAN parameter seems to work just OK .. db=# CREATE TABLE t (col numeric); CREATE TABLE db=# CREATE INDEX t_col_idx ON t (col); CREATE INDEX db=# INSERT INTO t SELECT random() FROM generate_series(1,10) ; INSERT 0 10 db=# EXPLAIN (GENE

Re: Tab completion for AT TIME ZONE

2023-04-14 Thread Jim Jones
Hi, Is this supposed to provide tab completion for the AT TIME ZONE operator like in this query? SELECT '2023-04-14 08:00:00' AT TIME ZONE 'Europe/Lisbon'; The patch applied cleanly but I'm afraid I cannot reproduce the intended behaviour: postgres=# SELECT '2023-04-14 08:00:00' AT postgr

Re: Adding argument names to aggregate functions

2023-04-14 Thread Jim Jones
On 12.04.23 19:53, Dagfinn Ilmari Mannsåker wrote: Dagfinn Ilmari Mannsåker writes: Hi hackers, I'm sure I'm not the only one who can never remember which way around the value and delimiter arguments go for string_agg() and has to look it up in the manual every time. To make it more convenie

Re: Tab completion for AT TIME ZONE

2023-04-14 Thread Jim Jones
On 14.04.23 11:29, Dagfinn Ilmari Mannsåker wrote: It doesn't tab complete the AT TIME ZONE operator itself, just the timezone name after it, so this sholud work: # SELECT now() AT TIME ZONE or # SELECT now() AT TIME ZONE am However, looking more closely at the grammar, the word A

Re: Adding argument names to aggregate functions

2023-04-18 Thread Jim Jones
On 14.04.23 12:03, Dagfinn Ilmari Mannsåker wrote: Thanks for the heads-up, here's a rebased patch. I've also formatted the lines to match what reformat_dat_file.pl wants. It also wanted to reformat a bunch of other entries, but I left those alone. - ilmari The patch applies cleanly now and \

Re: Adding argument names to aggregate functions

2023-04-18 Thread Jim Jones
On 18.04.23 10:58, I wrote: On 14.04.23 12:03, Dagfinn Ilmari Mannsåker wrote: Thanks for the heads-up, here's a rebased patch. I've also formatted the lines to match what reformat_dat_file.pl wants.  It also wanted to reformat a bunch of other entries, but I left those alone. - ilmari The pa

Re: Adding argument names to aggregate functions

2023-04-18 Thread Jim Jones
On 18.04.23 12:27, Dagfinn Ilmari Mannsåker wrote: Link to the actual job: https://cirrus-ci.com/task/5881376021413888 The failure was: [09:54:38.727] 216/262 postgresql:recovery / recovery/031_recovery_conflict ERROR 198.73s exit status 60 Looking at its log: https://api.cirrus-ci.com/v1/ar

Re: Tab completion for GRANT MAINTAIN

2023-04-19 Thread Jim Jones
On 18.04.23 11:08, Ken Kato wrote: Hi hackers, I found that GRANT MAINTAIN is not tab-completed with ON, so here is a patch. Hi, the patch applies cleanly and now GRANT MAINTAIN tab-completes with ON. For the sake of completeness I tested a whole statement: postgres=# GRANT M => postgres

Re: xmlserialize bug - extra empty row at the end

2023-04-23 Thread Jim Jones
On 23.04.23 07:31, Pavel Stehule wrote: Hi maybe I found a bug in xmlserialize SELECT xmlserialize(DOCUMENT 'x="y">42' AS varchar INDENT); (2023-04-23 07:27:53) postgres=# SELECT xmlserialize(DOCUMENT '42' AS varchar INDENT); ┌─┐ │      xmlserialize       │ ╞

Re: xmlserialize bug - extra empty row at the end

2023-04-23 Thread Jim Jones
My inclination would be, if we're just calling to a long-standardized library routine, to just accept its output as is. If a program is saving the output to a text file, that would be the expected behaviour. If not, then we need to document that the output of our function is the output of the

Re: xmlserialize bug - extra empty row at the end

2023-04-24 Thread Jim Jones
CF entry for this. Best, Jim From aa5eafb319da04d2e67a1540af0d088af6d82edb Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 24 Apr 2023 10:02:32 +0200 Subject: [PATCH v1] Remove trailing newlines from xmlserialize indent output This removes the trailing newlines added to xmlserialize indent output from xml st

Re: [PATCH] Add XMLText function (SQL/XML X038)

2023-11-03 Thread Jim Jones
Hi Daniel, hi Vik, Thanks a lot for the review! On 03.11.23 16:45, Vik Fearing wrote: > We should put a short version of the disclaimer in sql_features.txt as > well. You mean to add a disclaimer in the X038 entry? Something along these lines perhaps? X038    XMLText            YES     It does n

Re: [PATCH] Add XMLText function (SQL/XML X038)

2023-11-03 Thread Jim Jones
1d086e8f6 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 3 Nov 2023 21:15:21 +0100 Subject: [PATCH v6] Add XMLText function (SQL/XML X038) This function implements the standard XMLTest function, which converts text into xml text nodes. It uses the libxml2 function xmlEncodeSpecialChars

Re: [PATCH] Add XMLText function (SQL/XML X038)

2023-11-06 Thread Jim Jones
On 06.11.23 11:49, Daniel Gustafsson wrote: > I took another look at this today, fixes the above mentioned typos and some > tiny cosmetic things and pushed it. > > -- > Daniel Gustafsson > Awesome! Thanks Daniel and Vik for reviewing and pushing this patch :) -- Jim

Re: Tab completion for CREATE TABLE ... AS

2023-11-09 Thread Jim Jones
Hi On 02.11.23 17:27, Gilles Darold wrote: > Hi, > > > Look like the tab completion for CREATE TABLE ... AS is not proposed. > > > gilles=# CREATE TABLE test > ( OF    PARTITION OF > >  The attached patch fix that and also propose the further completion > after the AS keyword.

Re: Allow specifying a dbname in pg_basebackup connection string

2023-08-29 Thread Jim Jones
Hi Jelte On 29.08.23 15:55, Jelte Fennema wrote: Thanks for the review. I've updated the documentation to make it clearer (using some of your suggestions but also some others) This patch applies and builds cleanly, and the documentation is very clear. I tested it using the 'replication-suppor

Re: PATCH: Add REINDEX tag to event triggers

2023-08-30 Thread Jim Jones
Greetings On 27.07.23 06:43, Garrett Thornburg wrote: I added a v2 patch for adding REINDEX to event triggers. The following has changed: 1. I fixed the docs to note that ddl_command_start is supported for REINDEX. Thanks, Michael! 2. I added Jian He's excellent partition table test and updat

Re: Allow specifying a dbname in pg_basebackup connection string

2023-08-30 Thread Jim Jones
On 30.08.23 14:11, Jelte Fennema wrote: Oops it indeed seemed like I made an unintended change when handling database names that did not exist in pgbouncer.conf when you used auth_type=hba. I pushed a fix for that now to the replication-support branch. Feel free to try again. But as you said it's

Show inline comments from pg_hba lines in the pg_hba_file_rules view

2023-08-31 Thread Jim Jones
Hi, Often we make changes in the pg_hba.conf and leave a #comment there, just in case we forget why the change was done. To avoid having to open the configuration file every time just to check the comments, it would be quite nice to have the option to read these comments in the pg_hba_file_ru

Re: Show inline comments from pg_hba lines in the pg_hba_file_rules view

2023-09-01 Thread Jim Jones
Hi Michael On 01.09.23 03:18, Michael Paquier wrote: hba.c is complex enough these days (inclusion logic, tokenization of the items) that I am not in favor of touching its code paths for anything like that. This is not something that can apply only to pg_hba.conf, but to all configuration files

Re: PATCH: Add REINDEX tag to event triggers

2023-09-01 Thread Jim Jones
On 01.09.23 11:23, jian he wrote: because the change made in here: https://git.postgresql.org/cgit/postgresql.git/diff/src/backend/commands/indexcmds.c?id=11af63fb48d278b86aa948a5b57f136ef03c2bb7 I manually slight edited the patch content: from static List *ChooseIndexColumnNames(List *indexEl

Re: Show inline comments from pg_hba lines in the pg_hba_file_rules view

2023-09-01 Thread Jim Jones
On 01.09.23 12:44, Michael Paquier wrote: I am not sure what you have in mind, but IMO any solution would live better as long as a solution is: - not linked to hba.c, handled in a separate code path. - linked to all configuration files where comments are supported, if need be. If I understood y

[PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-04 Thread Jim Jones
st regards, Jim From bb795fae29a0f714c590f94176a4675d7ae85a2f Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 4 Sep 2023 12:32:04 +0200 Subject: [PATCH v1] Add inline comments to the pg_hba_file_rules view This patch proposes the column "comment" to the pg_hba_file_rules view. It basically parses the inli

Re: PATCH: Add REINDEX tag to event triggers

2023-09-04 Thread Jim Jones
On 01.09.23 18:10, jian he wrote: Thanks for pointing this out! Thanks for the fix! also due to commit https://git.postgresql.org/cgit/postgresql.git/commit/?id=11af63fb48d278b86aa948a5b57f136ef03c2bb7 ExecReindex function input arguments also changed. so we need to rebase this patch. change t

Re: [PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-09 Thread Jim Jones
ot; are removed, IMO, it can be more accurate to say, Text after the first # comment character in the end of a valid pg_hba.conf entry, if any I agree. v2 attached includes your suggestion. Thanks! Jim From a817d8b8fc437ef20f9b1f397764895e6d1f2008 Mon Sep 17 00:00:00 2001 From: Jim Jones D

Re: [PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-14 Thread Jim Jones
Hi On 11.09.23 00:33, Michael Paquier wrote: Well, it looks like what I wrote a couple of days ago was perhaps confusing: https://www.postgresql.org/message-id/ZPHAiNp%2ByKMsa/vc%40paquier.xyz https://www.postgresql.org/message-id/zpe8a7enuh+ax...@paquier.xyz This patch touches hbafuncs.c and t

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-09-14 Thread Jim Jones
The cfbot started complaining about this patch on "macOS - Ventura - Meson" 'Persistent worker failed to start the task: tart isolation failed: failed to create VM cloned from "ghcr.io/cirruslabs/macos-ventura-base:latest": tart command returned non-zero exit code: ""' Is this a problem in m

Re: [PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-15 Thread Jim Jones
On 15.09.23 01:28, Michael Paquier wrote: Yes, my suggestion was to define a new set-returning function that takes in input a file path and that returns as one row one comment and its line number from the configuration file. -- Michael Thanks! If reading the file again is an option, perhaps a

Re: [PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-19 Thread Jim Jones
a entry I am still struggling to find a way to enable this function in separated path without having to read the conf file multiple times, or writing too much redundant code. How many other conf files do you think would profit from this feature? Jim From 47f55bab0a8e8af286e6be2f40d218f25a5066c9

Re: [PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-26 Thread Jim Jones
Hi! On 26.09.23 15:19, Peter Eisentraut wrote: On 04.09.23 11:54, Jim Jones wrote: This patch proposes the column "comment" to the pg_hba_file_rules view. It basically parses the inline comment (if any) of a valid pg_hba.conf entry and displays it in the new column. For such pg_h

Re: [PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-28 Thread Jim Jones
Hi Daniel On 27.09.23 10:21, Daniel Gustafsson wrote: An annotation syntax specifically for this would address my concern, but the argument that pg_hba (and related code) is border-line too complicated as it is does hold some water. Complexity in code can lead to bugs, but complexity in syntax

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-10-04 Thread Jim Jones
f they contain a singly-rooted + * XML - xml_parse() will throw an error otherwise. I didn't understand the suggestion in 8) :) Thanks again for the review. Much appreciated! v7 attached. Best, Jim From 4bd06615b9aa9f3f0fcebdd1bc30a0500524cdad Mon Sep 17 00:00:00 2001 From: Jim Jones D

Add annotation syntax to pg_hba.conf entries

2023-10-04 Thread Jim Jones
Hi, I'm opening this thread after a brief discussion regarding a potential new syntax to enable annotations in pg_hba entries. [1] This feature mainly aims to annotate pg_hba entries in a way that the annotations can be parsed and displayed in the pg_hba_file_rule view for reporting purposes

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-10-05 Thread Jim Jones
ks for that! It is indeed clearer to only remove items from the result set if explicitly said so. v8 attached changes de default behaviour to WITH COMMENTS. Best, Jim From fa3c9c7d5a37c407993f4e2076afed2891e1bfc1 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Wed, 4 Oct 2023 17:58:24 +

Re: Add annotation syntax to pg_hba.conf entries

2023-10-10 Thread Jim Jones
Hi Robert, Hi Tom, Thanks for the feedback! On 05.10.23 00:55, Tom Lane wrote: > Robert Haas writes: >> You're probably not going to like this answer very much, but this >> doesn't seem particularly worthwhile to me. > Yeah, I was unconvinced about the number of use-cases too. > As you say, some

Authentication fails for md5 connections if ~/.postgresql/postgresql.{crt and key} exist

2022-12-09 Thread Jim Jones
e2187fce289054a846e17a5414801d Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 21 Nov 2022 15:05:33 +0100 Subject: [PATCH v1] add sslmode no-clientcert --- doc/src/sgml/libpq.sgml | 11 + src/interfaces/libpq/fe-connect.c| 1 + src/interfaces/

Re: Authentication fails for md5 connections if ~/.postgresql/postgresql.{crt and key} exist

2023-01-20 Thread Jim Jones
Hello Israel, Thanks a lot for the suggestion! > I do not think it is worth it to change the current behavior of PostgreSQL > in that sense. Well, I am not suggesting to change the current behavior of PostgreSQL in that matter. Quite the contrary, I find this feature very convenient, speciall

Re: Authentication fails for md5 connections if ~/.postgresql/postgresql.{crt and key} exist

2023-01-21 Thread Jim Jones
Hi Jacob, > I think the sslcertmode=disable option that I introduced in [1] solves this issue too; Well, I see there is indeed a significant overlap between our patches - but yours has a much more comprehensive approach! If I got it right, the new slcertmode=disable would indeed cancel the exi

Re: Authentication fails for md5 connections if ~/.postgresql/postgresql.{crt and key} exist

2023-01-29 Thread Jim Jones
On 27.01.23 21:13, Cary Huang wrote: I agree that it is a more elegant approach to add "sslcertmode=disable" on the client side to prevent sending default certificate. But, if the server does request clientcert but client uses "sslcertmode=disable" to connect and not give a certificate, it

[PATCH] Add pretty-printed XML output option

2023-02-02 Thread Jim Jones
7;);     xmlpretty -- +      + 42+        +    + (1 row) The patch also contains regression tests and documentation. Feedback is very welcome! Jim From ced9fccddc033de98709a6e93dc6530ce68149db Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 2 Feb 2023 21:27:1

Re: [PATCH] Add pretty-printed XML output option

2023-02-02 Thread Jim Jones
oved in v2. On 02.02.23 21:35, Jim Jones wrote: Hi, This small patch introduces a XML pretty print function. It basically takes advantage of the indentation feature of xmlDocDumpFormatMemory from libxml2 to format XML strings. postgres=# SELECT xmlpretty('id="z"

Re: [PATCH] Add pretty-printed XML output option

2023-02-06 Thread Jim Jones
bxml to run my regression tests? v3 adds a missing xmlFree call. Best, Jim From ced9fccddc033de98709a6e93dc6530ce68149db Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 2 Feb 2023 21:27:16 +0100 Subject: [PATCH v3 1/3] Add pretty-printed XML output option This small patch introduces a XML pretty prin

Re: [PATCH] Add pretty-printed XML output option

2023-02-06 Thread Jim Jones
:00:00 2001 From: Jim Jones Date: Thu, 2 Feb 2023 21:27:16 +0100 Subject: [PATCH v4 1/4] Add pretty-printed XML output option This small patch introduces a XML pretty print function. It basically takes advantage of the indentation feature of xmlDocDumpFormatMemory from libxml2 to format XML strings

Re: [PATCH] Add pretty-printed XML output option

2023-02-08 Thread Jim Jones
while working on another item of the TODO list I realized that I should be using a PG_TRY() block in he xmlDocDumpFormatMemory call. Fixed in v5. Best regards, Jim From f503b25c7fd8d984d29536e78577741e5e7c5e9f Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 2 Feb 2023 21:27:16 +0100

Re: [PATCH] Add pretty-printed XML output option

2023-02-08 Thread Jim Jones
On 09.02.23 00:09, Peter Smith wrote: I noticed the xmlFreeDoc(doc) within the PG_CATCH is guarded but the other xmlFreeDoc(doc) is not. As the doc is assigned outside the PG_TRY shouldn't those both be the same? Hi Peter, My logic there was the following: if program reached that part of the

Re: [PATCH] Add pretty-printed XML output option

2023-02-08 Thread Jim Jones
On 09.02.23 02:01, Peter Smith wrote: OTOH, if you are having to check for NULL doc anyway, maybe it's just as easy only doing that up-front. Then you could quick-exit the function without calling xmlDocDumpFormatMemory etc. in the first place. For example: doc = xml_parse(arg, XMLOPTION_DOCUMEN

Re: [PATCH] Add pretty-printed XML output option

2023-02-09 Thread Jim Jones
On 09.02.23 08:23, Tom Lane wrote: Um ... why are you using PG_TRY here at all? It seems like you have full control of the actually likely error cases. The only plausible error out of the StringInfo calls is OOM, and you probably don't want to trap that at all. My intention was to catch any un

Re: [PATCH] Add pretty-printed XML output option

2023-02-10 Thread Jim Jones
On 10.02.23 02:10, Peter Smith wrote: On Thu, Feb 9, 2023 at 7:17 PM Jim Jones wrote: 1. FYI, there are some whitespace warnings applying the v5 patch Trailing whitespaces removed. The patch applies now without warnings. == src/test/regress/sql/xml.sql 2. The v5 patch was already

Re: [PATCH] Add pretty-printed XML output option

2023-02-13 Thread Jim Jones
On 13.02.23 02:15, Peter Smith wrote: Something is misbehaving. Using the latest HEAD, and before applying the v6 patch, 'make check' is working OK. But after applying the v6 patch, some XML regression tests are failing because the DETAIL part of the message indicating the wrong syntax position

Re: [PATCH] Add pretty-printed XML output option

2023-02-14 Thread Jim Jones
On 13.02.23 13:15, Jim Jones wrote: diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/xml.out /tmp/cirrus-ci-build/build/testrun/regress/regress/results/xml.out --- /tmp/cirrus-ci-build/src/test/regress/expected/xml.out 2023-02-12 09:02:57.077569000 + +++ /tmp/cirrus-ci-build

Re: [PATCH] Add pretty-printed XML output option

2023-02-14 Thread Jim Jones
ds SET XML OPTION DOCUMENT to the regression tests. Best, Jim From 588bd8cbde42189117a429b6f588053ea8362fd8 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 2 Feb 2023 21:27:16 +0100 Subject: [PATCH v8] Add pretty-printed XML output option This small patch introduces a XML pretty print

Re: [PATCH] Add pretty-printed XML output option

2023-02-14 Thread Jim Jones
tgres=# SELECT xmlformat(''); ERROR:  invalid XML document DETAIL:  line 1: switching encoding : no input ^ line 1: Document is empty ^ v9 wraps the corner test cases with VERBOSITY terse to reduce the error message output. Thanks! Best, Jim From 2545406a1494e71ca14dbad4ee6fca10e1668

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
On 15.02.23 10:06, Peter Smith wrote: Bingo!! Your v9 patch now passes all 'make check' tests for me. Nice! It also passed all tests in the patch tester. But I'll leave it to a committer to decide if this VERBOSITY toggle is the best fix. I see now other test cases in the xml.sql file that al

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
On 15.02.23 11:11, Alvaro Herrera wrote: Note that there's another file, xml_2.out, which does not contain the additional part of the DETAIL message. I suspect in Peter's case it's xml_2.out that was originally being used as a comparison basis (not xml.out), but that one is not getting patched,

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
additional lines. Thanks for the review! Best, Jim From 835c9ec18255adce9f9ae1e1e5d9e4287bac5452 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 2 Feb 2023 21:27:16 +0100 Subject: [PATCH v10] Add pretty-printed XML output option This small patch introduces a XML pretty print function. It basic

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
xpath('/*', ''); ERROR:  could not parse XML document \set VERBOSITY default v11 now correctly sets xml_2.out. Best, Jim From 473aab0a0028cd4de515c6a3698a1cda1c987067 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 2 Feb 2023 21:27:16 +0100 Subject: [PATCH v11] Add prett

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
On 16.02.23 05:38, Nikolay Samokhvalov wrote: On Thu, Feb 9, 2023 at 2:31 AM Peter Eisentraut wrote: I suggest we call it "xmlformat", which is an established term for this. Some very-very old, rusted memory told me that there was something in standard – and indeed, it seems it desc

  1   2   3   >