Re: Regression with large XML data input

2025-07-29 Thread Jim Jones
On 29.07.25 17:27, Tom Lane wrote: > Re-reading the prior thread, I see that my memory above is quite > faulty: we added the node_list intermediate variable as a way to > detect errors when the return code from xmlParseBalancedChunkMemory > couldn't be trusted. So I think you're right to questi

Re: Regression with large XML data input

2025-07-29 Thread Jim Jones
On 29.07.25 14:11, Tom Lane wrote: > In the original coding, there was a hazard of the node list getting > leaked if the caller passed parsed_nodes == NULL. Or at least I > thought there was. It may be that all releases of libxml2 are smart > enough to free the node list if there's no way to p

Re: Regression with large XML data input

2025-07-29 Thread Jim Jones
On 28.07.25 22:16, Tom Lane wrote: > Erik's v2 is slightly wrong as to the save-and-restore logic for > the KeepBlanks setting: we need to restore in the error path too, > and we'd better mark the save variable volatile since it's modified > inside the PG_TRY. I made some other cosmetic changes,

Re: Regression with large XML data input

2025-07-28 Thread Jim Jones
On 28.07.25 04:47, Michael Paquier wrote: > I understand that from the point of view of a > maintainer this is rather bad, but from the customer point of view the > current situation is also bad to deal with in the scope of a minor > upgrade, because applications suddenly break. I totally get i

Re: Regression with large XML data input

2025-07-24 Thread Jim Jones
On 24.07.25 21:23, Tom Lane wrote: > Oh, wait ... the plot thickens! The above statement is true > when testing on my Mac with libxml2 2.13.8 from MacPorts. > With either HEAD or f68d6aabb7e2^, I get errors similar to > what Erik just showed: > > ERROR: invalid XML content > DETAIL: line 1: R

Re: display hot standby state in psql prompt

2025-07-23 Thread Jim Jones
' is typically treated as a paired label that indicates two distinct capabilities --- read and write. What do you think? v3 attached. Thanks for the thorough testing and review! Best, JimFrom 260d23ca92d5c31dc717cca4fd05b760e0069142 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Wed, 23 Jul

Re: display hot standby state in psql prompt

2025-07-22 Thread Jim Jones
est regards, Jim 1 - https://commitfest.postgresql.org/patch/5872/From d428f71ab5c7f8dea5d5446223f29c203d41dfec Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Tue, 22 Jul 2025 11:30:22 +0200 Subject: [PATCH v2] Add %i prompt escape to indicate server read-only status This patch introduces a new pr

Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values

2025-07-07 Thread Jim Jones
On 07.07.25 19:52, Dean Rasheed wrote: > perhaps that should say > > Note that any values that were supplied by defaults, as well as > the effects of all per-row BEFORE INSERT triggers are reflected > in excluded values, since that may have contributed to the row > being excluded

Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values

2025-07-07 Thread Jim Jones
Hi Dean On 30.06.25 19:18, Dean Rasheed wrote: > v2 attached, now with docs and more test cases. I'm wondering if the current behaviour with DEFAULT columns should be mentioned in the docs. CREATE TABLE t2 (a int PRIMARY KEY, b text DEFAULT 'default value'); INSERT INTO t2 VALUES (1, 'old value'

Re: Fix deprecation warning with libxml2 2.14 in contrib/xml2/

2025-07-04 Thread Jim Jones
On 04.07.25 06:03, Michael Paquier wrote: > The solution is simple: we need to replace buf->content by a call to > xmlBufferContent(). This routine exists since be803967dbec (year > 2000), so 25 years should make that safe enough to use. > > The last batch of libxml deprecation warning fixes we

Re: Add XMLNamespaces to XMLElement

2025-07-01 Thread Jim Jones
rebased due to changes in 2e94721 -- Jim From 1c6a9f73de9119beb0e251e9457b4e25d2e99ee4 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Tue, 1 Jul 2025 09:37:09 +0200 Subject: [PATCH v9] Add XMLNamespaces option to XMLElement This patch adds support for the scoped option XMLNamespaces in the

Re: Bug with concurrent CREATE OR REPLACE (?)

2025-06-26 Thread Jim Jones
Hi On 26.06.25 17:08, Daniil Davydov wrote: > Hi, > I found that this command sequence leads to an error. : > > session 1: > begin; > create or replace function *some funcion*; > > session 2: > begin; > create or replace function *same function as above*; > > session 1: > commit; > > session 2: >

Re: display hot standby state in psql prompt

2025-06-26 Thread Jim Jones
On 26.06.25 02:52, Greg Sabino Mullane wrote: > On Wed, Jun 25, 2025 at 11:50 AM Jim Jones > wrote: > > Since I cannot get the value of transaction_read_only via > PQparameterStatus. > > > Hmmm... we can at least get default_transaction_read_only. As &

