Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements

2023-03-16 Thread Michael Paquier
On Sat, Mar 11, 2023 at 02:49:50PM +0300, Andrei Zubkov wrote: > Hi, > > I've done a rebase of a patch to the current master. +/* First we have to remove them from the extension */ +ALTER EXTENSION pg_stat_statements DROP VIEW pg_stat_statements; +ALTER EXTENSION pg_stat_statements DROP FUNCTION p

Re: Combine pg_walinspect till_end_of_wal functions with others

2023-03-16 Thread Michael Paquier
On Wed, Mar 15, 2023 at 06:50:01PM +0900, Michael Paquier wrote: > This is a duplicate of what describe.c uses, with a COLLATE clause. > The main goal was to have a simple check, so I'd still stand by the > simplest choice and move on. Please note that I have done something about that with e643a31

Re: logical decoding and replication of sequences, take 2

2023-03-16 Thread Masahiko Sawada
Hi, On Wed, Mar 15, 2023 at 9:52 PM Tomas Vondra wrote: > > > > On 3/14/23 08:30, John Naylor wrote: > > I tried a couple toy examples with various combinations of use styles. > > > > Three with "automatic" reading from sequences: > > > > create table test(i serial); > > create table test(i int G

Remove last traces of SCM credential auth from libpq?

2023-03-16 Thread Michael Paquier
Hi all, libpq has kept some code related to the support of authentication with SCM credentials for some time now, code dead in the backend since 9.1. Wouldn't it be time to let it go and remove this code entirely, erroring in libpq if attempting to connect to a server that supports that? Hard to

Re: Combine pg_walinspect till_end_of_wal functions with others

2023-03-16 Thread Bharath Rupireddy
On Thu, Mar 16, 2023 at 12:48 PM Michael Paquier wrote: > > On Wed, Mar 15, 2023 at 06:50:01PM +0900, Michael Paquier wrote: > > This is a duplicate of what describe.c uses, with a COLLATE clause. > > The main goal was to have a simple check, so I'd still stand by the > > simplest choice and move

Re: "current directory" in a server error message

2023-03-16 Thread Kyotaro Horiguchi
At Thu, 16 Mar 2023 09:32:05 +0530, Bharath Rupireddy wrote in > On Thu, Mar 16, 2023 at 7:47 AM Kyotaro Horiguchi > wrote: > > Thus I think that the message should read "path must be in or below > > the data directory" instead. > > > > What do you think about making this change? > > Well yes.

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-16 Thread Amit Kapila
On Wed, Mar 15, 2023 at 9:12 AM Amit Kapila wrote: > > On Tue, Mar 14, 2023 at 3:18 PM Önder Kalacı wrote: > >> > > Pushed this patch but forgot to add a new testfile. Will do that soon. > The main patch is committed now. I think the pending item in this thread is to conclude whether we need a s

Re: pg_dump versus hash partitioning

2023-03-16 Thread Julien Rouhaud
On Mon, Mar 13, 2023 at 07:39:12PM -0400, Tom Lane wrote: > Julien Rouhaud writes: > > On Sun, Mar 12, 2023 at 03:46:52PM -0400, Tom Lane wrote: > >> The trick is to detect in pg_restore whether pg_dump chose to do > >> load-via-partition-root. > > > Given that this approach wouldn't help with exi

Re: Fix fseek() detection of unseekable files on WIN32

2023-03-16 Thread Juan José Santamaría Flecha
On Thu, Mar 16, 2023 at 2:05 AM Michael Paquier wrote: > On Wed, Mar 15, 2023 at 12:18:25PM +0100, Juan José Santamaría Flecha > wrote: > > PFA a new version of the patch. > > +_pgftello64(FILE *stream) > +{ > + DWORD fileType; > + > + fileType = GetFileType((HANDLE) _get_osfhandle(

Re: Add pg_walinspect function with block info columns

2023-03-16 Thread Bharath Rupireddy
On Wed, Mar 15, 2023 at 12:20 PM Michael Paquier wrote: > > On Tue, Mar 14, 2023 at 06:50:15PM -0700, Peter Geoghegan wrote: > > On Tue, Mar 14, 2023 at 5:34 PM Melanie Plageman > > wrote: > >> Well, I think if you only care about the WAL record-level information > >> and not the block-level info

Re: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-16 Thread Amit Kapila
On Mon, Mar 13, 2023 at 6:26 PM Önder Kalacı wrote: > > Attaching v2 > Can we change the comment to: "Ignore dropped and generated columns as the publisher doesn't send those."? After your change, att = TupleDescAttr(slot1->tts_tupleDescriptor, attrnum); is done twice in the same function. In te

Re: postgres_fdw: Useless if-test in GetConnection()

2023-03-16 Thread Etsuro Fujita
On Wed, Mar 15, 2023 at 7:40 PM Richard Guo wrote: > On Wed, Mar 15, 2023 at 6:18 PM Etsuro Fujita wrote: >> While working on something else, I noticed that the “if (entry->conn >> == NULL)” test after doing disconnect_pg_server() when re-establishing >> a given connection in GetConnection() is p

Re: Get rid of PgStat_BackendFunctionEntry

2023-03-16 Thread Drouvot, Bertrand
Hi, On 3/16/23 6:25 AM, Michael Paquier wrote: On Wed, Mar 08, 2023 at 01:38:38PM -0800, Nathan Bossart wrote: Looks reasonable to me. I have been catching up with this thread and the other thread, and indeed it looks like this is going to help in refactoring pgstatfuncs.c to have more macros

Re: postgres_fdw: Useless if-test in GetConnection()

2023-03-16 Thread Etsuro Fujita
On Wed, Mar 15, 2023 at 7:58 PM Daniel Gustafsson wrote: > > On 15 Mar 2023, at 11:18, Etsuro Fujita wrote: > > While working on something else, I noticed that the “if (entry->conn > > == NULL)” test after doing disconnect_pg_server() when re-establishing > > a given connection in GetConnection()

Re: suppressing useless wakeups in logical/worker.c

2023-03-16 Thread Amit Kapila
On Wed, Feb 1, 2023 at 5:35 AM Nathan Bossart wrote: > > On Sat, Jan 28, 2023 at 10:26:25AM +0530, Amit Kapila wrote: > > On Fri, Jan 27, 2023 at 4:07 AM Tom Lane wrote: > >> Returning to the prior patch ... I don't much care for this: > >> > >> +/* Maybe there will be a free

Re: Ability to reference other extensions by schema in extension scripts

2023-03-16 Thread Sandro Santilli
On Mon, Mar 13, 2023 at 05:57:57PM -0400, Regina Obe wrote: > > Attached is a slightly revised patch to fix the extra whitespace in the > extend.gml document that Sandro noted to me. Thanks Regina. I've tested attached patch (md5 0b652a8271fc7e71ed5f712ac162a0ef) against current master (hash 4ef1

The use of atooid() on non-Oid results

2023-03-16 Thread Daniel Gustafsson
When looking at the report in [0] an API choice in the relevant pg_upgrade code path stood out as curious. check_is_install_user() runs this query to ensure that only the install user is present in the cluster: res = executeQueryOrDie(conn, "SELECT COUNT(*) "

Re: Transparent column encryption

2023-03-16 Thread Peter Eisentraut
On 13.03.23 22:11, Andres Freund wrote: It adds branches, and it makes tupledescs wider. In tight spots, such as printtup, that can hurt, even if the branches aren't ever entered. In fact, I do see a noticable, but not huge, regression: I tried to reproduce your measurements, but I don't have

Re: Add a hook to allow modification of the ldapbindpasswd

2023-03-16 Thread Andrew Dunstan
On 2023-03-15 We 20:39, Michael Paquier wrote: On Wed, Mar 15, 2023 at 06:18:28PM -0400, Andrew Dunstan wrote: Ugh. Not batting 1000 today. Will investigate. I have noticed that you forgot a .gitignore in this new path, as well, so I have taken the liberty to add one ;) Thanks. One benefit

Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry

2023-03-16 Thread Drouvot, Bertrand
Hi, On 3/16/23 7:29 AM, Michael Paquier wrote: On Mon, Mar 06, 2023 at 08:33:15AM +0100, Drouvot, Bertrand wrote: Thanks for having looked at it! Looking at that, I have a few comments. +tabentry = (PgStat_TableStatus *) entry_ref->pending; +tablestatus = palloc(sizeof(PgStat_TableSt

Re: Add a hook to allow modification of the ldapbindpasswd

2023-03-16 Thread Andrew Dunstan
On 2023-03-15 We 18:18, Andrew Dunstan wrote: On 2023-03-15 We 17:50, Tom Lane wrote: Andrew Dunstan writes: pushed. drongo is not happy with this, but I'm kind of baffled as to why: "c:\\prog\\bf\\root\\HEAD\\pgsql.build\\pgsql.sln" (default target) (1) -> "c:\\prog\\bf\\root\\HEAD\\pgsq

RE: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-16 Thread shiy.f...@fujitsu.com
On Thu, Mar 16, 2023 5:23 PM Amit Kapila wrote: > > On Mon, Mar 13, 2023 at 6:26 PM Önder Kalacı > wrote: > > > > Attaching v2 > > > > Can we change the comment to: "Ignore dropped and generated columns as > the publisher doesn't send those."? After your change, att = > TupleDescAttr(slot1->tts

Re: [EXTERNAL] Support load balancing in libpq

2023-03-16 Thread Daniel Gustafsson
In general I think this feature makes sense (which has been echoed many times in the thread), and the implementation strikes a good balance of robustness and simplicity. Reading this I think it's very close to being committable, but I have a few comments on the patch series: +sent to the

Re: logical decoding and replication of sequences, take 2

2023-03-16 Thread Amit Kapila
On Thu, Mar 16, 2023 at 1:08 PM Masahiko Sawada wrote: > > Hi, > > On Wed, Mar 15, 2023 at 9:52 PM Tomas Vondra > wrote: > > > > > > > > On 3/14/23 08:30, John Naylor wrote: > --- > I got an assertion failure. The reproducible steps are: > > 1. On publisher > alter system set logical_replication_

Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements

2023-03-16 Thread Andrei Zubkov
Hi Michael, Thank you for your attention. On Thu, 2023-03-16 at 16:13 +0900, Michael Paquier wrote: > +/* First we have to remove them from the extension */ > +ALTER EXTENSION pg_stat_statements DROP VIEW pg_stat_statements; > +ALTER EXTENSION pg_stat_statements DROP FUNCTION > pg_stat_statements

Re: Making empty Bitmapsets always be NULL

2023-03-16 Thread Yuya Watari
Hello, On Thu, Mar 16, 2023 at 10:30 AM Yuya Watari wrote: > My idea is to compute the bitwise OR of all bitmapwords of the result > Bitmapset. The bitwise OR can be represented as a single operation in > the machine code and does not require any conditional branches. If the > bitwise ORed value

Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry

2023-03-16 Thread Michael Paquier
On Thu, Mar 16, 2023 at 11:32:56AM +0100, Drouvot, Bertrand wrote: > On 3/16/23 7:29 AM, Michael Paquier wrote: >> From what I get with this change, the number of tuples changed by DMLs >> have their computations done a bit earlier, > > Thanks for looking at it! > > Right, but note this is in a

Re: Speed-up shared buffers prewarming

2023-03-16 Thread Drouvot, Bertrand
Hi, On 3/15/23 10:40 PM, Matthias van de Meent wrote: On Wed, 15 Mar 2023 at 21:38, Konstantin Knizhnik wrote: Hi hackers, It is well known fact that queries using sequential scan can not be used to prewarm cache, because them are using ring buffer even if shared buffers are almost empty. I

Re: Split index and table statistics into different types of stats

2023-03-16 Thread Michael Paquier
On Thu, Mar 16, 2023 at 10:24:32AM +0100, Drouvot, Bertrand wrote: > My plan was to get [1] done before resuming working on the "Split > index and table statistics into different types of stats" one. Okay, I was unsure what should be the order here. Let's see about [1] first, then. -- Michael s

Re: proposal: possibility to read dumped table's name from file

2023-03-16 Thread Pavel Stehule
út 7. 3. 2023 v 3:47 odesílatel Julien Rouhaud napsal: > Hi, > > On Mon, Mar 06, 2023 at 10:20:32PM +0100, Daniel Gustafsson wrote: > > > On 6 Mar 2023, at 21:45, Gregory Stark (as CFM) > wrote: > > > > > > So This patch has been through a lot of commitfests. And it really > > > doesn't seem

Re: Data is copied twice when specifying both child and parent table in publication

2023-03-16 Thread Amit Kapila
On Wed, Feb 8, 2023 at 9:21 AM wangw.f...@fujitsu.com wrote: > > I think this failure is caused by the recently commit (b7ae039) in the current > HEAD. Rebased the patch set and attach them. > + if (server_version >= 16) + { + appendStringInfo(&cmd, "SELECT DISTINCT N.nspname, C.relname,\n" +

Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.

2023-03-16 Thread Anton A. Melnikov
Hello! On 15.03.2023 21:29, Gregory Stark (as CFM) wrote: These patches that are "Needs Review" and have received no comments at all since before March 1st are these. If your patch is amongst this list I would suggest any of: 1) Move it yourself to the next CF (or withdraw it) 2) Post to the

Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements

2023-03-16 Thread Andrei Zubkov
A little comment fix in update script of a patch -- Andrei Zubkov From 52e75fa05f5dea5700d96aea81ea81d91492b018 Mon Sep 17 00:00:00 2001 From: Andrei Zubkov Date: Thu, 16 Mar 2023 13:18:59 +0300 Subject: [PATCH 1/2] pg_stat_statements tests: Add NOT NULL checking of pg_stat_statements_reset Thi

Re: pg_dump versus hash partitioning

2023-03-16 Thread Tom Lane
Julien Rouhaud writes: > On Mon, Mar 13, 2023 at 07:39:12PM -0400, Tom Lane wrote: >> Yeah, we need to do both. Attached find an updated patch series: > I didn't find a CF entry, is it intended? Yeah, it's there: https://commitfest.postgresql.org/42/4226/ > I'm not sure if you intend to keep

Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry

2023-03-16 Thread Drouvot, Bertrand
On 3/16/23 12:46 PM, Michael Paquier wrote: On Thu, Mar 16, 2023 at 11:32:56AM +0100, Drouvot, Bertrand wrote: On 3/16/23 7:29 AM, Michael Paquier wrote: From what I get with this change, the number of tuples changed by DMLs have their computations done a bit earlier, Thanks for looking at

Re: [BUG] Logical replica crash if there was an error in a function.

2023-03-16 Thread Anton A. Melnikov
Hello! On 15.03.2023 21:29, Gregory Stark (as CFM) wrote: These patches that are "Needs Review" and have received no comments at all since before March 1st are these. If your patch is amongst this list I would suggest any of: 1) Move it yourself to the next CF (or withdraw it) 2) Post to the l

Re: Allow logical replication to copy tables in binary format

2023-03-16 Thread Melih Mutlu
Hi, Please see the attached v16. Peter Smith , 16 Mar 2023 Per, 03:03 tarihinde şunu yazdı: > Here are some review comments for v15-0001 > I applied your comments in the updated patch. shiy.f...@fujitsu.com , 16 Mar 2023 Per, 05:35 tarihinde şunu yazdı: > On Thu, Mar 16, 2023 2:26 AM Melih Mu

Re: Allow logical replication to copy tables in binary format

2023-03-16 Thread Melih Mutlu
Amit Kapila , 16 Mar 2023 Per, 06:25 tarihinde şunu yazdı: > On Thu, Mar 16, 2023 at 8:27 AM Euler Taveira wrote: > > > > On Wed, Mar 8, 2023, at 11:50 PM, Amit Kapila wrote: > > > > It is not clear to me which version check you wanted to add because we > > seem to have a binary option in COPY fr

FW: uuid-ossp source or binaries for Windows

2023-03-16 Thread Mark Hill
I posted this to pgsql-general but I think that's more for Postgres users. I'm trying to build Postgres with the uuid-ossp extension on Windows using the msvc toolset provided with the Postgres source in /src/tools/msvc, e.g. postgresql-14.7/src/tools/msvc. I think I need uuid-ossp installed.

gcc 13 warnings

2023-03-16 Thread Pavel Stehule
Hi see [504/2287] Compiling C object src/backend/postgres_lib.a.p/access_transam_xlogrecovery.c.o In function ‘recoveryStopsAfter’, inlined from ‘PerformWalRecovery’ at ../src/backend/access/transam/xlogrecovery.c:1749:8: ../src/backend/access/transam/xlogrecovery.c:2737:42: warning: ‘recordX

Re: Move defaults toward ICU in 16?

2023-03-16 Thread Peter Eisentraut
On 09.03.23 20:14, Jeff Davis wrote: Let's come back to that after dealing with the other two. Leaving 0001 open for now. I suspect making a change like this now would result in a bloodbath on the build farm that we could do without. I suggest revisiting this after the commit fest ends.

Re: gcc 13 warnings

2023-03-16 Thread Melanie Plageman
On Thu, Mar 16, 2023 at 9:40 AM Pavel Stehule wrote: > [1700/2287] Compiling C object src/pl/plpgsql/src/plpgsql.so.p/pl_exec.c.o > In file included from ../src/include/access/htup_details.h:22, > from ../src/pl/plpgsql/src/pl_exec.c:21: > In function ‘assign_simple_var’, > in

Re: Remove last traces of SCM credential auth from libpq?

2023-03-16 Thread Tom Lane
Michael Paquier writes: > libpq has kept some code related to the support of authentication with > SCM credentials for some time now, code dead in the backend since > 9.1. Wouldn't it be time to let it go and remove this code entirely, > erroring in libpq if attempting to connect to a server that

Re: The use of atooid() on non-Oid results

2023-03-16 Thread Tom Lane
Daniel Gustafsson writes: > When looking at the report in [0] an API choice in the relevant pg_upgrade > code > path stood out as curious. check_is_install_user() runs this query to ensure > that only the install user is present in the cluster: > res = executeQueryOrDie(conn, >

Re: Progress report of CREATE INDEX for nested partitioned tables

2023-03-16 Thread Ilya Gladyshev
> 16 марта 2023 г., в 04:07, Justin Pryzby написал(а): > > On Tue, Mar 14, 2023 at 06:58:14PM +0400, Ilya Gladyshev wrote: >>> The only change from the current patch is (3). (1) still calls >>> count_leaf_partitions(), but only once. I'd prefer that to rearranging >>> the progress reporting

Re: improving user.c error messages

2023-03-16 Thread Peter Eisentraut
On 10.03.23 01:03, Nathan Bossart wrote: By the way, I'm not sure what the separation between 0001 and 0002 is supposed to be. I'll combine them. I first started with user.c only, but we kept finding new messages to improve. I combined the patches in v7. I have committed two pieces that were

Re: gcc 13 warnings

2023-03-16 Thread Tom Lane
Melanie Plageman writes: > On Thu, Mar 16, 2023 at 9:40 AM Pavel Stehule wrote: >> ../src/include/varatt.h:230:36: warning: array subscript 0 is outside array >> bounds of ‘char[0]’ [-Warray-bounds=] > I see these with gcc 12.2.0 also. Hmm, I do not see any warnings on HEAD with Fedora 37's gc

Re: improving user.c error messages

2023-03-16 Thread Nathan Bossart
On Thu, Mar 16, 2023 at 04:24:07PM +0100, Peter Eisentraut wrote: > I have committed two pieces that were not message changes separately. Thanks! > I think the following change in DropRole() is incorrect: > > if (!is_admin_of_role(GetUserId(), roleid)) > ereport(ERROR, >

Re: improving user.c error messages

2023-03-16 Thread Peter Eisentraut
On 16.03.23 16:48, Nathan Bossart wrote: I think the following change in DropRole() is incorrect: if (!is_admin_of_role(GetUserId(), roleid)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), -errmsg("must have admin option on

Re: gcc 13 warnings

2023-03-16 Thread Pavel Stehule
čt 16. 3. 2023 v 16:43 odesílatel Tom Lane napsal: > Melanie Plageman writes: > > On Thu, Mar 16, 2023 at 9:40 AM Pavel Stehule > wrote: > >> ../src/include/varatt.h:230:36: warning: array subscript 0 is outside > array bounds of ‘char[0]’ [-Warray-bounds=] > > > I see these with gcc 12.2.0 als

Re: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-16 Thread Önder Kalacı
Hi Amit, Shi Yu, > Generated column is introduced in PG12, and I reproduced generated column problem in PG12~PG15. > For dropped column problem, I reproduced it in PG10~PG15. (Logical replication was introduced in PG10) So, I'm planning to split the changes into two commits. The first one fixes f

Re: "current directory" in a server error message

2023-03-16 Thread Tom Lane
Kyotaro Horiguchi writes: > At Thu, 16 Mar 2023 09:32:05 +0530, Bharath Rupireddy > wrote in >> On Thu, Mar 16, 2023 at 7:47 AM Kyotaro Horiguchi >> wrote: >>> Thus I think that the message should read "path must be in or below >>> the data directory" instead. >> BTW, adminpack too has the sa

Re: gcc 13 warnings

2023-03-16 Thread Tom Lane
Pavel Stehule writes: > čt 16. 3. 2023 v 16:43 odesílatel Tom Lane napsal: >> Hmm, I do not see any warnings on HEAD with Fedora 37's gcc 12.2.1. >> What non-default configure switches, CFLAGS, etc are you using? > meson build without any settings > I think so it is related to meson build, I did

Re: improving user.c error messages

2023-03-16 Thread Nathan Bossart
On Thu, Mar 16, 2023 at 04:59:53PM +0100, Peter Eisentraut wrote: > On 16.03.23 16:48, Nathan Bossart wrote: >> > I think the following change in DropRole() is incorrect: >> > >> > if (!is_admin_of_role(GetUserId(), roleid)) >> > ereport(ERROR, >> > (errc

Re: Transparent column encryption

2023-03-16 Thread Andres Freund
Hi, On 2023-03-16 11:26:46 +0100, Peter Eisentraut wrote: > On 13.03.23 22:11, Andres Freund wrote: > > > It adds branches, and it makes tupledescs wider. In tight spots, such as > > > printtup, that can hurt, even if the branches aren't ever entered. > > In fact, I do see a noticable, but not hug

RE: Initial Schema Sync for Logical Replication

2023-03-16 Thread Kumar, Sachin
Hi Peter, > Hi, > > I have a couple of questions. > > Q1. > > What happens if the subscriber already has some tables present? For > example, I did not see the post saying anything like "Only if the table does > not already exist then it will be created". > My assumption was the if subscriber i

Re: Add LZ4 compression in pg_dump

2023-03-16 Thread gkokolatos
--- Original Message --- On Tuesday, March 14th, 2023 at 4:32 PM, Tomas Vondra wrote: > > > > > On 3/14/23 16:18, gkokola...@pm.me wrote: > > > ...> Would you mind me trying to come with a patch to address your points? > > > That'd be great, thanks. Please keep it split into sm

Re: gcc 13 warnings

2023-03-16 Thread Andres Freund
Hi, On 2023-03-16 12:10:27 -0400, Tom Lane wrote: > Pavel Stehule writes: > > čt 16. 3. 2023 v 16:43 odesílatel Tom Lane napsal: > >> Hmm, I do not see any warnings on HEAD with Fedora 37's gcc 12.2.1. > >> What non-default configure switches, CFLAGS, etc are you using? > > > meson build withou

Re: More weird compiler warnings

2023-03-16 Thread Andres Freund
Hi, On 2022-03-26 13:55:49 -0700, Andres Freund wrote: > On 2022-03-26 16:23:26 -0400, Tom Lane wrote: > > serinus' experimental gcc whines about a few places in network.c: > > > > ../../../../../pgsql/src/backend/utils/adt/network.c: In function 'inetnot': > > ../../../../../pgsql/src/backend/uti

Re: gcc 13 warnings

2023-03-16 Thread Andres Freund
Hi, On 2023-03-16 10:05:06 -0700, Andres Freund wrote: > I think it's just that meson defaults to -O3 (fwiw, I see substantial gains of > that over -O2). I see such warnings with autoconf as well if I make it use > -O3. WRT: In file included from /home/andres/src/postgresql/src/include/access/

Re: Remove last traces of SCM credential auth from libpq?

2023-03-16 Thread Jonathan S. Katz
On 3/16/23 10:49 AM, Tom Lane wrote: Michael Paquier writes: libpq has kept some code related to the support of authentication with SCM credentials for some time now, code dead in the backend since 9.1. Wouldn't it be time to let it go and remove this code entirely, erroring in libpq if attemp

Re: Remove last traces of SCM credential auth from libpq?

2023-03-16 Thread Tom Lane
"Jonathan S. Katz" writes: > It looks like in the po files there are a bunch of "SCM_CRED > authentication method not supported" messages that can also be removed. Those will go away in the normal course of translation maintenance, there's no need to remove them by hand. (Generally speaking, th

Re: gcc 13 warnings

2023-03-16 Thread Tom Lane
Andres Freund writes: > On 2023-03-16 12:10:27 -0400, Tom Lane wrote: >> It wouldn't be entirely surprising if meson is selecting some -W >> switches that the configure script doesn't ... but I don't know >> where to check or change that. > I think it's just that meson defaults to -O3 (fwiw, I se

Default libpq connection parameter handling and copy-paste of apparently dead code for it?

2023-03-16 Thread Greg Stark
I notice a number of places in fe-connect.c have copied this idiom where if an option is present they validate the legal options and otherwise they strdup a default value. This strdup of the default option I think is being copied from sslmode's validation which is a bit special but afaics the follo

Re: gcc 13 warnings

2023-03-16 Thread Andres Freund
Hi, On 2023-03-16 13:54:29 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2023-03-16 12:10:27 -0400, Tom Lane wrote: > >> It wouldn't be entirely surprising if meson is selecting some -W > >> switches that the configure script doesn't ... but I don't know > >> where to check or change that

Re: Date-Time dangling unit fix

2023-03-16 Thread Tom Lane
Hearing no further comments on this, I adjusted DecodeTimeOnly to look more like DecodeDateTime as I recommended upthread, and pushed. regards, tom lane

Re: More weird compiler warnings

2023-03-16 Thread Tom Lane
Andres Freund writes: > On 2022-03-26 13:55:49 -0700, Andres Freund wrote: >> On 2022-03-26 16:23:26 -0400, Tom Lane wrote: >>> but I'm wondering if we could silence the warning by changing the loop >>> condition to >>> while (--nb >= 0) >>> which seems like it might be marginally more readable a

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 chan

Re: The use of atooid() on non-Oid results

2023-03-16 Thread Daniel Gustafsson
> On 16 Mar 2023, at 15:58, Tom Lane wrote: > > Daniel Gustafsson writes: >> When looking at the report in [0] an API choice in the relevant pg_upgrade >> code >> path stood out as curious. check_is_install_user() runs this query to ensure >> that only the install user is present in the cluste

Re: Experiments with Postgres and SSL

2023-03-16 Thread Greg Stark
Here's an updated patch for direct SSL connections. I've added libpq client support with a new connection parameter. This allows testing it easily with psql. It's still a bit hard to see what's going on though. I'm thinking it would be good to have libpq keep a string which describes what negotiat

Re: slapd logs to syslog during tests

2023-03-16 Thread Andrew Dunstan
On 2023-03-11 Sa 18:37, Andres Freund wrote: Hi, On my buildfarm host (for all my animals) I noted that slapd was by far the biggest contributor to syslog. Even though there's not normally slapd running. It's of course the slapds started by various tests. Would anybody mind if I add 'logfile_o

Re: How to check for in-progress transactions

2023-03-16 Thread Tejasvi Kashi
Hi Bharath, Thanks a lot for your reply. It looks like this is exactly what I need. For my use case, I'm trying to get read-only transactions to wait for the replication of prior writes. Sincerely, Tej Kashi MMath CS, University of Waterloo Waterloo, ON, CA On Thu, 16 Mar 2023 at 01:36, Bharath

Re: doc: mentioned CREATE+ATTACH PARTITION as an alternative to CREATE TABLE..PARTITION OF

2023-03-16 Thread Tom Lane
Justin Pryzby writes: > On Thu, Jan 19, 2023 at 04:47:59PM -0500, Robert Treat wrote: >> I think all of that feedback is useful, I guess the immediate question >> becomes if Justin wants to try to proceed with his patch implementing >> the change, or if adjusting the documentation for the current

Re: How to check for in-progress transactions

2023-03-16 Thread Melanie Plageman
On Thu, Mar 16, 2023 at 4:43 PM Tejasvi Kashi wrote: > Thanks a lot for your reply. It looks like this is exactly what I need. For > my use case, I'm trying to get read-only transactions to wait for the > replication of prior writes. can't you use remote_apply? https://www.postgresql.org/docs/

Re: How to check for in-progress transactions

2023-03-16 Thread Tejasvi Kashi
On Thu, Mar 16, 2023 at 17:01, Melanie Plageman wrote: > On Thu, Mar 16, 2023 at 4:43 PM Tejasvi Kashi wrote: > > Thanks a lot for your reply. It looks like this is exactly what I need. > For my use case, I'm trying to get read-only transactions to wait for the > replication of prior writes. > >

Re: doc: mentioned CREATE+ATTACH PARTITION as an alternative to CREATE TABLE..PARTITION OF

2023-03-16 Thread Justin Pryzby
On Thu, Mar 16, 2023 at 04:52:07PM -0400, Tom Lane wrote: > Justin Pryzby writes: > > On Thu, Jan 19, 2023 at 04:47:59PM -0500, Robert Treat wrote: > >> I think all of that feedback is useful, I guess the immediate question > >> becomes if Justin wants to try to proceed with his patch implementing

Re: Track IO times in pg_stat_io

2023-03-16 Thread Melanie Plageman
v5 attached mostly addresses instr_time persistence issues. On Tue, Mar 14, 2023 at 6:56 PM Andres Freund wrote: > On 2023-03-09 11:50:38 -0500, Melanie Plageman wrote: > > On Tue, Mar 7, 2023 at 1:39 PM Andres Freund wrote: > > > On 2023-03-06 11:30:13 -0500, Melanie Plageman wrote: > > > > > A

Re: Add LZ4 compression in pg_dump

2023-03-16 Thread Tomas Vondra
On 3/16/23 18:04, gkokola...@pm.me wrote: > > --- Original Message --- > On Tuesday, March 14th, 2023 at 4:32 PM, Tomas Vondra > wrote: >> >> On 3/14/23 16:18, gkokola...@pm.me wrote: >> >>> ...> Would you mind me trying to come with a patch to address your points? >> >> >> That'd be

Re: doc: mentioned CREATE+ATTACH PARTITION as an alternative to CREATE TABLE..PARTITION OF

2023-03-16 Thread Tom Lane
Justin Pryzby writes: > On Thu, Mar 16, 2023 at 04:52:07PM -0400, Tom Lane wrote: > It is possible to use ALTER > TABLE ATTACH/DETACH PARTITION to perform these > operations with a weaker lock, thus reducing interference with > concurrent operations on the partitioned table

Re: More weird compiler warnings

2023-03-16 Thread Andres Freund
On 2023-03-16 14:31:37 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2022-03-26 13:55:49 -0700, Andres Freund wrote: > >> On 2022-03-26 16:23:26 -0400, Tom Lane wrote: > >>> but I'm wondering if we could silence the warning by changing the loop > >>> condition to > >>> while (--nb >= 0) >

Re: slapd logs to syslog during tests

2023-03-16 Thread Thomas Munro
On Fri, Mar 17, 2023 at 9:15 AM Andrew Dunstan wrote: > On 2023-03-11 Sa 18:37, Andres Freund wrote: > On my buildfarm host (for all my animals) I noted that slapd was by far the > biggest contributor to syslog. Even though there's not normally slapd > running. It's of course the slapds started by

Re: A problem about ParamPathInfo for an AppendPath

2023-03-16 Thread Tom Lane
Richard Guo writes: > Attached is a patch for this change and the changes described upthread. Pushed. I thought the comment needed to be completely rewritten not just tweaked, and I felt it was probably reasonable to continue to exclude dummy paths from getting the more expensive treatment.

Re: Add LZ4 compression in pg_dump

2023-03-16 Thread Tomas Vondra
On 3/16/23 01:20, Justin Pryzby wrote: > On Mon, Mar 13, 2023 at 10:47:12PM +0100, Tomas Vondra wrote: >>> Rearrange functions to their original order allowing a cleaner diff to the >>> prior code; >> >> OK. I wasn't very enthusiastic about this initially, but after thinking >> about it a bit I

Re: Add LZ4 compression in pg_dump

2023-03-16 Thread Justin Pryzby
On Thu, Mar 16, 2023 at 11:30:50PM +0100, Tomas Vondra wrote: > On 3/16/23 01:20, Justin Pryzby wrote: > > But try reading the diff while looking for the cause of a bug. It's the > > difference between reading 50, two-line changes, and reading a hunk that > > replaces 100 lines with a different 10

Re: Refactor calculations to use instr_time

2023-03-16 Thread Melanie Plageman
On Thu, Mar 09, 2023 at 04:02:44PM +0300, Nazir Bilal Yavuz wrote: > From dcd49e48a0784a95b8731df1c6ee7c3a612a8529 Mon Sep 17 00:00:00 2001 > From: Nazir Bilal Yavuz > Date: Thu, 9 Mar 2023 15:35:38 +0300 > Subject: [PATCH v5] Refactor instr_time calculations > > Also, some calculations are refac

Re: PGDOCS - Replica Identity quotes

2023-03-16 Thread Peter Smith
A rebase was needed due to the recent REPLICA IDENTITY push [1]. PSA v2. -- [1] https://github.com/postgres/postgres/commit/89e46da5e511a6970e26a020f265c9fb4b72b1d2 Kind Regards, Peter Smith. Fujitsu Australia v2-0001-PGDOCS-replica-identity-quotes.patch Description: Binary data

Re: improving user.c error messages

2023-03-16 Thread Nathan Bossart
Here is a rebased patch in which I've addressed the latest feedback except for the DropRole() part that is under discussion. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From cd6a75109471e173869a15b39342ff4882eac61f Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Thu, 26 Ja

Re: Amcheck verification of GiST and GIN

2023-03-16 Thread Peter Geoghegan
On Sun, Feb 5, 2023 at 4:45 PM Andrey Borodin wrote: > Here's v24 == (v23 + a step for pg_amcheck). There's a lot of > shotgun-style changes, but I hope next index types will be easy to add > now. Some feedback on the GiST patch: * You forgot to initialize GistCheckState.heaptuplespresent to 0.

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2023-03-16 Thread Andres Freund
Hi, On 2023-03-07 15:44:46 +1300, Thomas Munro wrote: > On Tue, Mar 7, 2023 at 3:42 PM Thomas Munro wrote: > > Apparently ye olde GCC 4.7 on "lapwing" doesn't like the way you > > initialised that struct. I guess it wants {{0}} instead of {0}. > > Apparently old GCC was wrong about that warning[

Re: Allow logical replication to copy tables in binary format

2023-03-16 Thread Amit Kapila
On Thu, Mar 16, 2023 at 6:59 PM Melih Mutlu wrote: > > Amit Kapila , 16 Mar 2023 Per, 06:25 tarihinde şunu > yazdı: >> >> On Thu, Mar 16, 2023 at 8:27 AM Euler Taveira wrote: >> > >> > On Wed, Mar 8, 2023, at 11:50 PM, Amit Kapila wrote: >> > >> > It is not clear to me which version check you wa

Re: Remove last traces of SCM credential auth from libpq?

2023-03-16 Thread Michael Paquier
On Thu, Mar 16, 2023 at 10:49:45AM -0400, Tom Lane wrote: > In addition to the changes here, it looks like you could drop the > configure/meson probes that set HAVE_STRUCT_CMSGCRED. Right, done. > Also, in pg_fe_sendauth, couldn't you just let the default: case > handle it instead of adding a bes

Re: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-16 Thread Amit Kapila
On Thu, Mar 16, 2023 at 9:33 PM Önder Kalacı wrote: > > Hi Amit, Shi Yu, > > > Generated column is introduced in PG12, and I reproduced generated column > > problem > in PG12~PG15. > > For dropped column problem, I reproduced it in PG10~PG15. (Logical > > replication > was introduced in PG10) >

Re: Remove last traces of SCM credential auth from libpq?

2023-03-16 Thread Tom Lane
Michael Paquier writes: > On Thu, Mar 16, 2023 at 10:49:45AM -0400, Tom Lane wrote: >> Also, in pg_fe_sendauth, couldn't you just let the default: case >> handle it instead of adding a bespoke error message? We're not >> really expecting that anyone is ever going to hit this, so I'm >> not convin

Re: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-16 Thread Tom Lane
Amit Kapila writes: > On Thu, Mar 16, 2023 at 9:33 PM Önder Kalacı wrote: >>> and backpatch the fix for dropped column to PG10. > You can first submit the fix for dropped columns with patches till > v10. Once that is committed, then you can send the patches for > generated columns. Don't worry

Re: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-16 Thread Amit Kapila
On Fri, Mar 17, 2023 at 5:41 AM Tom Lane wrote: > > Amit Kapila writes: > > On Thu, Mar 16, 2023 at 9:33 PM Önder Kalacı wrote: > >>> and backpatch the fix for dropped column to PG10. > > > You can first submit the fix for dropped columns with patches till > > v10. Once that is committed, then y

Re: suppressing useless wakeups in logical/worker.c

2023-03-16 Thread Nathan Bossart
I've attached a minimally-updated patch that doesn't yet address the bigger topics under discussion. On Thu, Mar 16, 2023 at 03:30:37PM +0530, Amit Kapila wrote: > On Wed, Feb 1, 2023 at 5:35 AM Nathan Bossart > wrote: >> On Sat, Jan 28, 2023 at 10:26:25AM +0530, Amit Kapila wrote: >> > BTW, do

Re: Remove last traces of SCM credential auth from libpq?

2023-03-16 Thread Michael Paquier
On Thu, Mar 16, 2023 at 08:10:12PM -0400, Tom Lane wrote: > Maybe flush those special messages too? I'm not sure how long > they've been obsolete, though. KRB4 was switched in a159ad3 back in 2005, and KRB5 in 98de86e back in 2014 (deprecated in 8.3, so that's even older than creds). So yes, tha

Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode

2023-03-16 Thread Melanie Plageman
On Wed, Mar 15, 2023 at 9:03 PM Melanie Plageman wrote: > On Sat, Mar 11, 2023 at 2:16 PM Justin Pryzby wrote: > > On Sat, Mar 11, 2023 at 09:55:33AM -0500, Melanie Plageman wrote: > > This patch should add support in vacuumdb.c. And maybe a comment about > > adding support there, since it's ann

Re: slapd logs to syslog during tests

2023-03-16 Thread Andres Freund
Hi, On 2023-03-16 16:14:58 -0400, Andrew Dunstan wrote: > are you moving ahead with this? I got sidetracked trying to make slapd stop any and all syslog access, but it doesn't look like that's possible. But working on commiting the logfile-only approach now. Planning to backpatch this, unless som

Re: Allow logical replication to copy tables in binary format

2023-03-16 Thread Peter Smith
On Thu, Mar 16, 2023 at 1:55 PM Amit Kapila wrote: > > On Wed, Mar 15, 2023 at 3:33 PM Melih Mutlu wrote: > > > > Amit Kapila , 15 Mar 2023 Çar, 12:31 tarihinde > > şunu yazdı: > >> > >> On Tue, Mar 14, 2023 at 4:32 PM Melih Mutlu wrote: > > > > > >> > >> What purpose does this test serve w.r.t

  1   2   >