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

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

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

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

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: [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: 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. --

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

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 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+":

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

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

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

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

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

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,

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-10-05 Thread Jim Jones
move 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 +0200 Subject: [PATCH v8] Add CANONICAL out

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

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-10-04 Thread Jim Jones
ror 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 Date: Wed, 4 Oct 2023 17:58:24 +0200 Subject: [PATCH v7] Add CANONICAL output for

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

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-19 Thread Jim Jones
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 Mon Sep 17 00:00:00 2001 From: Jim

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

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

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

[PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-04 Thread Jim Jones
, 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 inline comment

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

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

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

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

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

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

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

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

2023-08-25 Thread Jim Jones
T(); I have no idea how xmlcomment() got changed in this patch :D nice catch! I do not think this should be addressed in this patch because there are quite a lot of functions that need to handle this. v4 attached. Jim From ea812791ffdce22d5f5615da361f67c801089f91 Mon Sep 17 00:00:00 2001 Fr

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

2023-08-25 Thread Jim Jones
at it and work in a separated patch. v3 attached. Thanks Jim From 5a5302c8c8a16bf7cf26ade70a40f9e016d23bbf Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 25 Aug 2023 14:05:39 +0200 Subject: [PATCH v3] Add XMLText function (SQL/XML X038) This function implements the standard XMLTest function, which

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

2023-08-25 Thread Jim Jones
text ---  foo bar (1 row) It seems that an encoding issue appears in the regression tests on Debian + Meson, 32 bit. ´ > ´ ° > ° v2 attached updates the regression tests to fix it. Jim From 348e8952de0939c34e40283c7860aa44b66182f5 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 25 Aug

Re: xmlserialize bug - extra empty row at the end

2023-04-24 Thread Jim Jones
, 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 strings of type DOCUMENT

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

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

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:

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

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

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

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

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

[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 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

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

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

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 '' as text

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

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

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 suggest the output

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

2023-03-10 Thread Jim Jones
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 5d522d8ec1bd01731d0f75a4163f9a8ad435bee6 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 10 Mar 2023 13:47:16 +0100 Subject: [P

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

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-03-06 Thread Jim Jones
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 CANONICAL option

Re: [PATCH] Add CANONICAL option to xmlserialize

2023-03-06 Thread Jim Jones
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 to xmlserialize, which seri

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

[PATCH] Add CANONICAL option to xmlserialize

2023-03-05 Thread Jim Jones
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 clearer now :) Best, Jim From 1a3b8bc66c451863ace0488d32f1c0a876ab8

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 -

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

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

[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

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

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

2023-02-23 Thread Jim Jones
ent()), 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 2023 23:3

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

2023-02-22 Thread Jim Jones
to 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-22 Thread Jim Jones
es 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 98524ed5e39188c2ad177c3f22159d3aff301899 Mon Sep 17 00:00:00 2001

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

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

2023-02-20 Thread Jim Jones
I'm withdrawing this patch, as the same feature was already implemented in a different patch written by Jacob[1] Thanks everyone! Best, Jim 1- https://www.postgresql.org/message-id/flat/caawbhmi4v9zeavfuscdfx1por3zwrv9fuxkv_2marqvyc-m...@mail.gmail.com#199c1f49fbefa6be401db35f5cfa7742

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

2023-02-20 Thread Jim Jones
with xml strings of type DOCUMENT, this implementation also allows the usage of CONTENT type strings as long as it contains a well-formed xml. It will throw an error otherwise. Thanks! Best, Jim From ba0bf68ab69b702b6dbe00e481e39b60580d8569 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 20 Feb 2023

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

2023-02-17 Thread Jim Jones
On 17.02.23 01:08, Andrey Borodin wrote: On Thu, Feb 16, 2023 at 2:12 PM Jim Jones wrote: I've looked into the patch. The code looks to conform to usual expectations. One nit: this comment should have just one asterisk. + /** Thanks for reviewing! Asterisk removed in v14. And I have

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

2023-02-17 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

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

2023-02-16 Thread Jim Jones
2001 From: Jim Jones Date: Thu, 16 Feb 2023 22:36:19 +0100 Subject: [PATCH v13] 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. --- doc

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

2023-02-15 Thread Jim Jones
On 16.02.23 00:13, Peter Smith wrote: Today I fetched and tried the latest v11. It is failing too, but only just. - see attached file pretty-v11-results It looks only due to a whitespace EOF issue in the xml_2.out @@ -1679,4 +1679,4 @@ -- XML format: empty string SELECT xmlformat('');

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

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 pretty-printed XML output

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

2023-02-15 Thread Jim Jones
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 basically takes

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

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

2023-02-14 Thread Jim Jones
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 2545406a1494e71ca14dbad4ee6fca10e1668754 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu

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

2023-02-14 Thread Jim Jones
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 function. It basically takes advantage

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

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

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,

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

  1   2   >