Re: Add mssing test to test_decoding/meson.build

2022-10-13 Thread Michael Paquier
On Thu, Oct 13, 2022 at 04:25:50AM +, kuroda.hay...@fujitsu.com wrote: > I found that the test catalog_change_snapshot was missed in > test_decoding/meson.build file. > PSA the patch to fix it. Thanks, applied. This was an oversight of 7f13ac8, and the CI accepts the test. -- Michael signa

Re: TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)

2022-10-13 Thread Amit Kapila
On Wed, Oct 12, 2022 at 11:18 AM Masahiko Sawada wrote: > > Summarizing this issue, the assertion check in AssertTXNLsnOrder() > fails as reported because the current logical decoding cannot properly > handle the case where the decoding restarts from NEW_CID. Since we > don't make the association

possible typo for CREATE PUBLICATION description

2022-10-13 Thread osumi.takami...@fujitsu.com
Hi, I noticed a possible typo in the doc for create publication. This applies to PG15 as well. Kindly have a look at the attached patch for it. Best Regards, Takamichi Osumi v1-0001-modify-a-typo.patch Description: v1-0001-modify-a-typo.patch

Re: possible typo for CREATE PUBLICATION description

2022-10-13 Thread Peter Smith
On Thu, Oct 13, 2022 at 6:16 PM osumi.takami...@fujitsu.com wrote: > > Hi, > > > I noticed a possible typo in the doc for create publication. > This applies to PG15 as well. > Kindly have a look at the attached patch for it. > > Your typo correction LGTM. FWIW, maybe other parts of that paragrap

Re: Pluggable toaster

2022-10-13 Thread Nikita Malakhov
Hi hackers, Fixed warning that failed build in previous patchset. Here's rebased patch: v23-0001-toaster-interface.patch - Pluggable TOAST API interface with reference (original) TOAST mechanics - new API is introduced but reference TOAST is still left unchanged; v23-0002-toaster-default.patch - D

RE: Add mssing test to test_decoding/meson.build

2022-10-13 Thread kuroda.hay...@fujitsu.com
Dear Michael, > Thanks, applied. This was an oversight of 7f13ac8, and the CI accepts > the test. I confirmed your commit. Great thanks! Best Regards, Hayato Kuroda FUJITSU LIMITED

Re: pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory

2022-10-13 Thread Bharath Rupireddy
On Thu, Sep 22, 2022 at 7:16 AM Bharath Rupireddy wrote: > > PSA v8 patch. I simplified the code a bit by using a fixed temporary file name (thanks Michael Paquier for the suggestion) much like the core does in XLogFileInitInternal(). If there's any left-over temp file from a crash or failure in

Re: SI-read predicate locks on materialized views

2022-10-13 Thread Michael Paquier
On Fri, Sep 30, 2022 at 10:12:13AM +0900, Yugo NAGATA wrote: > Thank you for comment. Do you think it can be marked as Ready for Commiter? Matviews have been discarded from needing predicate locks since 3bf3ab8 and their introduction, where there was no concurrent flavor of refresh yet. Shouldn't

Re: ExecRTCheckPerms() and many prunable partitions

2022-10-13 Thread Amit Langote
On Wed, Oct 12, 2022 at 10:50 PM Peter Eisentraut wrote: > On 06.10.22 15:29, Amit Langote wrote: > > I tried in the attached 0004. ModifyTable gets a new member > > extraUpdatedColsBitmaps, which is List of Bitmapset "nodes". > > > > Actually, List of Bitmapsets turned out to be something that d

Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant

2022-10-13 Thread Richard Guo
On Thu, Oct 13, 2022 at 2:48 PM David Rowley wrote: > On Thu, 13 Oct 2022 at 16:47, Richard Guo wrote: > > Currently in the patch the optimization is done before we check for > > presorted paths or do the explicit sort of the cheapest path. How about > > we move this optimization into the branch

libpq support for NegotiateProtocolVersion

2022-10-13 Thread Peter Eisentraut
We have the NegotiateProtocolVersion protocol message [0], but libpq doesn't actually handle it. Say I increase the protocol number in libpq: - conn->pversion = PG_PROTOCOL(3, 0); + conn->pversion = PG_PROTOCOL(3, 1); Then I get psql: error: connection to server on socket "/tmp/.s

Question about pull_up_sublinks_qual_recurse