Re: display hot standby state in psql prompt

2025-06-25 Thread Jim Jones
Hi Greg On 25.06.25 17:17, Greg Sabino Mullane wrote: > Seems transaction_read_only might be a more useful thing to examine? > That's the side-effect, if you will, that people really care about > when in hot standby mode (and of course, we can get into TRO other ways). Good point. But wouldn't it

display hot standby state in psql prompt

2025-06-25 Thread Jim Jones
Hi, Some weeks ago we briefly discussed in the discord channel the possibility of introducing a psql prompt display option to identify if the connected database is in hot standby mode, which can be useful when using multiple hosts in the connection string. Right now, it's using the in_hot_standby

Re: libxml2 author overwhelmed with security requests

2025-06-19 Thread Jim Jones
On 19.06.25 03:41, Bruce Momjian wrote: > This blog post explains the serious problems the single libxml2 author > is having in maintaining the library: > > > https://socket.dev/blog/libxml2-maintainer-ends-embargoed-vulnerability-reports > > There are few learnings from this: > > * libx

Re: XMLDocument (SQL/XML X030)

2025-06-17 Thread Jim Jones
rebase -- Jim From 8315c8ab84932be19487d539d663d738dcdac465 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Tue, 17 Jun 2025 08:03:36 +0200 Subject: [PATCH v9] Add XMLDocument function (SQL/XML X030) This patch adds the SQL/XML X030 function XMLDocument. It returns an XML document from a given

Re: Add XMLNamespaces to XMLElement

2025-06-16 Thread Jim Jones
rebase -- Jim From 9c36deb99e600fe9a76fd1942081f3031bbd6216 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 16 Jun 2025 14:43:11 +0200 Subject: [PATCH v8] Add XMLNamespaces option to XMLElement This patch adds the scoped option XMLNamespaces to the XMLElement() function, as described in

Re: Feature: psql - display current search_path in prompt

2025-06-11 Thread Jim Jones
On 10.06.25 15:37, Florents Tselai wrote: > EDIT: There are test under `src/psql/t` , not sure though how much > coverage they have, > but most importantly how it’d look like for this case.  I took a look at these files, but I'm still unsure how to use them for automated prompt checking - I'm not

Re: Feature: psql - display current search_path in prompt

2025-06-10 Thread Jim Jones
Hi Florents On 10.06.25 13:36, Florents Tselai wrote: > > On Tue, Jun 10, 2025 at 2:08 AM Jelte Fennema-Nio > wrote: > > On Mon, 9 Jun 2025 at 17:54, Florents Tselai > mailto:florents.tse...@gmail.com>> wrote: > > Here’s a quick attempt that makes %S subst

Re: [PATCH] Add CANONICAL option to xmlserialize

2025-06-10 Thread Jim Jones
-- Jim From b892f597cbb8c88cdc9db60adb4f407b5bb6c22d Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Tue, 10 Jun 2025 10:46:24 +0200 Subject: [PATCH v18] Add xmlcanonicalize function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds the xmlcanonicalize function, which tran

Re: Add XMLNamespaces to XMLElement

2025-06-10 Thread Jim Jones
rebase -- Jim From c439fe867d360a822e3e8da99d12e2afe579bbaf Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Tue, 10 Jun 2025 08:39:25 +0200 Subject: [PATCH v7] Add XMLNamespaces option to XMLElement This patch adds the scoped option XMLNamespaces to XMLElement, as described in ISO/IEC 9075-14

Re: Prevent internal error at concurrent CREATE OR REPLACE FUNCTION

2025-05-26 Thread Jim Jones
Hi Yugo On 26.05.25 18:39, Yugo Nagata wrote: > I can see the error when two concurrent transactions issue > "alter function f() immutable". I might have missed something in my last tests... I could now reproduce the behaviour you mentioned. I've tested v2 and it works as described. CREATE OR R

Re: XMLSerialize: version and explicit XML declaration

2025-05-23 Thread Jim Jones
rebase Best, Jim From 2b684d290cf4d3690e98ca9719af615d137237c8 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 23 May 2025 08:59:51 +0200 Subject: [PATCH v3] Add XMLSerialize: version and explicit XML declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer

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

2025-05-22 Thread Jim Jones
On 22.05.25 17:00, Tom Lane wrote: > Yeah, after sleeping on it I fear that leaving xml_parse entirely > alone will just be a recipe for future copy-and-paste errors. That's exactly my concern as well. > The Assert solution seems like the way to go, approximately > > xmlNodePtrroo

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

2025-05-22 Thread Jim Jones
On 22.05.25 01:48, Tom Lane wrote: > I did look at that one too. I think it's fine, because we're > dealing with a newly-created document which can't have a root node > yet. (Reinforcing this, Valgrind sees no leaks after applying > my patch.) I considered adding an assertion that that call re

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

