SQL JSON compliance

2022-04-13 Thread Andrew Dunstan
          JSON_QUERY       T829           JSON_QUERY: array wrapper options       T830           Enforcing unique keys in SQL/JSON constructor functions       T838           JSON_TABLE: PLAN DEFAULT clause If there's no objection I'll make it so. cheers andrew -- Andrew Dunstan

Re: convert libpq uri-regress tests to tap test

2022-04-16 Thread Andrew Dunstan
te for now. Once we get to building with meson a lot of this ugliness should go away. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: pgsql: Add TAP test for archive_cleanup_command and recovery_end_comman

2022-04-17 Thread Andrew Dunstan
y think it's Cluster.pm's business to deal with that. It takes an install path as given either explicitly or implicitly. It shouldn't be too hard to get Makefile.global to install valgrind wrappers into the tmp_install/bin directory. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Postgres perl module namespace

2022-04-18 Thread Andrew Dunstan
uld argue that this should just >> straight up be reverted until that aspect is addressed. It's a >> maintenance nightmare. > I do feel PostgreSQL has been over-eager to do cosmetic refactoring. For me, > this particular one has been sort-of-tolerable. There were reasons beyond being purely cosmetic for all the changes. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: pgsql: Add TAP test for archive_cleanup_command and recovery_end_comman

2022-04-18 Thread Andrew Dunstan
On 2022-04-17 Su 19:49, Michael Paquier wrote: > On Sun, Apr 17, 2022 at 10:56:08AM -0400, Andrew Dunstan wrote: >> I don't really think it's Cluster.pm's business to deal with that. It >> takes an install path as given either explicitly or implicitly. >>

Re: Postgres perl module namespace

2022-04-18 Thread Andrew Dunstan
On 2022-04-18 Mo 13:43, Tom Lane wrote: > Andrew Dunstan writes: >> On 2022-04-18 Mo 11:52, Noah Misch wrote: >>> On Mon, Apr 18, 2022 at 07:15:30AM -0700, Andres Freund wrote: >>>> I just, again, tried to backport a test as part of a bugfix. The >>>>

Re: Postgres perl module namespace

2022-04-18 Thread Andrew Dunstan
On 2022-04-18 Mo 14:07, Tom Lane wrote: > Andrew Dunstan writes: >> No, I think we could probably just port the whole of src/test/PostreSQL >> back if required, and have it live alongside the old modules. Each TAP >> test is a separate miracle - see comments elsewhere abo

Re: Postgres perl module namespace

2022-04-18 Thread Andrew Dunstan
On 2022-04-18 Mo 15:46, Mark Dilger wrote: > >> On Apr 18, 2022, at 10:59 AM, Andrew Dunstan wrote: >> >> No, I think we could probably just port the whole of src/test/PostreSQL >> back if required, and have it live alongside the old modules. Each TAP >>

Re: Postgres perl module namespace

2022-04-19 Thread Andrew Dunstan
On 2022-04-18 Mo 14:07, Tom Lane wrote: > Andrew Dunstan writes: >> No, I think we could probably just port the whole of src/test/PostreSQL >> back if required, and have it live alongside the old modules. Each TAP >> test is a separate miracle - see comments elsewhere about

Re: Postgres perl module namespace

2022-04-19 Thread Andrew Dunstan
On 2022-04-19 Tu 11:36, Andrew Dunstan wrote: > On 2022-04-18 Mo 14:07, Tom Lane wrote: >> Andrew Dunstan writes: >>> No, I think we could probably just port the whole of src/test/PostreSQL >>> back if required, and have it live alongside the old modules. Each TAP >

Re: Postgres perl module namespace

2022-04-19 Thread Andrew Dunstan
On 2022-04-19 Tu 18:39, Michael Paquier wrote: > On Tue, Apr 19, 2022 at 04:06:28PM -0400, Andrew Dunstan wrote: >> Here's a version with a fixed third patch that corrects a file misnaming >> and fixes the export issue referred to above. Passes my testing so far. > Wow. T

Re: Postgres perl module namespace

2022-04-20 Thread Andrew Dunstan
On 2022-04-19 Tu 20:30, Michael Paquier wrote: > On Tue, Apr 19, 2022 at 07:24:58PM -0400, Andrew Dunstan wrote: >> On 2022-04-19 Tu 18:39, Michael Paquier wrote: >>> +*generate_ascii_string = *TestLib::generate_ascii_string; >>> +*slurp_dir = *TestLib::slurp_dir;