2022-10-13 Thread Andy Fan
Hi: When I was working on another task, the following case caught my mind. create table t1(a int, b int, c int); create table t2(a int, b int, c int); create table t3(a int, b int, c int); explain (costs off) select * from t1 where exists (select 1 from t2 where exists (select 1 fr

Re: Refactor to introduce pg_strcoll().

2022-10-13 Thread Peter Eisentraut
On 07.10.22 01:15, Jeff Davis wrote: + * Call ucol_strcollUTF8(), ucol_strcoll(), strcoll(), strcoll_l(), wcscoll(), + * or wcscoll_l() as appropriate for the given locale, platform, and database + * encoding. Arguments must be NUL-terminated. If the locale is not specified, + * use the database

RE: [RFC] building postgres with meson - v13

2022-10-13 Thread shiy.f...@fujitsu.com
Hi, I noticed that `pg_config --configure` didn't show the options given when building with meson. For example, meson setup build -Dcache=gcc.cache -Ddtrace=enabled -Dicu=enabled -Dcassert=true -Dprefix=/home/postgres/install_meson/ meson compile -C build meson install -C build $ pg_config -

Re: Move backup-related code to xlogbackup.c/.h

2022-10-13 Thread Alvaro Herrera
On 2022-Oct-13, Bharath Rupireddy wrote: > On Wed, Oct 12, 2022 at 1:04 PM Alvaro Herrera > wrote: > > You added some commentary that these functions are tailor-made for > > internal operations, and then declared them in the most public header > > function that xlog has? I think at the bare mi

Lack of PageSetLSN in heap_xlog_visible

2022-10-13 Thread Konstantin Knizhnik
Hi hackers! heap_xlog_visible is not bumping heap page LSN when setting all-visible flag in it. There is long comment explaining it:    /*     * We don't bump the LSN of the heap page when setting the visibility     * map bit (unless checksums or wal_hint_bits is enabled, in w

Re: archive modules

2022-10-13 Thread Bharath Rupireddy
On Mon, Oct 10, 2022 at 1:17 PM Peter Eisentraut wrote: > > On 05.10.22 20:57, Nathan Bossart wrote: > >> What we are talking about here is, arguably, a misconfiguration, so it > >> should result in an error. > > > > Okay. What do you think about something like the attached? The intent here look

Re: Fast COPY FROM based on batch insert

2022-10-13 Thread Etsuro Fujita
On Thu, Oct 13, 2022 at 1:38 PM Andrey Lepikhov wrote: > On 10/12/22 07:56, Etsuro Fujita wrote: > > On Tue, Oct 11, 2022 at 3:06 PM Andrey Lepikhov > > wrote: > >> I reviewed the patch one more time. Only one question: bistate and > >> ri_FdwRoutine are strongly bounded. Maybe to add some assert

Re: Suppressing useless wakeups in walreceiver

2022-10-13 Thread Bharath Rupireddy
On Tue, Oct 11, 2022 at 11:22 PM Nathan Bossart wrote: > > On Tue, Oct 11, 2022 at 09:34:25AM +0530, Bharath Rupireddy wrote: > > now = t1; > > XLogWalRcvSendReply() /* say it ran for a minute or so for whatever reasons > > */ > > XLogWalRcvSendHSFeedback() /* with patch walrecevier sends hot sta

Re: Move backup-related code to xlogbackup.c/.h

2022-10-13 Thread Bharath Rupireddy
On Thu, Oct 13, 2022 at 3:12 PM Alvaro Herrera wrote: > > As I see it, xlog.h is a header that exports XLOG manipulations to the > outside world (everything that produces WAL, as well as stuff that > controls operation); xlog_internal is the header that exports xlog*.c > internal stuff for other x

Re: Allow tests to pass in OpenSSL FIPS mode

2022-10-13 Thread Peter Eisentraut
On 12.10.22 03:18, Michael Paquier wrote: On Tue, Oct 11, 2022 at 01:51:50PM +0200, Peter Eisentraut wrote: Let's make a small start on this. The attached patch moves the tests of the md5() function to a separate test file. That would ultimately make it easier to maintain a variant expected fi

Re: Make finding openssl program a configure or meson option

2022-10-13 Thread Peter Eisentraut
On 12.10.22 03:08, Michael Paquier wrote: On Tue, Oct 11, 2022 at 05:06:22PM +0200, Peter Eisentraut wrote: Various test suites use the "openssl" program as part of their setup. There isn't a way to override which openssl program is to be used, other than by fiddling with the path, perhaps. Thi

Re: Suppressing useless wakeups in walreceiver

2022-10-13 Thread Alvaro Herrera
I think in 0001 we should put more stuff in the state struct -- specifically these globals: static int recvFile = -1; static TimeLineID recvFileTLI = 0; static XLogSegNo recvSegNo = 0; The main reason is that it seems odd to have startpointTLI in the struct used in some places together with

Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant

2022-10-13 Thread David Rowley
On Thu, 13 Oct 2022 at 21:17, Richard Guo wrote: > > On Thu, Oct 13, 2022 at 2:48 PM David Rowley wrote: >> To stop the planner from adding that final sort, I opted to hack the >> LimitPath's pathkeys to say that it's already sorted by the >> PlannerInfo's sort_pathkeys. That feels slightly icky

Re: hash_xlog_split_allocate_page: failed to acquire cleanup lock

2022-10-13 Thread Amit Kapila
On Wed, Oct 12, 2022 at 4:16 PM vignesh C wrote: > > On Thu, 6 Oct 2022 at 12:44, Amit Kapila wrote: > > > > On Sat, Oct 1, 2022 at 12:35 AM Andres Freund wrote: > > > > > > This issue does occasionally happen in CI, as e.g. noted in this thread: > > > https://www.postgresql.org/message-id/20220

Re: Move backup-related code to xlogbackup.c/.h

2022-10-13 Thread Alvaro Herrera
On 2022-Oct-13, Bharath Rupireddy wrote: > Hm. Agree. But, that requires us to include xlogbackup.h in > xlog_internal.h for SessionBackupState enum in > ResetXLogBackupActivity(). Is that okay? It's not great, but it's not *that* bad, ISTM, mainly because xlog_internal.h will affect less stuff t

Re: Allow tests to pass in OpenSSL FIPS mode

2022-10-13 Thread Alvaro Herrera
On 2022-Oct-13, Peter Eisentraut wrote: > Right, that's the rest of my original patch. I'll come back with an updated > version of that. However, there are some changes in brin_multi.out that are quite surprising and suggest that we might have bugs in brin: +WARNING: unexpected number of resul

Re: Git tag for v15

2022-10-13 Thread Alvaro Herrera
On 2022-Oct-12, Matthias van de Meent wrote: > On Wed, 12 Oct 2022 at 20:08, Nemo wrote: > > Since v15 doesn't seem to be announced yet - this is confusing me. It > > doesn't impact us anywhere (yet), since we haven't added the v15 release > > cycle to our page yet, but I'd like to check if this

Re: possible typo for CREATE PUBLICATION description

2022-10-13 Thread Alvaro Herrera
Hello On 2022-Oct-13, osumi.takami...@fujitsu.com wrote: > I noticed a possible typo in the doc for create publication. > This applies to PG15 as well. > Kindly have a look at the attached patch for it. Yeah, looks good. It actually applies all the way back to 10, so I pushed it to all branches

RE: possible typo for CREATE PUBLICATION description

2022-10-13 Thread osumi.takami...@fujitsu.com
Hi, Alvaro-san On Thursday, October 13, 2022 8:38 PM Alvaro Herrera wrote: > On 2022-Oct-13, osumi.takami...@fujitsu.com wrote: > > > I noticed a possible typo in the doc for create publication. > > This applies to PG15 as well. > > Kindly have a look at the attached patch for it. > > Yeah, l

Re: Tracking last scan time

2022-10-13 Thread Dave Page
Hi On Wed, 12 Oct 2022 at 23:52, Andres Freund wrote: > Hi, > > On 2022-10-12 12:50:31 -0700, Andres Freund wrote: > > I think this should have at a basic test in > src/test/regress/sql/stats.sql. If > > I can write one in a few minutes I'll go for that, otherwise will reply > > detailing diffic

Re: Transparent column encryption

2022-10-13 Thread Peter Eisentraut
On 06.10.22 17:19, Andres Freund wrote: psql error: stderr: 'OPENSSL_Uplink(7FFC165CBD50,08): no OPENSSL_Applink' What in the world is that about? What scant information I could find suggests that it has something to do with building a "release" build against an "debug" build of the openssl

PG upgrade 14->15 fails - database contains our own extension

2022-10-13 Thread David Turoň
Hi community, I have problem with pg_upgrade. Tested from 14.5 to 15.0 rc2 when database contains our extension with one new type. Using pg_dump & restore works well. We made workaround extension for some usage in javascript library that contains new type that represents bigint as text. So some

Re: Transparent column encryption

2022-10-13 Thread Mark Woodward
If memory serves me correctly, if you statically link openssl this will work. If you are using ssl in a DLL, I believe that the DLL has its own "c-library" and its own heap. On Thu, Oct 13, 2022 at 9:43 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 06.10.22 17:19, Andres Fr

Re: Move backup-related code to xlogbackup.c/.h

2022-10-13 Thread Robert Haas
On Thu, Oct 13, 2022 at 7:13 AM Alvaro Herrera wrote: > On 2022-Oct-13, Bharath Rupireddy wrote: > > Hm. Agree. But, that requires us to include xlogbackup.h in > > xlog_internal.h for SessionBackupState enum in > > ResetXLogBackupActivity(). Is that okay? > > It's not great, but it's not *that* b

Re: Git tag for v15

2022-10-13 Thread Tom Lane
Alvaro Herrera writes: > If for whatever reason a problem is found before the tag has been > posted, then a new Git commit is chosen and a new tarball published. > The tag will then match the new commit, not the original obviously. > I don't know what would happen if a problem were to be found *af

Re: Move backup-related code to xlogbackup.c/.h

2022-10-13 Thread Bharath Rupireddy
On Thu, Oct 13, 2022 at 4:43 PM Alvaro Herrera wrote: > Thanks for reviewing. > > Hm. Agree. But, that requires us to include xlogbackup.h in > > xlog_internal.h for SessionBackupState enum in > > ResetXLogBackupActivity(). Is that okay? > > It's not great, but it's not *that* bad, ISTM, mainly

Re: PG upgrade 14->15 fails - database contains our own extension

2022-10-13 Thread Robert Haas
On Thu, Oct 13, 2022 at 9:57 AM David Turoň wrote: > pg_restore: creating TYPE "public.lbuid" > pg_restore: creating CAST "CAST (integer AS "public"."lbuid")" > pg_restore: while PROCESSING TOC: > pg_restore: from TOC entry 3751; 2605 16393 CAST CAST (integer AS > "public"."lbuid") (no owner) > p

Re: Bloom filter Pushdown Optimization for Merge Join

2022-10-13 Thread Zhihong Yu
On Wed, Oct 12, 2022 at 4:35 PM Zhihong Yu wrote: > > > On Wed, Oct 12, 2022 at 3:36 PM Lyu Pan wrote: > >> Hello Zhihong Yu & Tomas Vondra, >> >> Thank you so much for your review and feedback! >> >> We made some updates based on previous feedback and attached the new >> patch set. Due to time

Re: PG upgrade 14->15 fails - database contains our own extension

2022-10-13 Thread Tom Lane
Robert Haas writes: > CREATE CAST (integer AS public.lbuid) WITH FUNCTION > pg_catalog.int8(integer) AS IMPLICIT; > CREATE CAST (bigint AS public.lbuid) WITHOUT FUNCTION AS IMPLICIT; > CREATE CAST (public.lbuid AS bigint) WITHOUT FUNCTION AS IMPLICIT; > That's not a valid dump ordering, and if I

Re: PG upgrade 14->15 fails - database contains our own extension

2022-10-13 Thread Tom Lane
I wrote: > Hmm ... I think it's a very ancient bug that somehow David has avoided > tripping over up to now. Looking closer, I don't see how b55f2b692 could have changed pg_dump's opinion of the order to sort these three casts in; that sort ordering logic is old enough to vote. So I'm guessing th

Is anybody planning to release pglogical for v15 ?

2022-10-13 Thread Hannu Krosing
So, is anybody planning to release pglogical for v15 ? There are still a few things that one can do in pglogical but not in native / built0in replication ... Best Regards Hannu

Re: Bloom filter Pushdown Optimization for Merge Join

2022-10-13 Thread Zhihong Yu
On Thu, Oct 13, 2022 at 7:30 AM Zhihong Yu wrote: > > > On Wed, Oct 12, 2022 at 4:35 PM Zhihong Yu wrote: > >> >> >> On Wed, Oct 12, 2022 at 3:36 PM Lyu Pan wrote: >> >>> Hello Zhihong Yu & Tomas Vondra, >>> >>> Thank you so much for your review and feedback! >>> >>> We made some updates based

Re: [RFC] building postgres with meson - v13

2022-10-13 Thread Andres Freund
Hi, On 2022-10-13 09:24:51 +, shiy.f...@fujitsu.com wrote: > I noticed that `pg_config --configure` didn't show the options given when > building with meson. Yes, that was noted somewhere on this thread. > Maybe it would be better if pg_config can output this information, to be > consistent

Re: Summary function for pg_buffercache

2022-10-13 Thread Andres Freund
Hi, On 2022-10-12 12:27:54 -0700, Andres Freund wrote: > I intentionally put my changes into a fixup commit, in case you want to look > at the differences. I pushed the (combined) patch now. Thanks for your contribution! Greetings, Andres Freund

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2022-10-13 Thread Melanie Plageman
On Mon, Oct 10, 2022 at 7:43 PM Maciek Sakrejda wrote: > > Thanks for working on this! Like Lukas, I'm excited to see more > visibility into important parts of the system like this. Thanks for taking another look! > > On Mon, Oct 10, 2022 at 11:49 AM Melanie Plageman > wrote: > > > > I've gone

Re: Support tls-exporter as channel binding for TLSv1.3

2022-10-13 Thread Jacob Champion
On Wed, Oct 12, 2022 at 11:01 PM Michael Paquier wrote: > One thing that would reduce the complexity of the equation is > to drop support for tls-server-end-point in the backend in PG >= 16 as > the versions of OpenSSL we still support on HEAD would cover > completely tls-exporter. Is the intent

Re: Suppressing useless wakeups in walreceiver

2022-10-13 Thread Nathan Bossart
On Thu, Oct 13, 2022 at 03:35:14PM +0530, Bharath Rupireddy wrote: > I think the hot standby feedback message gets sent too frequently > without honouring the wal_receiver_status_interval because the 'now' > is actually not the current time with your patch but 'now + > XLogWalRcvSendReply()'s time'

remove redundant memset() call

2022-10-13 Thread Zhihong Yu
Hi, I was looking at combo_init in contrib/pgcrypto/px.c . There is a memset() call following palloc0() - the call is redundant. Please see the patch for the proposed change. Thanks remove-redundant-memset-call.patch Description: Binary data

Re: archive modules

2022-10-13 Thread Nathan Bossart
On Thu, Oct 13, 2022 at 03:25:27PM +0530, Bharath Rupireddy wrote: > The intent here looks reasonable to me. However, why should the user > be able to set both archive_command and archive_library in the first > place only to later fail in LoadArchiveLibrary() per the patch? IMO, > the check_hook()

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

2022-10-13 Thread Andres Freund
Hi, On 2022-10-07 07:26:08 +0200, Pavel Stehule wrote: > I am sending version with handy written parser and meson support Given this is a new approach it seems inaccurate to have the CF entry marked ready-for-committer. I've updated it to needs-review. Greetings, Andres Freund

Re: PG upgrade 14->15 fails - database contains our own extension

2022-10-13 Thread Tom Lane
I wrote: > We might be able to put in some kluge in pg_dump to make it less > likely to fail with existing DBs, but I think the true fix lies > in adding that dependency. Here's a draft patch for that. I'm unsure whether it's worth back-patching; even if we did, we couldn't guarantee that existin

Re: archive modules

2022-10-13 Thread Tom Lane
Nathan Bossart writes: > On Thu, Oct 13, 2022 at 03:25:27PM +0530, Bharath Rupireddy wrote: >> The intent here looks reasonable to me. However, why should the user >> be able to set both archive_command and archive_library in the first >> place only to later fail in LoadArchiveLibrary() per the pa

Re: Suppressing useless wakeups in walreceiver

2022-10-13 Thread Nathan Bossart
On Thu, Oct 13, 2022 at 12:37:39PM +0200, Alvaro Herrera wrote: > I think in 0001 we should put more stuff in the state struct -- > specifically these globals: > > static intrecvFile = -1; > static TimeLineID recvFileTLI = 0; > static XLogSegNo recvSegNo = 0; > > The main reason is that it se

Re: remove redundant memset() call

2022-10-13 Thread Bruce Momjian
On Thu, Oct 13, 2022 at 10:55:08AM -0700, Zhihong Yu wrote: > Hi, > I was looking at combo_init in contrib/pgcrypto/px.c . > > There is a memset() call following palloc0() - the call is redundant. > > Please see the patch for the proposed change. > > Thanks > diff --git a/contrib/pgcrypto/px.c

Re: remove redundant memset() call

2022-10-13 Thread Zhihong Yu
On Thu, Oct 13, 2022 at 12:10 PM Bruce Momjian wrote: > On Thu, Oct 13, 2022 at 10:55:08AM -0700, Zhihong Yu wrote: > > Hi, > > I was looking at combo_init in contrib/pgcrypto/px.c . > > > > There is a memset() call following palloc0() - the call is redundant. > > > > Please see the patch for the

Re: remove redundant memset() call

2022-10-13 Thread Bruce Momjian
On Thu, Oct 13, 2022 at 12:12:35PM -0700, Zhihong Yu wrote: > On Thu, Oct 13, 2022 at 12:10 PM Bruce Momjian wrote: > > On Thu, Oct 13, 2022 at 10:55:08AM -0700, Zhihong Yu wrote: > > Hi, > > I was looking at combo_init in contrib/pgcrypto/px.c . > > > > There is a memset() ca

Re: remove redundant memset() call

2022-10-13 Thread Nathan Bossart
On Thu, Oct 13, 2022 at 03:15:13PM -0400, Bruce Momjian wrote: > On Thu, Oct 13, 2022 at 12:12:35PM -0700, Zhihong Yu wrote: >> the memory has been zero'ed out by palloc0(). >> >> memcpy is not relevant w.r.t. resetting memory. > > Ah, good point. Yeah, it looks like this was missed in ca7f8e2.

Re: remove redundant memset() call

2022-10-13 Thread Daniel Gustafsson
> On 13 Oct 2022, at 21:18, Nathan Bossart wrote: > > On Thu, Oct 13, 2022 at 03:15:13PM -0400, Bruce Momjian wrote: >> On Thu, Oct 13, 2022 at 12:12:35PM -0700, Zhihong Yu wrote: >>> the memory has been zero'ed out by palloc0(). >>> >>> memcpy is not relevant w.r.t. resetting memory. >> >> Ah,

New "single-call SRF" APIs are very confusingly named

2022-10-13 Thread Andres Freund
Hi, I unfortunately just noticed this now, just after we released... In commit 9e98583898c347e007958c8a09911be2ea4acfb9 Author: Michael Paquier Date: 2022-03-07 10:26:29 +0900 Create routine able to set single-call SRFs for Materialize mode a new helper was added: #define SRF_SINGLE_U

Re: Lack of PageSetLSN in heap_xlog_visible

2022-10-13 Thread Jeff Davis
On Thu, 2022-10-13 at 12:50 +0300, Konstantin Knizhnik wrote: >     /* >      * We don't bump the LSN of the heap page when setting the > visibility >      * map bit (unless checksums or wal_hint_bits is enabled, in > which >      * case we must), because that would generate an

Re: remove redundant memset() call

2022-10-13 Thread Bruce Momjian
On Thu, Oct 13, 2022 at 09:40:42PM +0200, Daniel Gustafsson wrote: > > On 13 Oct 2022, at 21:18, Nathan Bossart wrote: > > > > On Thu, Oct 13, 2022 at 03:15:13PM -0400, Bruce Momjian wrote: > >> On Thu, Oct 13, 2022 at 12:12:35PM -0700, Zhihong Yu wrote: > >>> the memory has been zero'ed out by p

Re: hash_xlog_split_allocate_page: failed to acquire cleanup lock

2022-10-13 Thread Andres Freund
Hi, On 2022-10-06 12:44:24 +0530, Amit Kapila wrote: > On Sat, Oct 1, 2022 at 12:35 AM Andres Freund wrote: > > My problem with this approach is that the whole cleanup lock is hugely > > misleading as-is. As I noted in > > https://www.postgresql.org/message-id/20220817193032.z35vdjhpzkgldrd3%40aw

Re: libpq support for NegotiateProtocolVersion

2022-10-13 Thread Nathan Bossart
On Thu, Oct 13, 2022 at 10:33:01AM +0200, Peter Eisentraut wrote: > + if (their_version != conn->pversion) Shouldn't this be 'their_version < conn->pversion'? If the server supports a later protocol than what is requested but not all the requested protocol extensions, I think libpq would stil

WIP: Analyze whether our docs need more granular refentries.

2022-10-13 Thread Corey Huinker
In reviewing another patch, I noticed that the documentation had an xref to a fairly large page of documentation (create_table.sgml), and I wondered if that link was chosen because the original author genuinely felt the entire page was relevant, or merely because a more granular link did not exist

Re: GUC values - recommended way to declare the C variables?

2022-10-13 Thread Nathan Bossart
On Thu, Oct 13, 2022 at 09:47:25AM +0900, Michael Paquier wrote: > So, the initial values of max_wal_senders and max_replication_slots > became out of sync with their defaults in guc_tables.c. FWIW, I would > argue the opposite way: rather than removing the initializations, I > would fix and keep

Re: New docs chapter on Transaction Management and related changes

2022-10-13 Thread Bruce Momjian
On Tue, Sep 13, 2022 at 03:02:34PM +0100, Simon Riggs wrote: > Thanks Robert. I've tried to accommodate all of your thoughts, plus Alvaro's. > > New v5 attached. > > Happy to receive further comments. I liked this patch very much. It gives details on a lot of the internals we expose to users.

Re: Allow WindowFuncs prosupport function to use more optimal WindowClause options

2022-10-13 Thread Zhihong Yu
On Wed, Oct 12, 2022 at 5:35 PM David Rowley wrote: > On Wed, 12 Oct 2022 at 16:33, Vik Fearing wrote: > > Per spec, the ROW_NUMBER() window function is not even allowed to have a > > frame specified. > > > > b) The window framing clause of WDX shall not be present. > > > > Also, the specif

Incorrect comment regarding command completion tags

2022-10-13 Thread David Rowley
I was looking at the code in EndCommand() and noticed a comment talking about some Asserts which didn't seem to exist in the code. The comment also talks about LastOid which looks like the name of a variable that's nowhere to be seen. It looks like the Asserts did exists when the completion tag pa

Re: New docs chapter on Transaction Management and related changes

2022-10-13 Thread Erik Rijkers
Op 13-10-2022 om 23:28 schreef Bruce Momjian: On Tue, Sep 13, 2022 at 03:02:34PM +0100, Simon Riggs wrote: Thanks Robert. I've tried to accommodate all of your thoughts, plus Alvaro's. New v5 attached. Happy to receive further comments. I liked this patch very much. It gives details on a lo

Re: remove redundant memset() call

2022-10-13 Thread Daniel Gustafsson
> On 13 Oct 2022, at 21:59, Bruce Momjian wrote: > > On Thu, Oct 13, 2022 at 09:40:42PM +0200, Daniel Gustafsson wrote: >>> On 13 Oct 2022, at 21:18, Nathan Bossart wrote: >>> >>> On Thu, Oct 13, 2022 at 03:15:13PM -0400, Bruce Momjian wrote: On Thu, Oct 13, 2022 at 12:12:35PM -0700, Zhiho

Re: New docs chapter on Transaction Management and related changes

2022-10-13 Thread Bruce Momjian
On Thu, Oct 13, 2022 at 11:54:51PM +0200, Erik Rijkers wrote: > > [xact.diff] > > I think that > 'This chapter explains how the control the reliability of' > > should be: > 'This chapter explains how to control the reliability of' > > > And in these lines: > + together in a transactional ma

Re: Incorrect comment regarding command completion tags

2022-10-13 Thread Mark Dilger
> On Oct 13, 2022, at 2:56 PM, David Rowley wrote: > > I was looking at the code in EndCommand() and noticed a comment > talking about some Asserts which didn't seem to exist in the code. > The comment also talks about LastOid which looks like the name of a > variable that's nowhere to be seen

Re: problems with making relfilenodes 56-bits

2022-10-13 Thread Matthias van de Meent
On Wed, 12 Oct 2022 at 23:13, Andres Freund wrote: > > Hi, > > On 2022-10-12 22:05:30 +0200, Matthias van de Meent wrote: > > On Wed, 5 Oct 2022 at 01:50, Andres Freund wrote: > > > I light dusted off my old varint implementation from [1] and converted the > > > RelFileLocator and BlockNumber fro

Re: archive modules

2022-10-13 Thread Michael Paquier
On Thu, Oct 13, 2022 at 02:53:38PM -0400, Tom Lane wrote: > Yeah, it really does not work to use GUC hooks to enforce multi-variable > constraints. We've learned that the hard way (more than once, if memory > serves). 414c2fd is one of the most recent ones. Its thread is about the same thing. --

Re: hash_xlog_split_allocate_page: failed to acquire cleanup lock

2022-10-13 Thread Peter Geoghegan
On Fri, Sep 30, 2022 at 12:05 PM Andres Freund wrote: > My problem with this approach is that the whole cleanup lock is hugely > misleading as-is. While nbtree VACUUM does use cleanup locks, they don't protect the index structure itself -- it actually functions as an interlock against concurrent

Re: hash_xlog_split_allocate_page: failed to acquire cleanup lock

2022-10-13 Thread Andres Freund
Hi, On 2022-10-13 17:46:25 -0700, Peter Geoghegan wrote: > On Fri, Sep 30, 2022 at 12:05 PM Andres Freund wrote: > > My problem with this approach is that the whole cleanup lock is hugely > > misleading as-is. > > While nbtree VACUUM does use cleanup locks, they don't protect the > index structur

Re: hash_xlog_split_allocate_page: failed to acquire cleanup lock

2022-10-13 Thread Peter Geoghegan
On Thu, Oct 13, 2022 at 6:10 PM Andres Freund wrote: > My point here is a lot more mundane. The code essentially does > _hash_pageinit(), overwriting the whole page, and *then* conditionally > acquires a cleanup lock. It simply is bogus code. I understood that that was what you meant. It's easy

Re: New "single-call SRF" APIs are very confusingly named

2022-10-13 Thread Michael Paquier
On Thu, Oct 13, 2022 at 12:48:20PM -0700, Andres Freund wrote: > I unfortunately just noticed this now, just after we released... Thanks for the feedback. > Even leaving the confusion with ExprSingleResult aside, calling it "Single" > still seems very non-descriptive. I assume it's named to contr

Re: New "single-call SRF" APIs are very confusingly named

2022-10-13 Thread Andres Freund
Hi, On 2022-10-14 10:28:34 +0900, Michael Paquier wrote: > On Thu, Oct 13, 2022 at 12:48:20PM -0700, Andres Freund wrote: > > Maybe something like InitMaterializedSRF() w/ > > MAT_SRF_(USE_EXPECTED_DESC|BLESS) > > Or just SetMaterializedFuncCall()? I think starting any function that's not a sett

Re: Incorrect comment regarding command completion tags

2022-10-13 Thread David Rowley
On Fri, 14 Oct 2022 at 11:38, Mark Dilger wrote: > > > On Oct 13, 2022, at 2:56 PM, David Rowley wrote: > > In the attached, I rewrote the comment to remove mention of the > > Asserts. I also tried to form the comment in a way that's more > > understandable about why we always write a "0" in "INS

Re: Support tls-exporter as channel binding for TLSv1.3

2022-10-13 Thread Michael Paquier
On Thu, Oct 13, 2022 at 10:30:37AM -0700, Jacob Champion wrote: > Is the intent to backport tls-exporter client support? Or is the > compatibility break otherwise acceptable? Well, I'd rather say yes thanks to the complexity avoided in the backend as that's the most sensible piece security-wise, e

Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant

2022-10-13 Thread Richard Guo
On Thu, Oct 13, 2022 at 6:43 PM David Rowley wrote: > On Thu, 13 Oct 2022 at 21:17, Richard Guo wrote: > > > > On Thu, Oct 13, 2022 at 2:48 PM David Rowley > wrote: > >> To stop the planner from adding that final sort, I opted to hack the > >> LimitPath's pathkeys to say that it's already sorte

Re: GUC values - recommended way to declare the C variables?

2022-10-13 Thread Peter Smith
On Fri, Oct 14, 2022 at 8:26 AM Nathan Bossart wrote: > > On Thu, Oct 13, 2022 at 09:47:25AM +0900, Michael Paquier wrote: > > So, the initial values of max_wal_senders and max_replication_slots > > became out of sync with their defaults in guc_tables.c. FWIW, I would > > argue the opposite way:

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

2022-10-13 Thread shiy.f...@fujitsu.com
On Wed, Aug 24, 2022 12:25 AM Önder Kalacı wrote: > Hi, > > Thanks for the review! > Thanks for your reply. > > > > > 1. > > In FilterOutNotSuitablePathsForReplIdentFull(), is > > "nonPartialIndexPathList" a > > good name for the list? Indexes on only expressions are also be filtered. > > > >

Re: create subscription - improved warning message

2022-10-13 Thread Peter Smith
On Thu, Oct 13, 2022 at 9:07 AM Peter Smith wrote: > > On Thu, Oct 13, 2022 at 2:01 AM Tom Lane wrote: > > > > Alvaro Herrera writes: > > > On 2022-Oct-12, Amit Kapila wrote: > > >> Okay, then I think we can commit the last error message patch of Peter > > >> [1] as we have an agreement on the s

Fix error message for MERGE foreign tables

2022-10-13 Thread bt22nakamorit
Hi, MERGE command does not accept foreign tables as targets. When a foreign table is specified as a target, it shows error messages like this: -- ERROR: cannot execute MERGE on relation "child1" -- DETAIL: This operation is not supported for foreign tables. However, when a partitioned table

[meson] add missing pg_attribute_aligned for MSVC in meson build

2022-10-13 Thread Junwang Zhao
Hi Andres, Commit ec3c9cc add pg_attribute_aligned in MSVC[1], which was pushed one day before the meson commits, so meson build missed this feature. [1]: https://www.postgresql.org/message-id/caaaqye-hbtzvr3msomtk+hyw2s0e0oapzmw8icsmytma+mn...@mail.gmail.com -- Regards Junwang Zhao 0001-mes

Re: GUC values - recommended way to declare the C variables?

2022-10-13 Thread Tom Lane
Peter Smith writes: > I agree if constants are used in both places then there will always be > some risk they can get out of sync again. Yeah. > But probably it is no problem to just add #defines (e.g. in > logicallauncher.h?) to be commonly used for the C variable declaration > and also in the

RE: [RFC] building postgres with meson - v13

2022-10-13 Thread shiy.f...@fujitsu.com
On Fri, Oct 14, 2022 12:40 AM Andres Freund wrote: > > Hi, > > On 2022-10-13 09:24:51 +, shiy.f...@fujitsu.com wrote: > > I noticed that `pg_config --configure` didn't show the options given when > > building with meson. > > Yes, that was noted somewhere on this thread. > > > > Maybe it w

Re: [RFC] building postgres with meson - v13

2022-10-13 Thread Tom Lane
"shiy.f...@fujitsu.com" writes: > On Fri, Oct 14, 2022 12:40 AM Andres Freund wrote: >> It'd be a fair amount of work, both initially and to maintain it, to generate >> something compatible. I can see some benefit in showing some feature >> influencing output in --configure, but compatible output

Re: GUC values - recommended way to declare the C variables?

2022-10-13 Thread Michael Paquier
On Thu, Oct 13, 2022 at 11:14:57PM -0400, Tom Lane wrote: > Could we fix the out-of-sync risk by having InitializeGUCOptions insist > that the pre-existing value of the variable match what is in guc_tables.c? > That may not work for string values but I think we could insist on it > for other GUC da

Re: GUC values - recommended way to declare the C variables?

2022-10-13 Thread Tom Lane
Michael Paquier writes: > On Thu, Oct 13, 2022 at 11:14:57PM -0400, Tom Lane wrote: >> For strings, maybe the rule could be "the >> old value must be NULL or strcmp-equal to the boot_val". > pg_strcasecmp()'d would be more flexible here? Don't see the point for that. The case we're talking abou

Re: Fix error message for MERGE foreign tables

2022-10-13 Thread Richard Guo
On Fri, Oct 14, 2022 at 10:59 AM bt22nakamorit < bt22nakamo...@oss.nttdata.com> wrote: > Hi, > > MERGE command does not accept foreign tables as targets. > When a foreign table is specified as a target, it shows error messages > like this: > > -- ERROR: cannot execute MERGE on relation "child1" >

Re: Fix error message for MERGE foreign tables

2022-10-13 Thread Richard Guo
On Fri, Oct 14, 2022 at 12:07 PM Richard Guo wrote: > > On Fri, Oct 14, 2022 at 10:59 AM bt22nakamorit < > bt22nakamo...@oss.nttdata.com> wrote: > >> Hi, >> >> MERGE command does not accept foreign tables as targets. >> When a foreign table is specified as a target, it shows error messages >> lik

Re: Perform streaming logical transactions by background workers and parallel apply

2022-10-13 Thread Amit Kapila
On Wed, Oct 12, 2022 at 7:41 AM wangw.f...@fujitsu.com wrote: > > On Fri, Oct 7, 2022 at 14:18 PM Hou, Zhijie/侯 志杰 > wrote: > > Attach the new version patch set which addressed most of the comments. > > Rebased the patch set because the new change in HEAD (776e1c8). > > Attach the new patch set.

thinko in basic_archive.c

2022-10-13 Thread Nathan Bossart
Hi hackers, I intended for the temporary file name generated by basic_archive.c to include the current timestamp so that the name was "sufficiently unique." Of course, this could also be used to determine the creation time, but you can just as easily use stat(1) for that. In any case, I forgot to

Re: make_ctags: use -I option to ignore pg_node_attr macro

2022-10-13 Thread Yugo NAGATA
On Thu, 13 Oct 2022 15:35:09 +0900 (JST) Tatsuo Ishii wrote: > > OK, that sounds good then. I would make a feature request to have a > > switch that supresses creation of these links, then. > > Ok, I have added "-n" option to make_ctags so that it skips to create > the links. > > Also I have c

Re: hash_xlog_split_allocate_page: failed to acquire cleanup lock

2022-10-13 Thread Amit Kapila
On Fri, Oct 14, 2022 at 2:25 AM Andres Freund wrote: > > > > > Attached are two patches. The first patch is what Robert has proposed > > with some changes in comments to emphasize the fact that cleanup lock > > on the new bucket is just to be consistent with the old bucket page > > locking as we a

Re: Patch proposal: make use of regular expressions for the username in pg_hba.conf

2022-10-13 Thread Michael Paquier
On Wed, Oct 12, 2022 at 08:17:14AM +0200, Drouvot, Bertrand wrote: > Indeed, ;-) So, I have spent the last two days looking at all that, studying the structure of the patch and the existing HEAD code, and it looks like that a few things could be consolidated. First, as of HEAD, AuthToken is only

  1   2   >