2025-05-21 Thread Jim Jones
7f0fadcacb1a10f30e/src/backend/utils/adt/xml.c#L1872 From c01b19d747bb4e33f6eb2f4641c268fe2b21 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 22 May 2025 00:55:37 +0200 Subject: [PATCH v2] fix leakage in xmlserialize indent --- src/backend/utils/adt/xml.c | 21 + 1 fil

Re: [PoC] XMLCast (SQL/XML X025)

2025-05-21 Thread Jim Jones
Hi Robert On 21.05.25 19:10, Robert Haas wrote: > Yeah. Just to be clear, I can't really think of committing a patch in > this area because I don't know the topic well enough. I can make some > general comments on what I see as issues with this patch but serious > review would really need to come

Re: Prevent internal error at concurrent CREATE OR REPLACE FUNCTION

2025-05-20 Thread Jim Jones
Hi! On 31.03.25 13:22, Yugo Nagata wrote: > On Mon, 31 Mar 2025 20:00:57 +0900 > Yugo Nagata wrote: > >> Hi, >> >> I found that multiple sessions concurrently execute CREATE OR REPLACE >> FUNCTION >> for a same function, the error "tuple concurrently updated" is raised. This >> is >> an interna

Re: [PATCH] Add CANONICAL option to xmlserialize

2025-04-07 Thread Jim Jones
v17 attached adds a (missing) reference to C14N 1.1 specification. JimFrom e5d1b74af7ff17eaa4ef35cdeaa8305fcad6ce6f Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 7 Apr 2025 14:00:16 +0200 Subject: [PATCH v17] Add xmlcanonicalize function This patch adds the xmlcanonicalize function, which

Re: [PATCH] Add CANONICAL option to xmlserialize

2025-04-04 Thread Jim Jones
mFrom 28f7c62de548468c8fb15ba95d4a68e2fdf0528e Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 21 Mar 2025 09:46:49 +0100 Subject: [PATCH v16] Add xmlcanonicalize function This patch adds the xmlcanonicalize function, which transforms an XML document into its canonical form according to the W3C Canonical XML Ve

Re: Reducing the log spam

2025-03-17 Thread Jim Jones
On 15.03.25 07:12, Laurenz Albe wrote: > ... and here is v7, improved in the spirit of > https://postgr.es/m/E132D362-A669-4606-AFE1-B45C9DFCC141%40yesql.se I just revisited this patch and v7 passes all tests from [1,2]. LGTM. Best regards, Jim [1] - https://www.postgresql.org/message-id/2055

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

2025-03-12 Thread Jim Jones
On 12.03.25 09:00, jian he wrote: >> 1) WARNING might be a better fit than NOTICE here. >> > but NOTICE, on_errror set_to_null is aligned with on_errror ignore. > >> I would still leave the extra messages from "log_verbosity verbose" as >> NOTICE though. What do you think? >> >> > When LOG_V

Re: [PoC] Add CANONICAL option to xmlserialize

2025-03-12 Thread Jim Jones
Hi On 12.03.25 08:21, newtglobal postgresql_contributors wrote: > The following review has been posted through the commitfest application: > make installcheck-world: tested, failed > Implements feature: tested, failed > Spec compliant: tested, failed > Documentation:te

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

2025-03-11 Thread Jim Jones
Hi Jian On 07.03.25 04:48, jian he wrote: > hi. > rebase only. I revisited this patch today. It applies and builds cleanly, and it works as expected. Some tests and minor comments: 1) WARNING might be a better fit than NOTICE here. postgres=# \pset null NULL Null display is "NULL". post

Re: Reducing the log spam

2025-03-11 Thread Jim Jones
On 11.03.25 10:46, Laurenz Albe wrote: > Thanks for the thorough test! > >> There are a few issues though ... >> >> 1) Invalid codes aren't rejected. Is there any way to validate them? >> >> postgres=# SET log_suppress_errcodes TO '0foo1'; SHOW log_suppress_errcodes; >> SET >>  log_suppress_errco

Re: Reducing the log spam

2025-03-07 Thread Jim Jones
Hi Laurenz On 18.06.24 18:49, Laurenz Albe wrote: > I have attached a new version that leaves the parameter empty by default. I've tested this patch and for the most part it works as intended. For convenience, I wrote a small function to simulate the exceptions using a given errcode: CREATE OR

Re: pg_dump, pg_dumpall, pg_restore: Add --no-policies option

2025-03-07 Thread Jim Jones
Hi On 27.02.25 15:37, vignesh C wrote: > Here is a rebased version along with the test failure fixes, please > accept the change if you are ok with it. Patch LGTM. +1 It applies cleanly and works as described: == pg_dump == $ /usr/local/postgres-dev/bin/pg_dump db > dump.out $ grep "POLICY"