Re: Postgres perl module namespace

2022-04-21 Thread Andrew Dunstan
On 2022-04-21 Th 00:11, Michael Paquier wrote: > On Wed, Apr 20, 2022 at 03:56:17PM -0400, Andrew Dunstan wrote: >> Basically I propose just to remove any mention of the Testlib items and >> get_free_port from the export and alias lists for versions where they >> are absent.

Re: pgsql: Allow db.schema.table patterns, but complain about random garbag

2022-04-24 Thread Andrew Dunstan
r, albeit one that we didn't know about much less want or document. Still, we been building with mingw compilers for about 20 years and haven't hit this before so far as we know, so maybe not. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: pgsql: Allow db.schema.table patterns, but complain about random garbag

2022-04-24 Thread Andrew Dunstan
On 2022-04-24 Su 14:19, Noah Misch wrote: > On Sun, Apr 24, 2022 at 01:09:08PM -0400, Andrew Dunstan wrote: >> On 2022-04-22 Fr 22:59, Noah Misch wrote: >>> The MinGW gcc crt*.o files do shell-glob expansion on the arguments before >>> entering main(). See https:

Re: [RFC] building postgres with meson -v8

2022-04-24 Thread Andrew Dunstan
ayu 3.5.3 > chimaera 3.5.3 > chipmunk 3.5.3 > grison3.5.3 > mussurana 3.5.3 > tadarida 3.5.3 > urocryon 3.5.3 > > Presumably that only tells you about the animals currently building with python. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: json_object returning jsonb reuslt different from returning json, returning text

2022-04-25 Thread Andrew Dunstan
or the report. I don't think there's anything special about '0' except that it sorts first. There appears to be a bug in the uniquefying code where the first item(s) have nulls. The attached appears to fix it. Please test and see if you can break it. cheers andrew

Re: pgsql: Allow db.schema.table patterns, but complain about random garbag

2022-04-25 Thread Andrew Dunstan
On 2022-04-24 Su 15:37, Andrew Dunstan wrote: > On 2022-04-24 Su 14:19, Noah Misch wrote: > >> Even if MinGW has >> some magic to make that work, I suspect we'll want a non-header home. >> Perhaps >> src/common/exec.c? It's best to keep this symbol out

Re: Allow ALTER SYSTEM SET on unrecognized custom GUCs

2023-10-23 Thread Andrew Dunstan
so that it follows the same rules and throws the same errors for invalid cases. There's a chunk of AlterSystemSetConfigFile that now needs indenting one more tab stop, but I didn't do that yet for ease of review. Thoughts? Haven't read the patch but in principle I agree. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Casual Meson fixups

2023-10-23 Thread Andrew Dunstan
too. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Query execution in Perl TAP tests needs work

2023-10-24 Thread Andrew Dunstan
found. I guess the next step would be for someone to locate some of the hotspots in the TAP tests and try to convert them to using persistent connections with this gadget or similar and see how much faster we can make them. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.c

Re: Add trailing commas to enum definitions

2023-10-24 Thread Andrew Dunstan
point. I had been leaning towards "this is unnecessary churn", but with that idea I'm now +1. +1. It's a fairly common practice in Perl code, too, and I often do it for exactly this reason. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: More new SQL/JSON item methods

2023-10-24 Thread Andrew Dunstan
k once these methods get in, we can have a follow-up patch reorganizing all of these. I think it would be better to organize things how we want them before adding in more stuff. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com

Re: run pgindent on a regular basis / scripted manner

2023-10-24 Thread Andrew Dunstan
f topic, but apropos your message, maybe we should recommend a standard git commit template. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: run pgindent on a regular basis / scripted manner

2023-10-24 Thread Andrew Dunstan
e you. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: trying again to get incremental backup

2023-10-25 Thread Andrew Dunstan
ntal, although that would be a bit sad. However, I don't think we can make the RD parser suitable for incremental parsing - there's too much state involved in the call stack. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com json_incremental_parser-2023-09-25.patch.gz Description: application/gzip

Re: trying again to get incremental backup

