Re: New "single" COPY format

2024-11-09 Thread Joel Jacobson
On Sun, Nov 10, 2024, at 08:32, Joel Jacobson wrote: > Option A: > COPY TO: Empty string field gets exported as an empty line. NULL field > is an error. > COPY FROM: Empty line is imported as an empty string. > > Option B: > COPY TO: NULL field gets exported as an empty line. Empty string field >

Re: New "single" COPY format

2024-11-09 Thread Joel Jacobson
On Sun, Nov 10, 2024, at 05:55, David G. Johnston wrote: > On Saturday, November 9, 2024, jian he wrote: >> >> The list format does not distinguish a >> NULL >> value from an empty string. Empty lines are imported as empty strings, >> not >> as NULL values. >> >> we only ment

Re: New "single" COPY format

2024-11-09 Thread Joel Jacobson
On Sun, Nov 10, 2024, at 05:26, jian he wrote: > On Sun, Nov 10, 2024 at 3:29 AM Joel Jacobson wrote: >> >> Cool. I've drafted a new patch on this approach. >> The list of newline-free built-in types is not exhaustive, yet. > > > do we care that COPY back and forth always work? Yes, I think that'

Re: How to get started with contribution

2024-11-09 Thread Junwang Zhao
Hi Abhiman, On Sat, Nov 9, 2024 at 7:43 PM Abhiman Panwar wrote: > > Respected Sir/Ma'am, > > I am Abhiman Panwar, a computer science undergrad, I have just entered my > second year at Manipal University Jaipur. I am new to open source > contribution, but I'm well aware of know python and JavaS

Re: How to get started with contribution

2024-11-09 Thread Laurenz Albe
On Sat, 2024-11-09 at 15:49 +0530, Abhiman Panwar wrote: > I am Abhiman Panwar, a computer science undergrad, I have just entered my > second year at > Manipal University Jaipur. I am new to open source contribution, but I'm well > aware of > know python and JavaScript. I would love to contribute

Re: New "single" COPY format

2024-11-09 Thread David G. Johnston
On Saturday, November 9, 2024, jian he wrote: > > > > The list format does not distinguish a > NULL > value from an empty string. Empty lines are imported as empty strings, > not > as NULL values. > > we only mentioned import, not export (COPY TO) dealing with > NULL value. > >

Re: New "single" COPY format

2024-11-09 Thread jian he
On Sun, Nov 10, 2024 at 3:29 AM Joel Jacobson wrote: > > Cool. I've drafted a new patch on this approach. > The list of newline-free built-in types is not exhaustive, yet. do we care that COPY back and forth always work? doc not mentioned, but seems it's an implicit idea. copy the_table to '/t

Re: Virtual generated columns

2024-11-09 Thread Amit Kapila
On Tue, Nov 5, 2024 at 9:48 PM Peter Eisentraut wrote: > > On 30.09.24 04:09, Peter Eisentraut wrote: > > I'm attaching a consolidated patch here, so we have something up to date > > on the record. I haven't worked through all the other recent feedback > > from Jian He yet; I'll do that next. > >

Re: New "single" COPY format

2024-11-09 Thread David G. Johnston
On Sat, Nov 9, 2024 at 1:48 PM Joel Jacobson wrote: > On Sat, Nov 9, 2024, at 15:28, David G. Johnston wrote: > > PostgreSQL cannot store the NUL byte. Would that be an option for the > > record separator. Default to new line but accept NUL if one needs to > > input/output lists containing newl

Re: New "single" COPY format

2024-11-09 Thread Joel Jacobson
On Sat, Nov 9, 2024, at 15:28, David G. Johnston wrote: > PostgreSQL cannot store the NUL byte. Would that be an option for the > record separator. Default to new line but accept NUL if one needs to > input/output lists containing newlines. Or whatever character the user > believes is not par

Re: New "single" COPY format

2024-11-09 Thread Joel Jacobson
On Sat, Nov 9, 2024, at 15:13, David G. Johnston wrote: > On Saturday, November 9, 2024, Joel Jacobson wrote: >> On Sat, Nov 9, 2024, at 08:07, Joel Jacobson wrote: >> > Here's a draft of an idea I'm considering (not yet implemented): >> >> I realize the last part about optional quoting is unnece

Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)

2024-11-09 Thread Peter Geoghegan
On Sat, Nov 9, 2024 at 12:37 PM Alena Rybakina wrote: > I noticed that the "Index Searches" cases shown in the regression tests are > only for partitioned tables, maybe something you should add some tests for > regular tables like tenk1. I allowed the patch on this thread to bitrot, but I've be

Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)

2024-11-09 Thread Alena Rybakina
Hi! On 27.08.2024 18:15, Peter Geoghegan wrote: On Thu, Aug 15, 2024 at 3:22 PM Peter Geoghegan wrote: Attached patch has EXPLAIN ANALYZE display the total number of primitive index scans for all 3 kinds of index scan node. Attached is v2, which fixes bitrot. v2 also uses new terminology. EX

Re: Proposal to add page headers to SLRU pages

2024-11-09 Thread Rishu Bagga
> Thanks for pointing this out. Here is what I have tried: > 1. Manually build and install PostgreSQL from the latest source code. > 2. Following the instructions from src/bin/pg_upgrade to manually dump the > regression > database. > 3. Apply the patch to the latest code, and build from the sourc

Re: UUID v7

2024-11-09 Thread Sergey Prokhorenko
On Saturday 9 November 2024 at 01:00:15 am GMT+3, Masahiko Sawada wrote: > the microsecond part is working also as a counter in a sense. IT seems fine > to me but I'm slightly concerned that there is no guidance of such > implementation in RFC 9562. In fact, there is guidance of similar impleme