Re: Commit fest 2025-03

2025-03-05 Thread Jim Jones
Hi Vignesh On 05.03.25 10:22, vignesh C wrote: > The following "Ready for committer" patches needs rebase > --- > Truncate logs by max_log_size - Kirill Gavrilov > > Patch owners, please provide a rebased version to prepare it for > reviewers and committers. Is

Re: Logging which local address was connected to in log_line_prefix

2025-03-02 Thread Jim Jones
On 27.02.25 14:54, Greg Sabino Mullane wrote: > Great question. I think "supposed to" is a bit of a stretch, but I > presume it's the difference between a client connecting and using its > connection information versus an already existing backend process, > which is always going to be "local". >

Re: Missing [NO] INDENT flag in XMLSerialize backward parsing

2025-02-21 Thread Jim Jones
On 21.02.25 12:46, Michael Paquier wrote: > One way would be to generate by yourself dumps from an older version > by yourself, as documented by src/bin/pg_upgrade/TESTING, part DETAILS > (the part about USE_MODULE_DB=1 is very important). Then you can > reuse the SQL files by specifying an old

Re: Missing [NO] INDENT flag in XMLSerialize backward parsing

2025-02-21 Thread Jim Jones
Hi Michael & Andrew On 21.02.25 11:46, Andrew Dunstan wrote: >> On Feb 21, 2025, at 4:55 AM, Michael Paquier wrote: >> >> On Fri, Feb 21, 2025 at 04:36:07AM -0500, Andrew Dunstan wrote: >>> The fix has broken cross version upgrade test. Maybe we need to filter out >>> NO INDENT in releases prior

Re: XMLSerialize: version and explicit XML declaration

2025-02-21 Thread Jim Jones
On 30.09.24 10:08, Jim Jones wrote: > On 25.09.24 18:02, Tom Lane wrote: >> AFAICS, all we do with an embedded XML version string is pass it to >> libxml2's xmlNewDoc(), which is the authority on whether it means >> anything. I'd be inclined to do the same here. &

Missing [NO] INDENT flag in XMLSerialize backward parsing

2025-02-20 Thread Jim Jones
CT XMLSERIALIZE(DOCUMENT '42'::xml AS text NO INDENT) AS "xmlserialize" Regression tests were updated accordingly. Best regards, Jim From ff1b261ef74ae381eb946ec675e0f116c728cee0 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 20 Feb 2025 14:08:04 +0100 Subject: [PATCH v1] Fix m

Re: Add XMLNamespaces to XMLElement

2025-02-20 Thread Jim Jones
https://www.postgresql.org/message-id/CAFj8pRC24FEBNfTUrDgAK8f2nqDVvzWCuq%3DR%3DT19nUjL9GuLBA%40mail.gmail.com From 93ea0e1b07763bca7ffb1d4cf88cc380640604cb Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 20 Feb 2025 09:58:34 +0100 Subject: [PATCH v6] Add XMLNamespaces option to XMLElement This patch add

Re: [PATCH] Add CANONICAL option to xmlserialize

2025-02-17 Thread Jim Jones
On 12.09.24 12:56, Jim Jones wrote: > v14 attached adds the function xmlcanonicalize, as suggested. rebase. Best regards, Jim From 2121e54145eae40c8a6c172038ca3a4d07f9b78a Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 17 Feb 2025 12:05:34 +0100 Subject: [PATCH v15] Add xmlcanonical

Re: Truncate logs by max_log_size

2025-02-03 Thread Jim Jones
Hi Kirill On 31.01.25 11:46, Kirill Gavrilov wrote: > Sorry for the long silence.  I fixed the indentation and a trailing > whitespace. Should look fine now. The patch applies cleanly, the documentation is clear, and all tests pass. It is possible to change this new parameter session-wise, whic

Re: XMLDocument (SQL/XML X030)

2025-01-28 Thread Jim Jones
Hi Robert On 28.01.25 05:54, Robert Treat wrote: > Was playing around with the patch and was thinking about this wording: > "The xmldocument function returns the input argument > unchanged... and is provided for compatibility." > > When I run an example similar to the db2 example you gave earlier

Re: Add XMLNamespaces to XMLElement

2025-01-27 Thread Jim Jones
On 21.01.25 11:48, Umar Hayat wrote: > For XMLAttributes attribute it should have ColumnRef/Expr because > that's the data/content we want to generate. But namespaces and xml > tags, IMO they should be considered as part of the structure/schema of > XML. Allowing namespaces (default or otherwise)

Re: XMLDocument (SQL/XML X030)

2025-01-26 Thread Jim Jones
Hi Chapman & Pavel On 25.01.25 16:05, Pavel Stehule wrote: > > > so 25. 1. 2025 v 15:10 odesílatel Chapman Flack napsal: > > On 01/25/25 02:16, Pavel Stehule wrote: > > because the function does nothing, then it is useless to convert > input to > > XML and force detosting > >