2023-10-25 Thread Andrew Dunstan
On 2023-10-25 We 09:05, Robert Haas wrote: On Wed, Oct 25, 2023 at 7:54 AM Andrew Dunstan wrote: Robert asked me to work on this quite some time ago, and most of this work was done last year. Here's my WIP for an incremental JSON parser. It works and passes all the usual json/b test

Re: trying again to get incremental backup

2023-10-25 Thread Andrew Dunstan
On 2023-10-25 We 11:24, Robert Haas wrote: On Wed, Oct 25, 2023 at 10:33 AM Andrew Dunstan wrote: I'm not too worried about the maintenance burden. That said, I agree that JSON might not be the best format for backup manifests, but maybe that ship has sailed. I think it's a d

Re: trying again to get incremental backup

2023-10-26 Thread Andrew Dunstan
On 2023-10-25 We 15:19, Robert Haas wrote: On Wed, Oct 25, 2023 at 3:17 PM Andrew Dunstan wrote: OK, I'll go with that. It will actually be a bit less invasive than the patch I posted. Why's that? Because we won't be removing the RD parser. cheers andrew -- Andrew Dun

Re: run pgindent on a regular basis / scripted manner

2023-10-27 Thread Andrew Dunstan
-commit hook: a check for catalog updates, a check for new typedefs, and an indent check. Could you share your configuration ? Could we provide more helper and integration to help produce consistent code ? Sure. pre-commit hook file attached. I'm sure this could be improved on. cheers

Re: run pgindent on a regular basis / scripted manner

2023-10-28 Thread Andrew Dunstan
On 2023-08-12 Sa 11:57, Andrew Dunstan wrote: On 2023-08-11 Fr 19:17, Tom Lane wrote: Peter Geoghegan writes: I'm starting to have doubts about this policy. There have now been quite a few follow-up "fixes" to indentation issues that koel complained about. None of these f

Re: run pgindent on a regular basis / scripted manner

2023-10-29 Thread Andrew Dunstan
On 2023-10-28 Sa 12:09, Tom Lane wrote: Andrew Dunstan writes: Based on recent experience, where a lot koel's recent complaints seem to be about comments, I'd like to suggest a modest adjustment. First, we should provide a mode of pgindent that doesn't reflow comments. pg_b

Re: More new SQL/JSON item methods

2023-11-01 Thread Andrew Dunstan
On 2023-11-01 We 03:00, Jeevan Chalke wrote: Hello, On Tue, Oct 24, 2023 at 6:41 PM Andrew Dunstan wrote: On 2023-10-19 Th 02:06, Jeevan Chalke wrote: Thanks, Peter for the comments. On Fri, Oct 6, 2023 at 5:13 PM Peter Eisentraut wrote: On 29.08.23 09:05

Re: Regression on pg_restore to 16.0: DOMAIN not available to SQL function

2023-11-03 Thread Andrew Dunstan
ould use pg_dump from the version you want to restore into. Dumps from earlier versions might work in some cases, but there is no guarantee. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: apply pragma system_header to python headers

2023-11-06 Thread Andrew Dunstan
regularly sent feedback to Python to fix their header files, but this is getting old, and we have an easier solution now.) WFM cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: apply pragma system_header to python headers

2023-11-06 Thread Andrew Dunstan
27;re seeing. e.g. "GCC diagnostic ignored \"-Wdeclaration-after-statement\"" cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Remove MSVC scripts from the tree

2023-11-08 Thread Andrew Dunstan
ith semicolons added and the backslashes in the regular expressions moved around.  I think we could use something like that for all platforms now. I think it's alright, but please don't use literal tabs, use \t, even in a character class. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Failure during Building Postgres in Windows with Meson

2023-11-09 Thread Andrew Dunstan
a bug in the Meson repository which also mentions the last known working version. I wonder what versions of Meson we use in the build farm. fairywren / drongo have 1.0.1 cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: pg_basebackup check vs Windows file path limits

2023-11-11 Thread Andrew Dunstan
Hi, Alexander On 2023-11-11 Sa 08:00, Alexander Lakhin wrote: Hello Andrew, 08.07.2023 18:52, Andrew Dunstan wrote: Since this test is passing on HEAD which has slightly shorter paths, I'm wondering if we should change this: rename("$pgdata/pg_replslot", "

Re: pg_basebackup check vs Windows file path limits