Re: New GUC autovacuum_max_threshold ?

2024-11-09 Thread Nathan Bossart
On Sat, Nov 09, 2024 at 10:08:51PM +0800, wenhui qiu wrote: > Sorry ,I forgot to explain the reason in my last email,In fact, I > submitted the patch to the community,(frederic.yh...@dalibo.com) told me > there has a same idea ,so , > Let me explain those two formulas here,about ( vac

Re: general purpose array_sort

2024-11-09 Thread Junwang Zhao
Hi Michael, On Fri, Nov 8, 2024 at 8:52 AM Michael Paquier wrote: > > On Thu, Nov 07, 2024 at 10:06:04PM +0800, Junwang Zhao wrote: > > I'm afraid this can not be achieved in my current implementation, a simple > > case is: > > > > SELECT array_sort('{foo,bar,null,CCC,Abc,bbc}'::text[]); > > {Abc

Re: New "single" COPY format

2024-11-09 Thread David G. Johnston
On Saturday, November 9, 2024, Joel Jacobson wrote: > On Fri, Nov 8, 2024, at 22:47, David G. Johnston wrote: > > On Fri, Nov 8, 2024 at 2:20 PM Joel Jacobson wrote: > >> > >> 1. Text files containing \. in the middle of the file > >> % cat /tmp/test.txt > >> foo > >> \. > >> bar > >> > >> Or an

Re: New "single" COPY format

2024-11-09 Thread David G. Johnston
On Saturday, November 9, 2024, Joel Jacobson wrote: > On Sat, Nov 9, 2024, at 08:07, Joel Jacobson wrote: > > Here's a draft of an idea I'm considering (not yet implemented): > > I realize the last part about optional quoting is unnecessary, > since if quoting is desired, users could just use the

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

2024-11-09 Thread Kirill Reshke
On Thu, 7 Nov 2024 at 23:00, Fujii Masao wrote: > > > > On 2024/10/26 6:03, Kirill Reshke wrote: > > when the REJECT LIMIT is set to some non-zero number and the number of > > row NULL replacements exceeds the limit, is it OK to fail. Because > > there WAS errors, and we should not tolerate more t

Re: Proper object locking for GRANT/REVOKE

2024-11-09 Thread Peter Eisentraut
On 31.10.24 15:26, Bertrand Drouvot wrote: + address = get_object_address(objtype, lfirst(cell), &relation, lockmode, false); + Assert(relation == NULL); Worth to explain why we do expect relation to be NULL here? (the comment on top of get_object_address() says it all, but maybe a few words

Re: not null constraints, again

2024-11-09 Thread Alvaro Herrera
On 2024-Nov-08, Tom Lane wrote: > Alvaro Herrera writes: > > But we'll see what else the buildfarm has to say now that I pushed it ... > > A lot of the buildfarm is saying > > adder | 2024-11-08 13:04:39 | > ../pgsql/src/backend/catalog/pg_constraint.c:708:37: warning: comparison is

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-09 Thread Tomas Vondra
On 11/8/24 19:25, Masahiko Sawada wrote: > Hi, > > Thank you for investigating this issue. > > On Thu, Nov 7, 2024 at 10:40 AM Tomas Vondra wrote: >> >> Hi, >> >> I kept investigating this, but I haven't made much progress. I still >> don't understand why would it be OK to move any of the LSN

How to get started with contribution

2024-11-09 Thread Abhiman Panwar
Respected Sir/Ma'am, I am Abhiman Panwar, a computer science undergrad, I have just entered my second year at Manipal University Jaipur. I am new to open source contribution, but I'm well aware of know python and JavaScript. I would love to contribute to your organization, but could you please tel

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-09 Thread Tomas Vondra
On 11/8/24 15:57, Ashutosh Bapat wrote: > ... > > After examining the code before reading [2], I came to the same > conclusion as Masahiko-san in [2]. We install candidate_restart_lsn > based on the running transaction record whose LSN is between > restart_lsn and confirmed_flush_lsn. Since candid

Re: Fix port/pg_iovec.h building extensions on x86_64-darwin

2024-11-09 Thread Wolfgang Walther
Thomas Munro: Out of curiosity, is nixos deliberately using an old macOS deployment target or SDK, 10.something? I'm just wondering if our feature detection is working correctly on macOS/x86, because I'd expect real preadv/pwritev to be there from 11 onwards, and 11 is already out of support by

Re: Add html-serve target to autotools and meson

2024-11-09 Thread Peter Eisentraut
On 07.11.24 05:37, Tristan Partin wrote: When working on documentation, I find it useful to spawn an HTTP server to serve docs for me to consume in a web browser. I went ahead and used Python's builtin http.server module, but it could also be a run target which just spawned `xdg-open builddir/d

Re: remaining sql/json patches

2024-11-09 Thread Nikita Malakhov
Hi! We'd like to help to implement SQL/JSON in v18 and have adapted the JSON_TABLE PLAN clause code from patch v45-0001-JSON_TABLE.patch. Could you please review it? There are some places with questionable behavior - please check the JSON_TABLE plan execution section in tests, and I'm not sure ab

Re: New "single" COPY format

2024-11-09 Thread Joel Jacobson
On Sat, Nov 9, 2024, at 08:07, Joel Jacobson wrote: > Here's a draft of an idea I'm considering (not yet implemented): I realize the last part about optional quoting is unnecessary, since if quoting is desired, users could just use the 'csv' format. Revised draft of the idea (not yet implemented)