Re: XMLDocument (SQL/XML X030)

2025-01-25 Thread Jim Jones
On 25.01.25 11:50, Pavel Stehule wrote: > you still forces detoasting (inside PG_GETARG_XML_P) Ah, ok .. I overlooked it. You meant _DATUM instead of _XML_P Fixed in v8. Thanks! Best, Jim From 43cb30a6348a2e7b9911f8bb82e1ec8359b668f0 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri,

Re: XMLDocument (SQL/XML X030)

2025-01-25 Thread Jim Jones
On 25.01.25 08:16, Pavel Stehule wrote: > because the function does nothing, then it is useless to convert input > to XML and force detosting Right. Fixed in v7 attached. Thanks Best, Jim From f4dc90994fc42879c7ab522bd9a03032be9a936c Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri,

Re: XMLDocument (SQL/XML X030)

2025-01-24 Thread Jim Jones
necessary. v6 attached. Thanks. Best regards, JimFrom 44ca7b7664d7fe49b95ced79c51d1b5f55741b81 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 24 Jan 2025 20:51:00 +0100 Subject: [PATCH v6] Add XMLDocument function (SQL/XML X030) This patch adds the SQL/XML X030 function XMLDocument. It

Re: XMLDocument (SQL/XML X030)

2025-01-24 Thread Jim Jones
non-null value of the XML type already has that structure, making any additional processing by this function unnecessary. --- Is it ok like this? Best regards, Jim From 8b3b5b451f0a2fd9c70ce8c96b46f0eda4be8be3 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 24 Jan 2025 20:51:00 +0

Re: XMLDocument (SQL/XML X030)

2025-01-24 Thread Jim Jones
On 24.01.25 13:48, Pavel Stehule wrote: > Lot of users use XML functions without XMLDOCUMENT now. The doc should to > help with a reply to question where and when I need (I can) use this > function. This should > be in context of Postgres where every XML expr returns XML value, so > sentence > cr

Re: XMLDocument (SQL/XML X030)

2025-01-24 Thread Jim Jones
On 24.01.25 12:31, Pavel Stehule wrote: > I don't know what it means - `function returns a document node` in the > context of Postgres implementation of XML. > I miss the information so it returns an input argument without > changing anything, because in a system, where XML expression > holds a c

Re: XMLDocument (SQL/XML X030)

2025-01-24 Thread Jim Jones
Hi On 24.01.25 07:28, Pavel Stehule wrote: > I think documentation should be strongly enhanced. This is probably > the hardest part of this patch - explain well what this function does > and what it doesn't. You mean something like this? Or perhaps something more technical? The xmldocument funct

Re: XMLDocument (SQL/XML X030)

2025-01-23 Thread Jim Jones
429acf8c4a999f457ec85f Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 23 Jan 2025 15:38:07 +0100 Subject: [PATCH v4] Add XMLDocument function (SQL/XML X030) This patch adds the SQL/XML X030 function XMLDocument. It returns an XML document from a given XML expression. An XML document node can

Re: XMLDocument (SQL/XML X030)

2025-01-22 Thread Jim Jones
Hi Chapman & Robert Many thanks for the input On 22.01.25 22:35, Chapman Flack wrote: > On 01/22/25 13:41, Robert Treat wrote: >> So even if we are following the spec (which I think technically we may >> not be), > There are definite ways in which we're not following the SQL/XML spec, > which we

Re: XMLDocument (SQL/XML X030)

2025-01-21 Thread Jim Jones
On 21.01.25 23:45, Robert Treat wrote: > Is there some concrete use case you have seen that this would help > with? Not objecting to adding it, but you've mentioned this migration > idea twice but it seems to me this doesn't conform with existing > implementations, and I don't see much benefit in

Re: XMLDocument (SQL/XML X030)

2025-01-21 Thread Jim Jones
hing :). Thank you again for your help in interpreting the SQL/XML standard. Much appreciated! Best regards, Jim From 200cb507fb694179fd3f452a5e81017d76fa7bb1 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Tue, 21 Jan 2025 11:45:34 +0100 Subject: [PATCH v3] Add XMLDocument function (SQL/XML X030)

Re: XMLDocument (SQL/XML X030)

2025-01-20 Thread Jim Jones
Hi Chap, Thanks for the thorough explanation!  On 20.01.25 20:09, Chapman Flack wrote: >> PostgreSQL does not support the RETURNING SEQUENCE or RETURNING CONTENT >> clauses explicitly. Instead, it implicitly uses RETURNING CONTENT[2] in >> functions that require it. Since RETURNING CONTENT implie

Re: Add XMLNamespaces to XMLElement

