Re: [PoC] Improve dead tuple storage for lazy vacuum

2023-02-22 Thread Masahiko Sawada
On Wed, Feb 22, 2023 at 4:35 PM John Naylor wrote: > > > On Wed, Feb 22, 2023 at 1:16 PM Masahiko Sawada wrote: > > > > On Mon, Feb 20, 2023 at 2:56 PM Masahiko Sawada > > wrote: > > > > > > Yeah, I did a similar thing in an earlier version of tidstore patch. > > Okay, if you had checks

pgindent vs. git whitespace check

2023-02-22 Thread Peter Eisentraut
Commit e4602483e95 accidentally introduced a situation where pgindent disagrees with the git whitespace check. The code is conn = libpqsrv_connect_params(keywords, values, /* expand_dbname = */ false,

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Jim Jones
On 22.02.23 08:05, Nikolay Samokhvalov wrote: But is this as expected? Shouldn't it be like this:   text   13 ? Oracle and other parsers I know also do not work well with mixed contents.[1,2] I believe libxml2's parser does not know where to put the newline, as mixed values can contain

RE: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes

2023-02-22 Thread shiy.f...@fujitsu.com
On Wed, Feb 22, 2023 2:20 PM Michael Paquier wrote: > > On Wed, Feb 22, 2023 at 12:07:06PM +0900, Kyotaro Horiguchi wrote: > > At Wed, 22 Feb 2023 12:29:59 +1100, Peter Smith > wrote in > >> If you are going to do that, then won't just copying the > >>

Re: Allow logical replication to copy tables in binary format

2023-02-22 Thread Jelte Fennema
> If in future version the general data type is added, the copy command in > binary > format will not work well, right? It is because the inferior version does not > have > recv/send functions for added type. It means that there is a possibility that > replication between different versions may

Re: LWLock deadlock in brinRevmapDesummarizeRange

2023-02-22 Thread Alvaro Herrera
On 2023-Feb-22, Tomas Vondra wrote: > But instead of I almost immediately ran into a LWLock deadlock :-( Ouch. > I've managed to reproduce this on PG13+, but I believe it's there since > the brinRevmapDesummarizeRange was introduced in PG10. I just haven't > tried on pre-13 releases. Hmm, I

unsafe_tests module

2023-02-22 Thread Andrew Dunstan
Given its nature and purpose as a module we don't want to run against an installed instance, shouldn't src/test/modules/unsafe_tests have NO_INSTALLCHECK=1 in its Makefile and runningcheck:false in its meson.build? cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com

Re: Time delayed LR (WAS Re: logical replication restrictions)

2023-02-22 Thread Amit Kapila
On Tue, Feb 21, 2023 at 1:28 PM Hayato Kuroda (Fujitsu) wrote: > > > doc/src/sgml/catalogs.sgml > > > > 4. > > + > > + > > + subminsenddelay int4 > > + > > + > > + The minimum delay, in milliseconds, by the publisher to send changes > > + > > + > > >

Re: Fix GUC_NO_SHOW_ALL test scenario in 003_check_guc.pl

2023-02-22 Thread Heikki Linnakangas
On 14/02/2023 03:42, Kyotaro Horiguchi wrote: At Mon, 13 Feb 2023 12:18:07 +0900, Michael Paquier wrote in On Mon, Feb 13, 2023 at 11:27:58AM +0900, Kyotaro Horiguchi wrote: I think currently the output by --describe-config can be used only for consulting while editing a (possiblly broken)

Re: meson: Optionally disable installation of test modules

2023-02-22 Thread Peter Eisentraut
On 20.02.23 20:48, Andres Freund wrote: On 2023-02-20 19:43:56 +0100, Peter Eisentraut wrote: I don't think any callers try to copy a directory source, so the shutil.copytree() stuff isn't necessary. I'd like to use it for installing docs outside of the normal install target. Of course we

Re: Refactor calculations to use instr_time

2023-02-22 Thread Nazir Bilal Yavuz
Hi, Thanks for the review. On Wed, 22 Feb 2023 at 05:50, Kyotaro Horiguchi wrote: > > PgStat_PendingStats should be included in typedefs.list. Done. > > + * Created for accumulating wal_write_time and wal_sync_time as a instr_time > + * but instr_time can't be used as a type where it ends up

Re: Transparent column encryption

2023-02-22 Thread Peter Eisentraut
On 11.02.23 22:54, Mark Dilger wrote: Thanks Peter. Here are some observations about the documentation in patch version 15. In acronyms.sgml, the CEK and CMK entries should link to documentation, perhaps linkend="glossary-column-encryption-key" and linkend="glossary-column-master-key".

Re: Transparent column encryption

2023-02-22 Thread Peter Eisentraut
On 12.02.23 15:48, Mark Dilger wrote: I should mention, src/sgml/html/libpq-exec.html needs clarification: paramFormats[]Specifies whether parameters are text (put a zero in the array entry for the corresponding parameter) or binary (put a one in the array entry for the corresponding

Re: ANY_VALUE aggregate

2023-02-22 Thread Peter Eisentraut
On 09.02.23 10:42, Vik Fearing wrote: v4 attached.  I am putting this back to Needs Review in the commitfest app, but these changes were editorial so it is probably RfC like Peter had set it.  I will let you be the judge of that. I have committed this. I made a few small last-minute tweaks:

Re: refactoring relation extension and BufferAlloc(), faster COPY

2023-02-22 Thread Heikki Linnakangas
On 21/02/2023 21:22, Andres Freund wrote: On 2023-02-21 18:18:02 +0200, Heikki Linnakangas wrote: Is it ever possible to call this without a relcache entry? WAL redo functions do that with ReadBuffer, but they only extend a relation implicitly, by replay a record for a particular block. I

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Jim Jones
On 22.02.23 08:20, Peter Smith wrote: Here are some review comments for patch v15-0001 FYI, the patch applies clean and tests OK for me. == doc/src/sgml/datatype.sgml 1. XMLSERIALIZE ( { DOCUMENT | CONTENT } value AS type [ { NO INDENT | INDENT } ] ) ~ Another/shorter way to write that

Re: Amcheck verification of GiST and GIN

2023-02-22 Thread Michael Banck
Hi, On Thu, Feb 02, 2023 at 12:56:47PM -0800, Nikolay Samokhvalov wrote: > On Thu, Feb 2, 2023 at 12:43 PM Peter Geoghegan wrote: > > I think that that problem should be solved at a higher level, in the > > program that runs amcheck. Note that pg_amcheck will already do this > > for B-Tree

Re: Incorrect command tag row count for MERGE with a cross-partition update

2023-02-22 Thread Dean Rasheed
On Tue, 21 Feb 2023 at 09:34, Alvaro Herrera wrote: > > > I think the best fix is to have ExecMergeMatched() pass canSetTag = > > false to ExecUpdateAct(), so that ExecMergeMatched() takes > > responsibility for updating estate->es_processed in all cases. > > Sounds sensible. > I decided it was

Re: logical decoding and replication of sequences, take 2

2023-02-22 Thread Tomas Vondra
On 2/22/23 03:28, Jonathan S. Katz wrote: > Hi, > > On 2/16/23 10:50 AM, Tomas Vondra wrote: >> Hi, >> >> Here's a rebased patch, without the last bit which is now unnecessary >> thanks to c981d9145dea. > > Thanks for continuing to work on this patch! I tested the latest version > and have

Re: Assert failure with MERGE into partitioned table with RLS

2023-02-22 Thread Dean Rasheed
On Mon, 20 Feb 2023 at 16:18, Dean Rasheed wrote: > > As part of the MERGE RETURNING patch I noticed a suspicious Assert() > in ExecInitPartitionInfo() that looked like it needed updating for > MERGE. > > After more testing, I can confirm that this is indeed a pre-existing > bug, that can be

Re: Weird failure with latches in curculio on v15

2023-02-22 Thread Thomas Munro
On Tue, Feb 21, 2023 at 5:50 PM Nathan Bossart wrote: > On Tue, Feb 21, 2023 at 09:03:27AM +0900, Michael Paquier wrote: > > Perhaps beginning a new thread with a patch and a summary would be > > better at this stage? Another thing I am wondering is if it could be > > possible to test that

Re: [PoC] Improve dead tuple storage for lazy vacuum

2023-02-22 Thread John Naylor
On Wed, Feb 22, 2023 at 3:29 PM Masahiko Sawada wrote: > > On Wed, Feb 22, 2023 at 4:35 PM John Naylor > wrote: > > > > I don't think any vacuum calls in regression tests would stress any of this code very much, so it's not worth carrying the old way forward. I was thinking of only doing this

LWLock deadlock in brinRevmapDesummarizeRange

2023-02-22 Thread Tomas Vondra
Hi, While finalizing some fixes in BRIN, I decided to stress-test the relevant part of the code to check if I missed something. Imagine a simple script that builds BRIN indexes on random data, does random changes and cross-checks the results with/without the index. But instead of I almost

Re: Disable rdns for Kerberos tests

2023-02-22 Thread Heikki Linnakangas
On 21/02/2023 01:35, Stephen Frost wrote: Greetings, The name canonicalization support for Kerberos is doing us more harm than good in the regression tests, so I propose we disable it. Patch attached. Thoughts? Makes sense. A brief comment in 001_auth.pl itself to mention why we disable

Re: LWLock deadlock in brinRevmapDesummarizeRange

2023-02-22 Thread Tomas Vondra
On 2/22/23 12:35, Alvaro Herrera wrote: > On 2023-Feb-22, Tomas Vondra wrote: > >> But instead of I almost immediately ran into a LWLock deadlock :-( > > Ouch. > >> I've managed to reproduce this on PG13+, but I believe it's there since >> the brinRevmapDesummarizeRange was introduced in

Re: meson: Non-feature feature options

2023-02-22 Thread Peter Eisentraut
On 21.02.23 17:32, Nazir Bilal Yavuz wrote: I like the second approach, with a 'uuid' feature option. As you wrote earlier, adding an 'auto' choice to a combo option doesn't work fully like a real feature option. But we can make it behave exactly like one, by checking the auto_features option.

Re: [PATCH] Support SK_SEARCHNULL / SK_SEARCHNOTNULL for heap-only scans

2023-02-22 Thread Heikki Linnakangas
On 14/02/2023 11:10, Aleksander Alekseev wrote: Hi Andres, Shouldn't need to extract the column if we just want to know if it's NULL (see heap_attisnull()). Afaics the value isn't accessed after this. Many thanks. Fixed. I'm confused, what exactly is the benefit of this? What extension

Re: Reducing connection overhead in pg_upgrade compat check phase

2023-02-22 Thread Daniel Gustafsson
> On 18 Feb 2023, at 06:46, Nathan Bossart wrote: > > On Fri, Feb 17, 2023 at 10:44:49PM +0100, Daniel Gustafsson wrote: >> When adding a check to pg_upgrade a while back I noticed in a profile that >> the >> cluster compatibility check phase spend a lot of time in connectToServer. >> Some >>

RE: [Proposal] Add foreign-server health checks infrastructure

2023-02-22 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thank you for reviewing! PSA new version. > 1. > PQconnCheck() function allows to check the status of the socket by polling > the socket. This function is currently available only on systems that > support the non-standard POLLRDHUP extension to the poll system call, > including

Unexpected abort at llvm::report_bad_alloc_error when load JIT library

2023-02-22 Thread Hugo Zhang
Hi hackers, I met a coredump when backend has no enough memory at dlopen which want to allocate memory for libLLVM-10.so.1. #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x7f10bde19859 in __GI_abort () at abort.c:79 #2 0x7f109c24cc33 in

Re: pg_regress: Treat child process failure as test failure

2023-02-22 Thread Daniel Gustafsson
> On 26 Nov 2022, at 22:46, Daniel Gustafsson wrote: > I've moved the statuses[i] check before the differ check, such that there is a > separate block for this not mixed up with the differs check and printing. Rebased patch to handle breakage of v2 due to bd8d453e9b. -- Daniel Gustafsson

Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)

2023-02-22 Thread Maxim Orlov
On Tue, 21 Feb 2023 at 16:59, Aleksander Alekseev wrote: > Hi, > > One thing that still bothers me is that during the upgrade we only > migrate the CLOG segments (i.e. pg_xact / pg_clog) and completely > ignore all the rest of SLRUs: > > * pg_commit_ts > * pg_multixact/offsets > *

Re: Performance issues with parallelism and LIMIT

2023-02-22 Thread Tomas Vondra
On 2/20/23 19:18, David Geier wrote: > Hi, > > On 2/8/23 11:42, Tomas Vondra wrote: >> On 2/1/23 14:41, David Geier wrote: >> >> Yeah, this is a pretty annoying regression. We already can hit poor >> behavior when matching rows are not distributed uniformly in the tables >> (which is what LIMIT

RE: Fix the description of GUC "max_locks_per_transaction" and "max_pred_locks_per_transaction" in guc_table.c

2023-02-22 Thread wangw.f...@fujitsu.com
On Wed, Feb 22, 2023 at 8:37 AM Nathan Bossart wrote: > On Wed, Feb 15, 2023 at 08:16:43AM +, wangw.f...@fujitsu.com wrote: > > When I refer to the GUC "max_locks_per_transaction", I find that the > description > > of the shared lock table size in pg-doc[1] is inconsistent with the code > >

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-02-22 Thread Melih Mutlu
Hi Shveta, Thanks for reviewing. Please see attached patches. shveta malik , 2 Şub 2023 Per, 14:31 tarihinde şunu yazdı: > On Wed, Feb 1, 2023 at 5:37 PM Melih Mutlu wrote: > for (int64 i = 1; i <= lastusedid; i++) > { > char

Re: Raising the SCRAM iteration count

2023-02-22 Thread Daniel Gustafsson
> On 17 Dec 2022, at 04:27, Michael Paquier wrote: > > On Thu, Dec 15, 2022 at 12:09:15PM +0100, Daniel Gustafsson wrote: >>> On 15 Dec 2022, at 00:52, Michael Paquier wrote: >>> conn->in_hot_standby = PG_BOOL_UNKNOWN; >>> + conn->scram_iterations = SCRAM_DEFAULT_ITERATIONS; >>> >>>

Re: pg_rewind race condition just after promotion

2023-02-22 Thread Heikki Linnakangas
On 11/12/2022 02:01, Ian Lawrence Barwick wrote: 2021年11月9日(火) 20:31 Daniel Gustafsson : On 14 Jul 2021, at 14:03, Aleksander Alekseev wrote: The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested,

Re: Allow ordered partition scans in more cases

2023-02-22 Thread Ronan Dunklau
Thank you for improving this optimization ! Le mardi 21 février 2023, 04:14:02 CET David Rowley a écrit : > I still need to look to see if there's some small amount of data that > can be loaded into the table to help coax the planner into producing > the ordered scan for this one. It works fine

Re: pgindent vs. git whitespace check

2023-02-22 Thread Tom Lane
Peter Eisentraut writes: > Commit e4602483e95 accidentally introduced a situation where pgindent > disagrees with the git whitespace check. The code is > conn = libpqsrv_connect_params(keywords, values, > /* expand_dbname = */ false, >

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-02-22 Thread wangw.f...@fujitsu.com
On Sun, Feb 19, 2023 at 21:06 PM Wang, Wei/王 威 wrote: > On Thur, Feb 14, 2023 at 2:03 AM Andres Freund wrote: > > On 2023-02-13 14:06:57 +0530, Amit Kapila wrote: > > > > > The patch calls update_progress in change_cb_wrapper and other > > > > > wrappers which will miss the case of DDLs that

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-02-22 Thread Melih Mutlu
Hi Wang, Thanks for reviewing. Please see updated patches. [1] wangw.f...@fujitsu.com , 7 Şub 2023 Sal, 10:28 tarihinde şunu yazdı: > 1. In the function ApplyWorkerMain. > I think we need to keep the worker name as "leader apply worker" in the > comment > like the current HEAD. > Done. > I

Re: [PATCH] Support SK_SEARCHNULL / SK_SEARCHNOTNULL for heap-only scans

2023-02-22 Thread Aleksander Alekseev
Hi, > I'm confused, what exactly is the benefit of this? What extension > performs a direct table scan bypassing the executor, searching for NULLs > or not-NULLs? Basically any extension that accesses the tables without SPI in order to avoid parsing and planning overhead for relatively simple

Re: Ignoring BRIN for HOT updates (was: -udpates seems broken)

2023-02-22 Thread Matthias van de Meent
On Wed, 22 Feb 2023 at 13:15, Tomas Vondra wrote: > > On 2/20/23 19:15, Matthias van de Meent wrote: > > Thanks. Based on feedback, attached is v2 of the patch, with as > > significant changes: > > > > - We don't store the columns we mention in predicates of summarized > > indexes in the

Re: LWLock deadlock in brinRevmapDesummarizeRange

2023-02-22 Thread Alvaro Herrera
On 2023-Feb-22, Tomas Vondra wrote: > > ... and in there, I wrote that we would first write the brin tuple in > > the regular page, unlock that, and then lock the revmap for the update, > > without holding lock on the data page. I don't remember why we do it > > differently now, but maybe the

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-02-22 Thread Melih Mutlu
Hi, Melih Mutlu , 16 Şub 2023 Per, 14:37 tarihinde şunu yazdı: > I see that setting originname in the catalog before actually creating it > causes issues. My concern with setting originname when setting the state to > FINISHEDCOPY is that if worker waits until FINISHEDCOPY to update >

Re: Ignoring BRIN for HOT updates (was: -udpates seems broken)

2023-02-22 Thread Tomas Vondra
On 2/20/23 19:15, Matthias van de Meent wrote: > Hi, > > On Sun, 19 Feb 2023 at 16:04, Tomas Vondra > wrote: >> >> Hi, >> >> On 2/19/23 02:03, Matthias van de Meent wrote: >>> On Thu, 16 Jun 2022 at 15:05, Tomas Vondra >>> wrote: I've pushed the revert. Let's try again for PG16. >>>

Re: Seek for helper documents to implement WAL with an FDW

2023-02-22 Thread Peter Eisentraut
On 20.02.23 10:53, Komal Habura wrote:         I have written an FDW, which is similar to the file_fdw. I need the support of WAL to perform logical and stream replication. I have knowledge about custom WAL but do not have clarity about implementing WAL(writing, redo, desc, identify, etc..)

RE: Time delayed LR (WAS Re: logical replication restrictions)

2023-02-22 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thank you for reviewing! PSA new version. > I think it would be better to say: "The minimum delay, in > milliseconds, by the publisher before sending all the changes". If you > agree then similar change is required in below comment as well: > + /* > + * The minimum delay, in

Re: Missing cases from SPI_result_code_string()

2023-02-22 Thread Dean Rasheed
On Mon, 20 Feb 2023 at 19:49, Dean Rasheed wrote: > > On Mon, 20 Feb 2023 at 19:39, Tom Lane wrote: > > > > Ugh. Grepping around, it looks like pltcl_process_SPI_result > > is missing a case for SPI_OK_MERGE as well. > > Yes, I was about to post a patch for that too. That's the last case > that

Re: Experiments with Postgres and SSL

2023-02-22 Thread Heikki Linnakangas
On 20/01/2023 03:28, Jacob Champion wrote: On Wed, Jan 18, 2023 at 7:16 PM Greg Stark wrote: * "Service Mesh" type tools that hide multiple services behind a single host/port ("Service Mesh" is just a new buzzword for "proxy"). If you want to multiplex protocols on a port, now is an

Re: Improving inferred query column names

2023-02-22 Thread Peter Eisentraut
On 20.02.23 16:17, David G. Johnston wrote: I think we should just do it and not care about what breaks.  There has never been any guarantee about these. I'm going to toss a -1 into the ring but if this does go through a strong request that it be disabled via a GUC.  The ugliness of

Re: We shouldn't signal process groups with SIGQUIT

2023-02-22 Thread Tom Lane
Michael Paquier writes: > What would be the advantage of doing that for groups other than > -StartupPID and -PgArchPID? These are the two groups of processes we > need to worry about, AFAIK. No, we have the issue for regular backends too, since they could be executing COPY FROM PROGRAM or the

Re: pgindent vs. git whitespace check

2023-02-22 Thread Alvaro Herrera
On 2023-Feb-22, Peter Eisentraut wrote: > In the meantime, I suggest we work around this, perhaps by > > conn = libpqsrv_connect_params(keywords, values, /* expand_dbname = > */ false, >PG_WAIT_EXTENSION); I suggest conn =

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Nikolay Samokhvalov
On Wed, Feb 22, 2023 at 9:55 AM Tom Lane wrote: > On the whole I'd rather not eat more of the limited namespace for > psql prompt codes for this. > It depends on personal preferences. When I work on a large screen, I can afford to spend some characters in prompts, if it gives convenience – and

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Pavel Stehule
st 22. 2. 2023 v 18:59 odesílatel Nikolay Samokhvalov napsal: > On Wed, Feb 22, 2023 at 9:55 AM Tom Lane wrote: > >> On the whole I'd rather not eat more of the limited namespace for >> psql prompt codes for this. >> > > It depends on personal preferences. When I work on a large screen, I can >

Re: [PATCH] Fix unbounded authentication exchanges during PQconnectPoll()

2023-02-22 Thread Heikki Linnakangas
On 22/02/2023 20:49, Jacob Champion wrote: On Tue, Feb 21, 2023 at 12:35 PM Heikki Linnakangas wrote: @@ -3370,6 +3389,7 @@ keep_going: /* We will come back to here until there is /* Get the type of request. */

Re: Fix the description of GUC "max_locks_per_transaction" and "max_pred_locks_per_transaction" in guc_table.c

2023-02-22 Thread Nathan Bossart
On Wed, Feb 22, 2023 at 12:40:07PM +, wangw.f...@fujitsu.com wrote: > On Wed, Feb 22, 2023 at 8:37 AM Nathan Bossart > wrote: >> So, even with your patch applied, I don't think the formulas are correct. >> I don't know if it's worth writing out the exact formula, though. It >> doesn't seem

Re: Non-superuser subscription owners

2023-02-22 Thread Mark Dilger
> On Feb 22, 2023, at 9:18 AM, Jeff Davis wrote: > > Another option is having some kind SECURITY NONE that would run the > code as a very limited-privilege user that can basically only access > the catalog. That would be useful for running default expressions and > the like without the

Re: wrong query result due to wang plan

2023-02-22 Thread Tom Lane
Richard Guo writes: > I'm thinking that maybe we can do the strip-the-outer-joins work only > when it's not the top JoinDomain. When we are in the top JoinDomain, it > seems to me that it's safe to push the qual to the top of the tree. Yeah, because there's nothing to commute with. Might as

Re: [PATCH] Fix unbounded authentication exchanges during PQconnectPoll()

2023-02-22 Thread Jacob Champion
On Tue, Feb 21, 2023 at 12:35 PM Heikki Linnakangas wrote: > I don't think the "overlong" or "truncated" bit is helpful. For example, > if the pre-v3.0 error message seems to be "overlong", it's not clear > that's really what happened. More likely, it's just garbage. I think this is maybe a

Re: Non-superuser subscription owners

2023-02-22 Thread Jeff Davis
On Wed, 2023-02-22 at 09:27 -0800, Mark Dilger wrote: > Another option is to execute under the intersection of their > privileges, where both the definer and the invoker need the > privileges in order for the action to succeed.  That would be more > permissive than the proposed SECURITY NONE,

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Nathan Bossart
On Wed, Feb 22, 2023 at 07:17:37PM +0100, Daniel Gustafsson wrote: >> On 22 Feb 2023, at 19:14, Heikki Linnakangas wrote: > >> How about a new backslash command or psql variable to show how long the >> previous statement took? Something like: >> >> postgres=# select >> ?column? >> --

Re: refactoring relation extension and BufferAlloc(), faster COPY

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 11:18:57 +0200, Heikki Linnakangas wrote: > On 21/02/2023 21:22, Andres Freund wrote: > > On 2023-02-21 18:18:02 +0200, Heikki Linnakangas wrote: > > > Is it ever possible to call this without a relcache entry? WAL redo > > > functions do that with ReadBuffer, but they only

Re: Wrong query results caused by loss of join quals

2023-02-22 Thread Tom Lane
Richard Guo writes: > On Mon, Feb 20, 2023 at 4:56 AM Tom Lane wrote: >> * I suspect the other use of get_common_eclass_indexes, in >> have_relevant_eclass_joinclause, is broken as well. > It seems have_relevant_joinclause is broken for the presented case. It > does not get a change to call

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Daniel Gustafsson
> On 22 Feb 2023, at 19:14, Heikki Linnakangas wrote: > How about a new backslash command or psql variable to show how long the > previous statement took? Something like: > > postgres=# select > ?column? > -- > 123 > (1 row) > > postgres=# \time > > Time: 14011.975 ms

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Pavel Stehule
Hi st 22. 2. 2023 v 18:55 odesílatel Tom Lane napsal: > Kirk Wolak writes: > > Proposal: Simply add the %T (PROMPT variable) to output the current time > > (HH24:MI:SS) into the prompt. > > I'm not really convinced that %`date` isn't a usable solution for this, > especially since it seems

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Kirk Wolak
On Wed, Feb 22, 2023 at 12:55 PM Tom Lane wrote: > Kirk Wolak writes: > > Proposal: Simply add the %T (PROMPT variable) to output the current time > > (HH24:MI:SS) into the prompt. > > I'm not really convinced that %`date` isn't a usable solution for this, > especially since it seems like a

Re: Rework of collation code, extensibility

2023-02-22 Thread Peter Eisentraut
On 14.02.23 00:45, Jeff Davis wrote: Now the patches are: 0001: pg_strcoll/pg_strxfrm 0002: pg_locale_deterministic() 0003: cleanup a USE_ICU special case 0004: GUCs (only for testing, not for commit) I haven't read the whole thing again, but this arrangement looks good to

Re: Add SHELL_EXIT_CODE to psql

2023-02-22 Thread Corey Huinker
> > > > The patch set seem to be in a good shape and pretty stable for quite a > while. > Could you add one more minor improvement, a new line after variables > declaration? > As you wish. Attached. > > After this changes, I think, we make this patch RfC, shall we? > > Fingers crossed. From

Re: pg_regress: Treat child process failure as test failure

2023-02-22 Thread Daniel Gustafsson
> On 22 Feb 2023, at 21:33, Andres Freund wrote: > On 2023-02-22 15:10:11 +0100, Daniel Gustafsson wrote: >> Rebased patch to handle breakage of v2 due to bd8d453e9b. > > I think we probably should just apply this? The current behaviour doesn't seem > right, and I don't see a downside of the

Re: logical decoding and replication of sequences, take 2

2023-02-22 Thread Jonathan S. Katz
On 2/22/23 5:02 AM, Tomas Vondra wrote: On 2/22/23 03:28, Jonathan S. Katz wrote: Thanks for continuing to work on this patch! I tested the latest version and have some feedback/clarifications. Thanks! Also I should mention I've been testing with both async/sync logical replication. I

Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Kirk Wolak
Proposal: Simply add the %T (PROMPT variable) to output the current time (HH24:MI:SS) into the prompt. This has been in sqlplus since I can remember, and I find it really useful when I forgot to time something, or to review for Time spent on a problem, or for how old my session is... I am

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Tom Lane
Kirk Wolak writes: > Proposal: Simply add the %T (PROMPT variable) to output the current time > (HH24:MI:SS) into the prompt. I'm not really convinced that %`date` isn't a usable solution for this, especially since it seems like a very niche requirement. The next person who wants it might well

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Pavel Stehule
st 22. 2. 2023 v 19:14 odesílatel Heikki Linnakangas napsal: > On 22/02/2023 19:59, Nikolay Samokhvalov wrote: > > On Wed, Feb 22, 2023 at 9:55 AM Tom Lane > > wrote: > > > > On the whole I'd rather not eat more of the limited namespace for > > psql prompt

Re: Improving inferred query column names

2023-02-22 Thread Andres Freund
Hi, On 2023-02-20 16:08:00 +0100, Peter Eisentraut wrote: > On 11.02.23 20:24, Andres Freund wrote: > I think we should just do it and not care about what breaks. There has > never been any guarantee about these. > > FWIW, "most" other SQL implementations appear to generate column names like >

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-22 Thread Nathan Bossart
On Wed, Feb 22, 2023 at 12:30:20PM +0900, Michael Paquier wrote: > Okay, applied and backpatched with a minimal test set, then. I have > kept the tweaks I did to the tests with extra comments. Thanks! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Raising the SCRAM iteration count

2023-02-22 Thread Jonathan S. Katz
On 2/22/23 8:39 AM, Daniel Gustafsson wrote: On 17 Dec 2022, at 04:27, Michael Paquier wrote: Superuser-only GUCs should be documented as such, or do you intend to make it user-settable like I suggested upthread :) ? I don't really have strong feelings, so I reverted to being

Re: meson and sslfiles.mk in src/test/ssl/

2023-02-22 Thread Jacob Champion
On Wed, Feb 22, 2023 at 5:40 AM Peter Eisentraut wrote: > I think the tradeoff here is, given how rarely those rules are used, is > it worth maintaining duplicate implementations or complicated bridging? > > It's clearly something to deal with eventually, but it's not high priority. Yeah... in

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Nikolay Samokhvalov
On Wed, Feb 22, 2023 at 9:18 AM Kirk Wolak wrote: > Proposal: Simply add the %T (PROMPT variable) to output the current time > (HH24:MI:SS) into the prompt. This has been in sqlplus since I can > remember, and I find it really useful when I forgot to time something, or > to review for Time

Re: Non-superuser subscription owners

2023-02-22 Thread Mark Dilger
> On Feb 22, 2023, at 10:49 AM, Jeff Davis wrote: > > On Wed, 2023-02-22 at 09:27 -0800, Mark Dilger wrote: >> Another option is to execute under the intersection of their >> privileges, where both the definer and the invoker need the >> privileges in order for the action to succeed. That

Re: Non-superuser subscription owners

2023-02-22 Thread Joe Conway
On 2/22/23 14:12, Mark Dilger wrote: On Feb 22, 2023, at 10:49 AM, Jeff Davis wrote: On Wed, 2023-02-22 at 09:27 -0800, Mark Dilger wrote: Another option is to execute under the intersection of their privileges, where both the definer and the invoker need the privileges in order for the action

Re: Non-superuser subscription owners

2023-02-22 Thread Jeff Davis
On Mon, 2023-02-06 at 14:40 -0500, Robert Haas wrote: > On Mon, Feb 6, 2023 at 2:18 PM Andres Freund > wrote: > > It's decidedly not great, yes. I don't know if it's quite a CVE > > type issue, > > after all, the same is true for any other type of query the > > superuser > > executes. But at the

Re: Allow tailoring of ICU locales with custom rules

2023-02-22 Thread Peter Eisentraut
On 20.02.23 17:30, Daniel Verite wrote: - pg_dump support need to be added for CREATE COLLATION / DATABASE I have added that. - there doesn't seem to be a way to add rules to template1. If someone wants to have icu rules and initial contents to their new databases, I think they need to

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Heikki Linnakangas
On 22/02/2023 19:59, Nikolay Samokhvalov wrote: On Wed, Feb 22, 2023 at 9:55 AM Tom Lane > wrote: On the whole I'd rather not eat more of the limited namespace for psql prompt codes for this. It depends on personal preferences. When I work on a large screen,

allow meson to find ICU in non-standard localtion

2023-02-22 Thread Jeff Davis
I attached a simple patch that allows meson to find ICU in a non- standard location if if you specify -Dextra_lib_dirs and -Dextra_include_dirs. I'm not sure it's the right thing to do though. One downside is that it doesn't output the version that it finds, it only outputs "YES". From

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Kirk Wolak
On Wed, Feb 22, 2023 at 1:14 PM Heikki Linnakangas wrote: > On 22/02/2023 19:59, Nikolay Samokhvalov wrote: > > On Wed, Feb 22, 2023 at 9:55 AM Tom Lane > > wrote: > > > > On the whole I'd rather not eat more of the limited namespace for > > psql prompt codes

Re: Reducing connection overhead in pg_upgrade compat check phase

2023-02-22 Thread Nathan Bossart
On Wed, Feb 22, 2023 at 10:37:35AM +0100, Daniel Gustafsson wrote: >> On 18 Feb 2023, at 06:46, Nathan Bossart wrote: >> The last 4 are for supported versions and, from a very >> quick glance, seem possible to consolidate. That would bring us to a total >> of 11 separate loops that we could

Re: meson and sslfiles.mk in src/test/ssl/

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 09:42:54 -0800, Jacob Champion wrote: > I'm happy to contribute cycles to a Meson port when you're ready for > it. From a skim it seems like maybe in-source generation isn't a focus for > Meson [1]. They might encourage us to write custom Python for it anyway? You'd normally

Re: pg_regress: Treat child process failure as test failure

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 15:10:11 +0100, Daniel Gustafsson wrote: > > On 26 Nov 2022, at 22:46, Daniel Gustafsson wrote: > > > I've moved the statuses[i] check before the differ check, such that there > > is a > > separate block for this not mixed up with the differs check and printing. > > Rebased

Re: Improving inferred query column names

2023-02-22 Thread Andres Freund
Hi, On 2023-02-11 12:47:04 -0800, Vladimir Churyukin wrote: > That is a good idea for simple cases, I'm just curious how it would look > like for more complex cases (you can have all kinds of expressions as > parameters for aggregate function calls). > If it works only for simple cases, I think

Re: pg_regress: Treat child process failure as test failure

2023-02-22 Thread Tom Lane
Daniel Gustafsson writes: >> On 22 Feb 2023, at 21:33, Andres Freund wrote: >> On 2023-02-22 15:10:11 +0100, Daniel Gustafsson wrote: >>> Rebased patch to handle breakage of v2 due to bd8d453e9b. >> I think we probably should just apply this? The current behaviour doesn't >> seem >> right, and

Re: PG 15 (and to a smaller degree 14) regression due to ExprEvalStep size

2023-02-22 Thread Tom Lane
I wrote: > Andres Freund writes: >> Maybe it's worth sticking a StaticAssert() for the struct size >> somewhere. > Indeed. I thought we had one already. >> I'm a bit wary about that being too noisy, there are some machines with >> odd alignment requirements. Perhaps worth restricting the

Re: Improving inferred query column names

2023-02-22 Thread Tom Lane
Vladimir Churyukin writes: > It doesn't need to be perfect, but it needs to be consistent. So far you > proposed a rule to replace () with _. What is the plan for expressions, how > to convert them to names (with deduplication I guess?, because there could > be 2 similar expressions mapped to the

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Peter Smith
Here are some review comments for patch v16-0001. == > src/backend/executor/execExprInterp.c > > 2. ExecEvalXmlExpr > > @@ -3829,7 +3829,8 @@ ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op) >{ >Datum*argvalue = op->d.xmlexpr.argvalue; >bool*argnull =

Re: Add SHELL_EXIT_CODE to psql

2023-02-22 Thread Thomas Munro
On Tue, Jan 31, 2023 at 9:23 AM Corey Huinker wrote: >> Unfortunately, there is a fail in FreeBSD >> https://cirrus-ci.com/task/6466749487382528 >> >> Maybe, this patch is need to be rebased? >> > > That failure is in postgres_fdw, which this code doesn't touch. > > I'm not able to get to >

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

2023-02-22 Thread Melanie Plageman
Hi, So, I attached a rough implementation of both the autovacuum failsafe reverts to shared buffers and the vacuum option (no tests or docs or anything). The first three patches in the set are just for enabling use of shared buffers in failsafe mode for autovacuum. I haven't actually ensured it

Re: Improving inferred query column names

2023-02-22 Thread Vladimir Churyukin
On Wed, Feb 22, 2023, 12:40 PM Andres Freund wrote: > Hi, > > On 2023-02-11 12:47:04 -0800, Vladimir Churyukin wrote: > > That is a good idea for simple cases, I'm just curious how it would look > > like for more complex cases (you can have all kinds of expressions as > > parameters for

Re: Improving inferred query column names

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 16:38:51 -0500, Tom Lane wrote: > Vladimir Churyukin writes: > > It doesn't need to be perfect, but it needs to be consistent. So far you > > proposed a rule to replace () with _. What is the plan for expressions, how > > to convert them to names (with deduplication I guess?,

Re: Experiments with Postgres and SSL

2023-02-22 Thread Jacob Champion
On Wed, Feb 22, 2023 at 4:26 AM Heikki Linnakangas wrote: > On 20/01/2023 03:28, Jacob Champion wrote: > > If you want to multiplex protocols on a port, now is an excellent time > > to require clients to use ALPN on implicit-TLS connections. (There are > > no clients that can currently connect

Re: PG 15 (and to a smaller degree 14) regression due to ExprEvalStep size

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 16:34:44 -0500, Tom Lane wrote: > I wrote: > > Andres Freund writes: > >> Maybe it's worth sticking a StaticAssert() for the struct size > >> somewhere. > > > Indeed. I thought we had one already. > > >> I'm a bit wary about that being too noisy, there are some machines with

  1   2   >