2023-11-12 Thread Andrew Dunstan
On 2023-11-11 Sa 12:00, Alexander Lakhin wrote: 11.11.2023 18:18, Andrew Dunstan wrote: Hmm, maybe we should be using File::Copy::move() instead of rename(). The docco for that says:     If possible, move() will simply rename the file. Otherwise, it     copies the file to the new

Re: pg_basebackup check vs Windows file path limits

2023-11-13 Thread Andrew Dunstan
On 2023-11-11 Sa 11:31, Alvaro Herrera wrote: On 2023-Jul-08, Andrew Dunstan wrote: # Running: pg_basebackup -D C:\\tools\\nmsys64\\home\\pgrunner\\bf\\root\\REL_16_STABLE\\pgsql.build/testrun/pg_basebackup/010_pg_basebackup/data/t_010_pg_basebackup_main_data/backup/tarbackup2 -h C:/tools

Re: pg_basebackup check vs Windows file path limits

2023-11-15 Thread Andrew Dunstan
On 2023-11-15 We 06:34, Alvaro Herrera wrote: On 2023-Nov-13, Andrew Dunstan wrote: size? https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-deviceiocontrol Hmm, here's what that page says - I can't see it saying what you're suggesting here - am I mi

Re: Remove distprep

2023-11-21 Thread Andrew Dunstan
(thereby removing a documentation build gotcha that catches people every so often). I propose that in 2023 it ought to be sufficient for the README file to point at build instructions on the web. +1 cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

meson vs Cygwin

2023-11-22 Thread Andrew Dunstan
D/inst/lib/postgresql/plperl.dll": missing magic block Similar things happen if I try to build with python. I'm not getting the same on a configure/make build. Not sure what would be different. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Random pg_upgrade test failure on drongo

2023-11-27 Thread Andrew Dunstan
ngo and fairywren. It's WS 2019 1809/17763.4252. The latest available AFAICT is 17763.5122 cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: remaining sql/json patches

2023-11-27 Thread Andrew Dunstan
7;s only a start. I'd prefer to have evidence rather than speculation. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Random pg_upgrade test failure on drongo

2023-11-27 Thread Andrew Dunstan
On 2023-11-27 Mo 07:39, Andrew Dunstan wrote: On 2023-11-27 Mo 07:00, Alexander Lakhin wrote: Hello Kuroda-san, 25.11.2023 18:19, Hayato Kuroda (Fujitsu) wrote: Thanks for attaching a program. This helps us to understand the issue. I wanted to confirm your env - this failure was occurred

Re: Missing docs on AT TIME ZONE precedence?

2023-11-27 Thread Andrew Dunstan
ms to meet that criterion; attached. Looks good. Perhaps the comments above the UNBOUNDED precedence setting (esp. the first paragraph) need strengthening, with a stern injunction to avoid different precedence for non-reserved keywords if at all possible. cheers a

Re: Missing docs on AT TIME ZONE precedence?

2023-11-28 Thread Andrew Dunstan
On 2023-11-28 Tu 10:27, Tom Lane wrote: Andrew Dunstan writes: Looks good. Perhaps the comments above the UNBOUNDED precedence setting (esp. the first paragraph) need strengthening, with a stern injunction to avoid different precedence for non-reserved keywords if at all possible. OK. How

Re: remaining sql/json patches

2023-11-28 Thread Andrew Dunstan
On 2023-11-28 Tu 00:10, John Naylor wrote: On Mon, Nov 27, 2023 at 8:57 PM Andrew Dunstan wrote: Interesting. But inferring a speed effect from such changes is difficult. I don't have a good idea about measuring parser speed, but a tool to do that would be useful. Amit has made a sta

Re: remaining sql/json patches

2023-11-28 Thread Andrew Dunstan
On 2023-11-28 Tu 15:49, Andrew Dunstan wrote: On 2023-11-28 Tu 00:10, John Naylor wrote: On Mon, Nov 27, 2023 at 8:57 PM Andrew Dunstan wrote: Interesting. But inferring a speed effect from such changes is difficult. I don't have a good idea about measuring parser speed, but a tool

Re: remaining sql/json patches