2025-01-20 Thread Jim Jones
- > > > (2 rows) What are your concerns about supporting ColumnRef for the URI's? It is currently supported by XMLAttributes: CREATE TABLE t AS SELECT 'http://x.y' AS uri; SELECT xmlelement(NAME el, xmlattributes("uri" AS att)) FROM t;

Re: XMLDocument (SQL/XML X030)

2025-01-20 Thread Jim Jones
On 16.01.25 08:21, Jim Jones wrote: > On 16.01.25 07:11, Pavel Stehule wrote: >> It is better. > v2 attached updates the documentation. >> My note was related to a very different description of this >> functionality in DB2. So if you propose this function for better &g

Re: Add XMLNamespaces to XMLElement

2025-01-19 Thread Jim Jones
base due to gram.y changes introduced in 80feb72 -- Jim From d394083020dfca69f96f459d4852f77614934603 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Sun, 19 Jan 2025 10:27:07 +0100 Subject: [PATCH v4] Add XMLNamespaces option to XMLElement This patch adds the scoped option XMLNamespaces to XMLElemen

Re: XMLDocument (SQL/XML X030)

2025-01-15 Thread Jim Jones
9f499d8fda276df08739babe8360c0bee85c Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 16 Jan 2025 07:55:21 +0100 Subject: [PATCH v2] Add XMLDocument function (SQL/XML X030) This patch adds the SQL/XML X030 function XMLDocument. It returns an XML document from a given XML expression. An XML docum

Re: XMLDocument (SQL/XML X030)

2025-01-15 Thread Jim Jones
Hi Pavel On 14.01.25 09:14, Pavel Stehule wrote: > I did some research and the design of this document is different > > 1. Oracle doesn't support this > 2. DB2 has different implementations for z/OS (variadic) and for unix > (nonvariadic) > 3. looks so db2 allows some concatenation of xml content

Re: Add XMLNamespaces to XMLElement

