Re: Should CSV parsing be stricter about mid-field quotes?

2023-07-01 Thread Noah Misch
On Sat, May 20, 2023 at 09:16:30AM +0200, Joel Jacobson wrote: > On Fri, May 19, 2023, at 18:06, Daniel Verite wrote: > > COPY FROM file CSV somewhat differs as your example shows, > > but it still mishandle \. when unquoted. For instance, consider this > > file to load with COPY t FROM

Re: Incremental View Maintenance, take 2

2023-07-01 Thread jian he
ok. Now I really found a small bug. this works as intended: BEGIN; CREATE INCREMENTAL MATERIALIZED VIEW test_ivm AS SELECT i, MIN(j) as min_j FROM mv_base_a group by 1; INSERT INTO mv_base_a select 1,-2 where false; rollback; however the following one: BEGIN; CREATE INCREMENTAL MATERIALIZED

Re: possible bug in handling of contrecords in dd38ff28ad (Fix recovery_prefetch with low maintenance_io_concurrency)

2023-07-01 Thread Thomas Munro
On Sun, Jul 2, 2023 at 1:40 AM Tomas Vondra wrote: > I think there's some sort of bug in how dd38ff28ad deals with > contrecords. Consider something as simple as > > pgbench -i -s 100 > > and then doing pg_waldump on the WAL segments, I get this for every > single one: > > pg_waldump: error:

Re: Incremental View Maintenance, take 2