2023-11-28 Thread Andrew Dunstan
On 2023-11-28 Tu 19:32, Tom Lane wrote: Andrew Dunstan writes: Cool, I took this and ran with it a bit. (See attached) Here are comparative timings for 1000 iterations parsing most of the information_schema.sql, all the way back to 9.3: ... REL_15_STABLE Time: 3372.491 ms (00

Re: remaining sql/json patches

2023-11-29 Thread Andrew Dunstan
On 2023-11-28 Tu 21:10, Andres Freund wrote: Hi, On 2023-11-28 20:58:41 -0500, Andrew Dunstan wrote: On 2023-11-28 Tu 19:32, Tom Lane wrote: Andrew Dunstan writes: So I'm now a bit baffled. Can you provide more color on what your test setup is? *sigh* yes, you're right. I ina

Re: Python installation selection in Meson

2023-11-29 Thread Andrew Dunstan
ions via chocolatey, and instead install them using pip. Maybe this was as a result of the above problem? cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: remaining sql/json patches

2023-11-29 Thread Andrew Dunstan
On 2023-11-28 Tu 20:58, Andrew Dunstan wrote: On 2023-11-28 Tu 19:32, Tom Lane wrote: Andrew Dunstan writes: Cool, I took this and ran with it a bit. (See attached) Here are comparative timings for 1000 iterations parsing most of the information_schema.sql, all the way back to 9.3

Re: remaining sql/json patches

2023-11-29 Thread Andrew Dunstan
On 2023-11-29 We 12:42, Andres Freund wrote: Hi, On 2023-11-29 07:37:53 -0500, Andrew Dunstan wrote: On 2023-11-28 Tu 21:10, Andres Freund wrote: Hi, On 2023-11-28 20:58:41 -0500, Andrew Dunstan wrote: On 2023-11-28 Tu 19:32, Tom Lane wrote: Andrew Dunstan writes: So I'm now

Re: remaining sql/json patches

2023-11-29 Thread Andrew Dunstan
> On Nov 29, 2023, at 2:41 PM, Andres Freund wrote: > > Hi, > >> On 2023-11-29 14:21:59 -0500, Andrew Dunstan wrote: >> On 2023-11-29 We 12:42, Andres Freund wrote: >>>> I do have a CFLAGS setting, but for meson I used '-Ddebug=true' and no &g

Re: meson: Stop using deprecated way getting path of files

2023-11-30 Thread Andrew Dunstan
somewhere that talks about what platforms each version of Postgres supports? You can look at animals in the buildfarm. For meson only release 16 and up matter. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Emitting JSON to file using COPY TO

2023-12-03 Thread Andrew Dunstan
son_agg(q) from table_or_query q) to stdout The only downside to that is that it has to construct the aggregate, which could be ugly for large datasets, and that's why I'm not opposed to this patch. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Emitting JSON to file using COPY TO

2023-12-03 Thread Andrew Dunstan
I can see both sides of the COPY FROM argument, but I think insisting on that makes this less doable for release 17. On balance I would stick to COPY TO for now. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: More new SQL/JSON item methods

2023-12-03 Thread Andrew Dunstan
On 2023-11-06 Mo 08:23, Jeevan Chalke wrote: On Wed, Nov 1, 2023 at 3:49 PM Andrew Dunstan wrote: On 2023-11-01 We 03:00, Jeevan Chalke wrote: Hello, On Tue, Oct 24, 2023 at 6:41 PM Andrew Dunstan wrote: On 2023-10-19 Th 02:06, Jeevan Chalke wrote

Re: Emitting JSON to file using COPY TO

2023-12-03 Thread Andrew Dunstan
7;/tmp/buf' (format json, force_array); COPY 2000 8<-- None of this is surprising. As I mentioned, limitations with json_agg() are why I support the idea of this patch. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Emitting JSON to file using COPY TO

2023-12-03 Thread Andrew Dunstan
On 2023-12-03 Su 14:24, Joe Conway wrote: On 12/3/23 11:03, Joe Conway wrote: On 12/3/23 10:10, Andrew Dunstan wrote: I  realize this is just a POC, but I'd prefer to see composite_to_json() not exposed. You could use the already public datum_to_json() instead, passing JSONTYPE_COMP

Re: Emitting JSON to file using COPY TO

2023-12-04 Thread Andrew Dunstan
t will try to escape characters such as \, which produces the effect complained of here, or else we need to change its setup so we have a way to inhibit that escaping. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Emitting JSON to file using COPY TO