2025-01-15 Thread Jim Jones
Hi Umar, Hi Pavel, On 26.12.24 14:46, Jim Jones wrote: > The idea of NO DEFAULT is pretty much to free an element (and its > children) from a previous DEFAULT in the same scope. > > SELECT >   xmlserialize(DOCUMENT >     xmlelement(NAME "root", >   xmlna

Re: [PoC] XMLCast (SQL/XML X025)

2024-12-30 Thread Jim Jones
f38c714220be8f2f4f939bedc46d8630ec5cd6dc Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Mon, 30 Dec 2024 09:57:05 +0100 Subject: [PATCH v5] Add XMLCast function (SQL/XML X025) This implements the SQL/XML function xmlcast, which enables conversions between SQL data types and the XML data type. XMLCAST

Re: Add XMLNamespaces to XMLElement

2024-12-26 Thread Jim Jones
like DEFAULT NULL only in the root element would make things clearer? The SQL/XML spec doesn't say anything specific about it, but DB2 had the same thought[1]. For reference, here are the regress tests[2] of this patch tested with the DB2 implementation. > On Sat, 21 Dec 2024 at 14:57, Pavel

Add XMLNamespaces to XMLElement

2024-12-20 Thread Jim Jones
rmXmlExpr() it seemed convenient to use the same parameters to store the prefixes and URIs as in XMLAttributes (arg_names and named_args), but I am still not so sure it is the right approach. Is there perhaps a better way? Any thoughts? Feedback welcome! Best, Jim From 8dee3772be0d89b3d49eff17344

Re: XMLDocument (SQL/XML X030)

2024-12-10 Thread Jim Jones
Hi Andrew On 10.12.24 14:59, Andrew Dunstan wrote: > LGTM at a first glance. > > > Please add this to the next CommitFest if you haven't done already. Thanks! This is the CF entry: https://commitfest.postgresql.org/51/5431/ Best, Jim

Re: XMLDocument (SQL/XML X030)

2024-12-09 Thread Jim Jones
On 04.12.24 17:18, Jim Jones wrote: > I'd like to propose the implementation of XMLDocument (SQL/XML X030). > It basically returns an XML document from a given XML expression, e.g. > > SELECT >   xmldocument( >     xmlelement(NAME foo, >   xmlattributes(42 AS att), &

XMLDocument (SQL/XML X030)

2024-12-04 Thread Jim Jones
Hi, I'd like to propose the implementation of XMLDocument (SQL/XML X030).It basically returns an XML document from a given XML expression, e.g. SELECT   xmldocument(     xmlelement(NAME foo,   xmlattributes(42 AS att),   xmlelement(NAME bar,     xmlconcat('va', 'lue'))     )   );

Re: Truncate logs by max_log_size

2024-12-02 Thread Jim Jones
On 29.11.24 21:57, Kirill Gavrilov wrote: > Same thing applies to log_parameter_max_length, for example. > > postgres=# set log_parameter_max_length = '1foo'; > ERROR:  invalid value for parameter "log_parameter_max_length": "1foo" > HINT:  Valid units for this parameter are "B", "kB", "MB", "GB

Re: Truncate logs by max_log_size

2024-11-29 Thread Jim Jones
On 29.11.24 12:05, Kirill Gavrilov wrote: >   Setting max_log_size to 0 already disables truncation. >   I changed guc units to bytes, just to make it more human-friendly. > Did some refactoring and fixed all warnings. Set default value in > postgresql.conf. Nice. The patch applies cleanly and

Re: Truncate logs by max_log_size

2024-11-28 Thread Jim Jones
On 28.11.24 20:20, Kirill Gavrilov wrote: >   Here is version 3 of this patch. I found another place where this > setting can be applied.  >   Also added some documentation and specified that this setting > truncates queries by size in bytes. Thanks. It is now possible to change the parameter u

Re: Truncate logs by max_log_size

2024-11-28 Thread Jim Jones
On 25.11.24 17:52, Kirill Reshke wrote: > Hello! Please deliver the most recent patch version and fix the issues > Jim identified [0] as the current commitfest draws to a close. > Do not forget to include both parts of this patch (This was actually > developed off-list, and we are now using this

Re: PoC: Simplify recovery after dropping a table by LOGGING the restore LSN

2024-11-26 Thread Jim Jones
Hi Andrey, Nikolay, and Kirk On 08.11.24 04:46, Kirk Wolak wrote: > Hackers, >   The concept was driven by an all too common support request.  A user > accidentally dropped the wrong table.  (this could also be applied to > dropping a database, etc). > >   If we had the LSN before the drop, this w

Re: Logging which local address was connected to in log_line_prefix

2024-11-18 Thread Jim Jones
Hi Greg On 11.07.24 18:09, Greg Sabino Mullane wrote: > Thanks for the review. Please find attached a new version with proper > tabs and indenting. > > Cheers, > Greg > I'm testing this new log prefix and I'm wondering whether the following behaviour is expected. The value of '%L' is different in

Re: [PoC] XMLCast (SQL/XML X025)

2024-11-12 Thread Jim Jones
On 12.11.24 15:59, Robert Haas wrote: > Those are good things to check, but we also need to consider how it > interacts with features PostgreSQL itself already has. I totally agree. It just didn't occur to me to check how XMLTABLE() deals with these conversions :) > In particular, > I'm conce

Re: [PoC] XMLCast (SQL/XML X025)

2024-11-11 Thread Jim Jones
Hi Robert Thanks for taking a look at it. On 11.11.24 19:15, Robert Haas wrote: > Hmm, this patch has gotten no responses for 4 months. That's kind of > unfortunate. Sadly, there's not a whole lot that I can do to better > the situation, because I know very little either about XML-related > standa

Re: [PoC] XMLCast (SQL/XML X025)

2024-11-10 Thread Jim Jones
rebase. -- Jim From a43036de62a69c00d0c5c4469af02c8ded438530 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Sun, 10 Nov 2024 16:13:18 +0100 Subject: [PATCH v4] Add XMLCast function (SQL/XML X025) This function implements the SQL/XML function xmlcast, which enables conversions between SQL data

Re: Psql meta-command conninfo+

2024-10-02 Thread Jim Jones
On 02.10.24 06:48, Hunaid Sohail wrote: > Should I revert to the v34 docs for Session User, or is it fine as is? What I tried to say is that the current description is a bit vague --- specially "Authenticated User". > Authenticated User: The name of the user returned by PQuser() > Session User

Re: Truncate logs by max_log_size

2024-10-01 Thread Jim Jones
On 01.10.24 17:46, Kirill Gavrilov wrote: >  My apologies, attached patch should work on master branch. Nice. I tested the feature and it does what it is intended to. postgres=# SHOW max_log_size;  max_log_size --  10 (1 row) postgres=# INSERT INTO t VALUES (1,2,3,4,5,6,7,8,9,0);

Re: Truncate logs by max_log_size

2024-10-01 Thread Jim Jones
On 27.09.24 12:36, Andrey M. Borodin wrote: > Consider max_log_size = 10Mb. The perspective might look very different. > It’s not about WHERE anymore. It's a guard against heavy abuse. > > The feature looks very important for me. I have the same opinion. As a fail safe it sounds very useful to m

Re: Psql meta-command conninfo+

2024-09-30 Thread Jim Jones
On 01.10.24 06:27, Hunaid Sohail wrote: > There are two users in the conninfo+: 'session' and 'authenticated'. > Both are documented. Right. I meant "Session User" > Authenticated User: The name of the user returned by PQuser() > Session User: The session user's name. Thanks -- Jim

Re: Psql meta-command conninfo+

2024-09-30 Thread Jim Jones
Hi On 26.09.24 09:15, Hunaid Sohail wrote: > This patch renames "Current User" to "Authenticated User" as suggested > by me in my last email. I have also updated the documentation accordingly. Could you perhaps in the documentation elaborate a bit more on the difference between "Current User" and

Re: XMLSerialize: version and explicit XML declaration

2024-09-30 Thread Jim Jones
ue had no XML declaration and INCLUDING XMLDECLARATION was not used. SELECT   xmlserialize(     CONTENT '42'::xml AS text     VERSION '');    xmlserialize --  42 (1 row) Best, Jim From 8bcb91f8b163a9efda1de33ebb7538767c860ad9 Mon Sep 17 00:00:00 2001 From: Jim Jones

XMLSerialize: version and explicit XML declaration

2024-09-25 Thread Jim Jones
Hi, I'm working on the flags VERSION (X076), INCLUDING XMLDECLARATION, and EXCLUDING XMLDECLARATION (X078) for XMLSerialize, and I have a question for SQL/XML experts on the list. Is there any validation mechanism for VERSION ? The SQL/XML spec says "The immediately contained in shall be '1.0'

Re: Psql meta-command conninfo+

2024-09-16 Thread Jim Jones
On 16.09.24 08:51, Hunaid Sohail wrote: > I have attached a new patch that now prints all info in tabular format > for \conninfo+. I have also made the table output dynamic, so if the > connection uses SSL, the columns in the table will expand accordingly. > It looks much cleaner now. > I have a

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

2024-09-16 Thread Jim Jones
On 12.09.24 12:13, jian he wrote: > please check the attached file. v4 applies cleanly, it works as expected, and all tests pass. postgres=# \pset null '(NULL)' Null display is "(NULL)". postgres=# CREATE TEMPORARY TABLE t2 (a int, b int); CREATE TABLE postgres=# COPY t2 (a,b) FROM STDIN WIT

Re: Psql meta-command conninfo+

2024-09-13 Thread Jim Jones
On 13.09.24 06:49, Hunaid Sohail wrote: > > $ bin/psql --port=5430 postgres > psql (18devel) > Type "help" for help. > > postgres=# \conninfo+ > You are connected to database "postgres" as user "hunaid" via socket > in "/tmp" at port "5430". >                                                   Co

Re: Psql meta-command conninfo+

2024-09-12 Thread Jim Jones
On 11.09.24 13:35, Hunaid Sohail wrote: > Hi Jim, > > On Wed, Sep 11, 2024 at 3:03 PM Jim Jones > wrote: > > Thanks for working on this. > > Any particular reason for the design change? In v28 it returned a > table > with a single row and multi

Re: [PATCH] Add CANONICAL option to xmlserialize

2024-09-12 Thread Jim Jones
hen the SQL committee moves in this direction. v14 attached adds the function xmlcanonicalize, as suggested. Thanks -- Jim From 08850417c9f0e1504a5e0cfbbd815c3a7aaaf7e8 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 12 Sep 2024 12:23:34 +0200 Subject: [PATCH v14] Add xmlcanonicalize funct

Re: Psql meta-command conninfo+

2024-09-11 Thread Jim Jones
On 11.09.24 10:16, Hunaid Sohail wrote: I have made the requested changes. Now output is returned in tabular form. Indentation/whitespace issues are fixed. $bin/psql --port=5430 postgres postgres=# \conninfo+ You are connected to database "postgres" as user "hunaid" via socket in "/tmp" at p

Re: Psql meta-command conninfo+

2024-09-10 Thread Jim Jones
On 10.09.24 06:32, Hunaid Sohail wrote: > > I have attached a rebased patch. Thanks. Is \conninfo+ no longer supposed to return the results in tabular form? At least it wasn't the case till v28. $ /usr/local/postgres-dev/bin/psql -d postgres -h 0 -c "\conninfo+" You are connected to database

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

2024-09-09 Thread Jim Jones
Hi there On 26.08.24 02:00, jian he wrote: > hi all. > patch updated. > simplified the code a lot. > > idea is same: > COPY t_on_error_null FROM STDIN WITH (on_error set_to_null); > > If the STDIN number of columns is the same as the target table, then > InputFunctionCallSafe > call failure will

Re: Psql meta-command conninfo+

2024-09-09 Thread Jim Jones
Hi Hunaid On 02.08.24 14:11, Hunaid Sohail wrote: > > I have also edited the documentation and added it to the patch. Please > let me know if any changes are required. > I just wanted to review this patch again but v30 does not apply === Applying patches on top of PostgreSQL commit ID d8df7ac5c

Re: [PoC] Add CANONICAL option to xmlserialize

2024-09-08 Thread Jim Jones
Hi Oliver On 08.09.24 15:56, Oliver Ford wrote: > Whoops, yes all tests and docs pass! Thanks for the review! Best, Jim

  1   2   3   >