2023-07-01 Thread jian he
This is probably not trivial. In function apply_new_delta_with_count. appendStringInfo(, "WITH updt AS (" /* update a tuple if this exists in the view */ "UPDATE %s AS mv SET %s = mv.%s OPERATOR(pg_catalog.+) diff.%s " "%s " /* SET clauses for aggregates */ "FROM %s AS diff " "WHERE %s " /*

Re: Adding SHOW CREATE TABLE

2023-07-01 Thread Kirk Wolak
On Fri, Jun 30, 2023 at 1:56 PM Kirk Wolak wrote: > On Wed, Jun 21, 2023 at 8:52 PM Kirk Wolak wrote: > >> On Mon, Jun 5, 2023 at 7:43 AM Jelte Fennema wrote: >> >>> On Thu, 1 Jun 2023 at 18:57, Kirk Wolak wrote: >>> >> Definitely have the questions from the previous email, but I CERTAINLY

Re: RFC: pg_stat_logmsg

2023-07-01 Thread Joe Conway
On 6/30/23 23:20, Pavel Stehule wrote: so 1. 7. 2023 v 1:57 odesílatel Joe Conway > napsal: Part of the thinking is that people with fleets of postgres instances can use this to scan for various errors that they care about. Additionally it would be useful

Re: ICU locale validation / canonicalization

2023-07-01 Thread Noah Misch
On Sat, May 20, 2023 at 10:19:30AM -0700, Jeff Davis wrote: > On Tue, 2023-05-02 at 07:29 -0700, Noah Misch wrote: > > On Thu, Mar 30, 2023 at 08:59:41AM +0200, Peter Eisentraut wrote: > > > On 30.03.23 04:33, Jeff Davis wrote: > > > > Attached is a new version of the final patch, which performs >

Re: Does a cancelled REINDEX CONCURRENTLY need to be messy?

2023-07-01 Thread Thom Brown
On Thu, 29 Jun 2023, 14:45 Álvaro Herrera, wrote: > ALTER TABLE DETACH CONCURRENTLY had to deal with this also, and it did it > by having a COMPLETE option you can run later in case things got stuck the > first time around. I suppose we could do something similar, where the > server

Re: check_strxfrm_bug()

2023-07-01 Thread Noah Misch
On Wed, Jun 28, 2023 at 01:02:21PM +1200, Thomas Munro wrote: > On Wed, Jun 28, 2023 at 11:03 AM Thomas Munro wrote: > > The GCC build farm has just received some SPARC hardware new enough to > > run modern Solaris (hostname gcc106), so if wrasse were moved over > > there we could finally assume

Re: Preventing non-superusers from altering session authorization

2023-07-01 Thread Joseph Koshakow
>> That might be a good change? If the original authenticated role ID no >> longer exists then we may want to return an error when trying to set >> your session authorization to that role. > > I was curious why we don't block DROP ROLE if there are active sessions for > the role or terminate any

[PATCH] pgrowlocks: Make mode names consistent with docs

2023-07-01 Thread David Cook
I noticed that pgrowlocks will use different names for shared locks depending on whether the locks are intermediated by a multixact or not. Particularly, if a single transaction has locked a row, it may return "For Key Share" or "For Share" in the "modes" array, while if multiple transactions have

Re: ProcessStartupPacket(): database_name and user_name truncation

2023-07-01 Thread Drouvot, Bertrand
Hi, On 6/30/23 7:32 PM, Drouvot, Bertrand wrote: Hi, On 6/30/23 5:54 PM, Tom Lane wrote: Nathan Bossart writes: After taking another look at this, I wonder if it'd be better to fail as soon as we see the database or user name is too long instead of lugging them around when authentication is

possible bug in handling of contrecords in dd38ff28ad (Fix recovery_prefetch with low maintenance_io_concurrency)

2023-07-01 Thread Tomas Vondra
Hi, I think there's some sort of bug in how dd38ff28ad deals with contrecords. Consider something as simple as pgbench -i -s 100 and then doing pg_waldump on the WAL segments, I get this for every single one: pg_waldump: error: error in WAL record at 0/198: missing

Re: MERGE ... WHEN NOT MATCHED BY SOURCE

2023-07-01 Thread Dean Rasheed
On Tue, 21 Mar 2023 at 12:26, Alvaro Herrera wrote: > > On 2023-Mar-21, Dean Rasheed wrote: > > > Looking at it with fresh eyes though, I realise that I could have just > > written > > > > action->qual = make_and_qual((Node *) ntest, action->qual); > > > > which is equivalent, but more

Re: SPI isolation changes

2023-07-01 Thread Seino Yuki
On 2023-07-01 01:47, Tom Lane wrote: Seino Yuki writes: Of course, executing SET TRANSACTION ISOLATION LEVEL with SPI_execute will result in error. --- SPI_execute("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE", false, 0); (Log Output) ERROR: SET TRANSACTION ISOLATION LEVEL must be called

Re: MERGE ... RETURNING

2023-07-01 Thread Dean Rasheed
On Mon, 13 Mar 2023 at 13:36, Dean Rasheed wrote: > > And another rebase. > I ran out of cycles to pursue the MERGE patches in v16, but hopefully I can make more progress in v17. Looking at this one with fresh eyes, it looks mostly in good shape. To recap, this adds support for the RETURNING

Re: Do we want a hashset type?

2023-07-01 Thread Joel Jacobson
On Fri, Jun 30, 2023, at 06:50, jian he wrote: > more like a C questions > in this context does > #define HASHSET_GET_VALUES(set) ((int32 *) ((set)->data + > CEIL_DIV((set)->capacity, 8))) > define first, then define struct int4hashset_t. Is this normally ok? Yes, it's fine. Macros are just text

Re: pg_upgrade instructions involving "rsync --size-only" might lead to standby corruption?

2023-07-01 Thread Andrey M. Borodin
Fast upgrade of highly available cluster is a vital part of being industry-acceptable solution for any data management system. Because the cluster is required to be highly available. Without this documented technique upgrade of 1Tb cluster would last many hours, not seconds. There are industry

Outdated description of PG_CACHE_LINE_SIZE

2023-07-01 Thread Julien Rouhaud
Hi, I just noticed that the comment for PG_CACHE_LINE_SIZE still says that "it's currently used in xlog.c", which hasn't been true for quite some time. PFA a naive patch to make the description more generic. >From a554ee9ca3558c1cc67b2f4024c13b26aacff3c9 Mon Sep 17 00:00:00 2001 From: Julien