2023-12-04 Thread Andrew Dunstan
On 2023-12-04 Mo 08:37, Joe Conway wrote: On 12/4/23 07:41, Andrew Dunstan wrote: On 2023-12-03 Su 20:14, Joe Conway wrote: (please don't top quote on the Postgres lists) On 12/3/23 17:38, Davin Shearer wrote: " being quoted as \\" breaks the JSON. It needs to be \"

Re: Emitting JSON to file using COPY TO

2023-12-04 Thread Andrew Dunstan
8 data, AIUI. See a recent discussion on this list on that topic: <https://www.postgresql.org/message-id/flat/81ca2b25-6b3a-499a-9a09-2dd21253c2cb%40unitrunker.net> cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com

Re: Remove MSVC scripts from the tree

2023-12-04 Thread Andrew Dunstan
On 2023-12-04 Mo 03:05, Michael Paquier wrote: On Tue, Sep 26, 2023 at 12:17:04PM -0400, Andrew Dunstan wrote: On 2023-09-26 Tu 01:25, NINGWEI CHEN wrote: hamerkop is not yet prepared for Meson builds, but we plan to work on this support soon. If we go with Meson builds exclusively right

Re: Emitting JSON to file using COPY TO

2023-12-05 Thread Andrew Dunstan
mail client is automatically "helpfully" adding to my emails.  I mean no offense. Hmm. Luckily the Wayback Machine has a copy: <http://web.archive.org/web/20230608210806/idallen.com/topposting.html> Maybe I'll put a copy in the developer wiki. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Emitting JSON to file using COPY TO

2023-12-05 Thread Andrew Dunstan
ne legal delimiter of array items in JSON, and that's a comma. There's no alternative and it's not optional. So in the array case you MUST have commas and in any other case (e.g. LINES) I can't see why you would have them. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Emitting JSON to file using COPY TO

2023-12-05 Thread Andrew Dunstan
On 2023-12-05 Tu 16:02, Joe Conway wrote: On 12/5/23 15:55, Andrew Dunstan wrote: On 2023-12-05 Tu 14:50, Davin Shearer wrote: Hi Joe, In reviewing the 005 patch, I think that when used with FORCE ARRAY, we should also _imply_ FORCE ROW DELIMITER.  I can't envision a use case

Re: Emitting JSON to file using COPY TO

2023-12-05 Thread Andrew Dunstan
On 2023-12-05 Tu 16:09, Joe Conway wrote: On 12/5/23 16:02, Joe Conway wrote: On 12/5/23 15:55, Andrew Dunstan wrote: and in any other case (e.g. LINES) I can't see why you would have them. Oh I didn't address this -- I saw examples in the interwebs of MSSQL server I think [1]

Re: Emitting JSON to file using COPY TO

2023-12-06 Thread Andrew Dunstan
On 2023-12-05 Tu 16:46, Joe Conway wrote: On 12/5/23 16:20, Andrew Dunstan wrote: On 2023-12-05 Tu 16:09, Joe Conway wrote: On 12/5/23 16:02, Joe Conway wrote: On 12/5/23 15:55, Andrew Dunstan wrote: and in any other case (e.g. LINES) I can't see why you would have them. Oh I d

Re: Emitting JSON to file using COPY TO

2023-12-06 Thread Andrew Dunstan
On 2023-12-06 We 08:49, Joe Conway wrote: On 12/6/23 07:36, Andrew Dunstan wrote: On 2023-12-05 Tu 16:46, Joe Conway wrote: On 12/5/23 16:20, Andrew Dunstan wrote: On 2023-12-05 Tu 16:09, Joe Conway wrote: On 12/5/23 16:02, Joe Conway wrote: On 12/5/23 15:55, Andrew Dunstan wrote: and

Re: Emitting JSON to file using COPY TO

2023-12-06 Thread Andrew Dunstan
his that worked slowly than none at all. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Remove MSVC scripts from the tree

2023-12-06 Thread Andrew Dunstan
On 2023-12-06 We 01:18, Peter Eisentraut wrote: On 04.12.23 21:11, Andrew Dunstan wrote: I just had a look at shifting bowerbird to use meson, and it got stymied at the c99 test, which apparently doesn't compile with anything less than VS2019. If that is the case, then wouldn&#

Re: Remove MSVC scripts from the tree

2023-12-06 Thread Andrew Dunstan
On 2023-12-06 We 12:24, Peter Eisentraut wrote: On 06.12.23 17:27, Andrew Dunstan wrote: But the VS2019 compiler implements enough of C99 to pass our meson test, unlike VS2017. Maybe the test is too strict. After all, we know we can in fact build with the earlier versions. I just realized

Re: Emitting JSON to file using COPY TO

2023-12-06 Thread Andrew Dunstan
126325458835528809@clear-code.com> cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Emitting JSON to file using COPY TO

2023-12-07 Thread Andrew Dunstan
JSON_ARRAY_OF_OBJECTS For a future compact array-structured-composites sub-format: JSON_ARRAY_OF_ARRAYS JSON_ARRAY_ROWS No default seems unlike the way we treat other COPY options. I'm not terribly fussed about which format to have as the default, but I think we should have one. cheers andrew -- A

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Andrew Dunstan
that mean we have to create two catalog( pg_copy_from_handler and pg_copy_to_handler)? Surely not. Either have two fields, one for the TO handler and one for the FROM handler, or a flag on each row indicating if it's a FROM or TO handler. cheers andrew -- Andrew Dunstan EDB:

Re: Remove MSVC scripts from the tree

2023-12-07 Thread Andrew Dunstan
ine was to install VS2022 alongside VS2017, as well as switching which perl to link to, which should have no effect on this. So never mind, we make progress. Not sure about VS 2015 though. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: remaining sql/json patches

2023-12-08 Thread Andrew Dunstan
-case behavior if nothing else. We're best off picking the approach that we think is correct long term. All this makes me wonder if Alvaro's first suggested solution (adding NESTED to the UNBOUNDED precedence level) wouldn't be better after all. cheers andrew -- Andre

Re: Clean up find_typedefs and add support for Mac

2023-12-13 Thread Andrew Dunstan
performed a rather more complicated operation along these lines with the PostgreSQL::Test::AdjustUpgrade stuff. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Add --check option to pgindent

2023-12-13 Thread Andrew Dunstan
ng. But note: --show-diff doesn't apply the diff, it's intentionally non-destructive. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Remove MSVC scripts from the tree

2023-12-13 Thread Andrew Dunstan
? TBH I'd prefer to wait. But I have had a couple more urgent things on my plate. I hope to get back to it before New Year. In the meantime I have switched bowerbird to building only STABLE branches. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Clean up find_typedefs and add support for Mac

2023-12-14 Thread Andrew Dunstan
On 2023-12-13 We 15:59, Tristan Partin wrote: On Wed Dec 13, 2023 at 2:35 PM CST, Andrew Dunstan wrote: On 2023-12-12 Tu 18:02, Tom Lane wrote: > "Tristan Partin" writes: >> The big patch here is adding support for Mac. objdump -W doesn't work on >> Mac. So,

Re: Clean up find_typedefs and add support for Mac

2023-12-15 Thread Andrew Dunstan
On 2023-12-14 Th 10:36, Tristan Partin wrote: On Thu Dec 14, 2023 at 9:16 AM CST, Andrew Dunstan wrote: On 2023-12-13 We 15:59, Tristan Partin wrote: > On Wed Dec 13, 2023 at 2:35 PM CST, Andrew Dunstan wrote: >> >> On 2023-12-12 Tu 18:02, Tom Lane wrote: >> >

Re: Clean up find_typedefs and add support for Mac

2023-12-15 Thread Andrew Dunstan
On 2023-12-15 Fr 11:06, Tom Lane wrote: Andrew Dunstan writes: Here's more or less what I had in mind. Do we really need the dependency on an install tree? Can't we just find the executables (or .o files for Darwin) in the build tree? Seems like that would simplify usage, and

Re: Add --check option to pgindent

2023-12-19 Thread Andrew Dunstan
t to run it. In any case, as you say it's a different topic. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Remove MSVC scripts from the tree

2023-12-20 Thread Andrew Dunstan
the module in src/tools/msvc/dummylib/Win32/Registry.pm ? It is. I've fixed the buildfarm to stop checking this script. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Add --check option to pgindent

2023-12-20 Thread Andrew Dunstan
On 2023-12-19 Tu 08:57, Daniel Gustafsson wrote: On 19 Dec 2023, at 14:51, Andrew Dunstan wrote: On 2023-12-18 Mo 11:14, Jelte Fennema-Nio wrote: On Mon, 18 Dec 2023 at 13:42, Daniel Gustafsson wrote: I think this is pretty much ready to go, the attached v4 squashes the changes and fixes

Re: Remove MSVC scripts from the tree

2023-12-20 Thread Andrew Dunstan
On 2023-12-20 We 11:32, Robert Haas wrote: On Wed, Dec 20, 2023 at 11:03 AM Andrew Dunstan wrote: This could perhaps be related to this patch removing the module in src/tools/msvc/dummylib/Win32/Registry.pm ? It is. I've fixed the buildfarm to stop checking this script. Thanks!

Re: Add --check option to pgindent

2023-12-20 Thread Andrew Dunstan
On 2023-12-20 We 11:05, Andrew Dunstan wrote: On 2023-12-19 Tu 08:57, Daniel Gustafsson wrote:   The posted v5 seems like a good compromise I reckon. Andrew: When applying this, how do we synchronize with the buildfarm to avoid false negatives due to the BF using the wrong options? The

Re: Remove MSVC scripts from the tree

2023-12-21 Thread Andrew Dunstan
n32. I wonder who has actually run the script any time recently? In any case, we can probably work around the syncheck issue by making the module a runtime requirement rather than a compile time requirement, by using "require" instead of "use". cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: Remove MSVC scripts from the tree

2023-12-22 Thread Andrew Dunstan
On 2023-12-21 Th 18:20, Michael Paquier wrote: On Thu, Dec 21, 2023 at 03:43:32PM -0500, Andrew Dunstan wrote: On 2023-12-21 Th 03:01, Michael Paquier wrote: Andrew, was the original target of pgperlsyncheck committers and hackers who played with the MSVC scripts but could not run sanity

Re: authentication/t/001_password.pl trashes ~/.psql_history

2023-12-23 Thread Andrew Dunstan
    my $history_file = $params{history_file}; +    $history_file ||= '/dev/null'; +    $ENV{PSQL_HISTORY} = $history_file; to just $ENV{PSQL_HISTORY} = $params{history_file} || '/dev/null'; cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: WIP Incremental JSON Parser

2024-01-03 Thread Andrew Dunstan
On 2024-01-02 Tu 10:14, Robert Haas wrote: On Tue, Dec 26, 2023 at 11:49 AM Andrew Dunstan wrote: Quite a long time ago Robert asked me about the possibility of an incremental JSON parser. I wrote one, and I've tweaked it a bit, but the performance is significantly worse that that o

Re: WIP Incremental JSON Parser

2024-01-03 Thread Andrew Dunstan
On 2024-01-03 We 08:45, Robert Haas wrote: On Wed, Jan 3, 2024 at 6:57 AM Andrew Dunstan wrote: Yeah. One idea I had yesterday was to stash the field names, which in large JSON docs tent to be pretty repetitive, in a hash table instead of pstrduping each instance. The name would be valid

Re: WIP Incremental JSON Parser

2024-01-03 Thread Andrew Dunstan
On 2024-01-03 We 10:12, Robert Haas wrote: On Wed, Jan 3, 2024 at 9:59 AM Andrew Dunstan wrote: Say we have a document with an array 1m objects, each with a field called "color". As it stands we'll allocate space for that field name 1m times. Using a hash table we'd al

Re: WIP Incremental JSON Parser

2024-01-10 Thread Andrew Dunstan
On 2024-01-09 Tu 13:46, Jacob Champion wrote: On Tue, Dec 26, 2023 at 8:49 AM Andrew Dunstan wrote: Quite a long time ago Robert asked me about the possibility of an incremental JSON parser. I wrote one, and I've tweaked it a bit, but the performance is significantly worse that that o

Re: Query execution in Perl TAP tests needs work

2023-08-30 Thread Andrew Dunstan
On 2023-08-28 Mo 09:23, Andrew Dunstan wrote: On 2023-08-28 Mo 01:29, Thomas Munro wrote: Hi, Every time we run a SQL query, we fork a new psql process and a new cold backend process. It's not free on Unix, and quite a lot worse on Windows, at around 70ms per query. Take am

<    7   8   9   10   11   12   13   14   15   16   >