Re: PGDOCS - sgml linkend using single-quotes

2023-02-27 Thread Heikki Linnakangas
On 18/01/2023 00:37, Peter Smith wrote: I happened to notice some examples of SGML linkends that were using single quotes instead of double quotes. It didn't seem to be the conventional style because grepping (from doc/src/sgml folder) showed only a tiny fraction using single quotes. (single-qu

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

2023-02-27 Thread Amit Kapila
On Mon, Feb 27, 2023 at 12:35 PM Önder Kalacı wrote: > > >> Wouldn't a table-level option like 'apply_index_scan' be better than a >> subscription-level option with a default value as false? Anyway, the >> bigger point is that we don't see a better way to proceed here than to >> introduce some opt

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

2023-02-27 Thread Masahiko Sawada
On Mon, Feb 27, 2023 at 3:34 PM Amit Kapila wrote: > > On Mon, Feb 27, 2023 at 11:11 AM Masahiko Sawada > wrote: > > > > On Thu, Feb 23, 2023 at 9:10 PM Hayato Kuroda (Fujitsu) > > wrote: > > > > > > Thank you for reviewing! PSA new version. > > > > > > > > > > Thank you for updating the patch.

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

2023-02-27 Thread Heikki Linnakangas
On 22/02/2023 15:03, Aleksander Alekseev wrote: Additionally, practice shows that for an extension author it's very easy to miss a comment in skey.h: """ * SK_SEARCHARRAY, SK_SEARCHNULL and SK_SEARCHNOTNULL are supported only * for index scans, not heap scans; """ ... which results in many

Real config values for bytes needs quotes?

2023-02-27 Thread Kyotaro Horiguchi
Hello. I found it frustrating that the line "shared_buffers = 0.1GB" in postgresql.conf postgresql.conf was causing an error and that the value required (additional) surrounding single quotes. The attached patch makes the parser accept the use of non-quoted real values followed by a unit for such

Re: Add support for unit "B" to pg_size_pretty()

2023-02-27 Thread Peter Eisentraut
On 22.02.23 03:39, David Rowley wrote: hmm. I didn't really code pg_size_pretty with aliases in mind. I don't think you can do this. There's code in pg_size_pretty() and pg_size_pretty_numeric() that'll not work correctly. We look ahead to the next unit to check if there is one so we know we must

Re: Change xl_hash_vacuum_one_page.ntuples from int to uint16

2023-02-27 Thread Drouvot, Bertrand
Hi, On 2/27/23 6:27 AM, Amit Kapila wrote: On Fri, Feb 17, 2023 at 7:44 PM Drouvot, Bertrand wrote: On 2/16/23 1:26 PM, Drouvot, Bertrand wrote: Hi, On 2/16/23 12:00 PM, Amit Kapila wrote: BTW, feel free to create the second patch (to align the types for variables/arguments) as that would

Re: Provide PID data for "cannot wait on a latch owned by another process" in latch.c

2023-02-27 Thread Kyotaro Horiguchi
At Mon, 27 Feb 2023 09:20:39 +0900, Michael Paquier wrote in > Hi all, > > While doing something I should not have done, I have been able to > trigger latch.c with the error of $subject. Adding in the elog > generated some information about the PID owning the latch and > MyProcPid has made me

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

2023-02-27 Thread Hayato Kuroda (Fujitsu)
Dear Sawada-san, Amit, Thank you for reviewing! > + * > + * LOGICALREP_PROTO_MIN_SEND_DELAY_VERSION_NUM is the minimum > protocol version > + * with support for delaying to send transactions. Introduced in PG16. > */ > #define LOGICALREP_PROTO_MIN_VERSION_NUM 1 > #define LOGICALREP_PROTO_VERS

Re: Provide PID data for "cannot wait on a latch owned by another process" in latch.c

2023-02-27 Thread Kyotaro Horiguchi
Uggg! At Mon, 27 Feb 2023 17:48:10 +0900 (JST), Kyotaro Horiguchi wrote in > At Mon, 27 Feb 2023 09:20:39 +0900, Michael Paquier > wrote in > > Hi all, > > > > While doing something I should not have done, I have been able to > > trigger latch.c with the error of $subject. Adding in the el

Re: Provide PID data for "cannot wait on a latch owned by another process" in latch.c

2023-02-27 Thread Kyotaro Horiguchi
Uggg^2 At Mon, 27 Feb 2023 17:53:08 +0900 (JST), Kyotaro Horiguchi wrote in > > Please tidy up the followging sentence properly and natural but in a > > moderately formal way, within the context of computer programs, and > > provide explanations for the individual changes you made. > > Plea

Re: Allow logical replication to copy tables in binary format

2023-02-27 Thread Amit Kapila
On Mon, Feb 20, 2023 at 3:37 PM shiy.f...@fujitsu.com wrote: > > On Thu, Feb 16, 2023 8:48 PM Amit Kapila wrote: > > > > So, doesn't this mean that there is no separate failure mode during > > the initial copy? I am clarifying this to see if the patch really > > needs a separate copy_format optio

Optimize walsender handling invalid messages of 'drop publication'

2023-02-27 Thread Bowen Shi
Hi all, Before PG 14, walsender process has to handle invalid message in one XLOG (PG 14 provide a particular XLOG type: XLOG_XACT_INVALIDATIONS). This may bring some problems which has been discussed in previous mail: https://www.postgresql.org/message-id/flat/CAM_vCufO3eeRZ_O04z9reiE%2BB644%2BR

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

2023-02-27 Thread Heikki Linnakangas
(CC list trimmed, gmail wouldn't let me send otherwise) On 22/02/2023 16:29, Maxim Orlov wrote: On Tue, 21 Feb 2023 at 16:59, Aleksander Alekseev mailto:aleksan...@timescale.com>> wrote: One thing that still bothers me is that during the upgrade we only migrate the CLOG segments (i.e. p

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

2023-02-27 Thread Amit Kapila
On Mon, Feb 27, 2023 at 1:50 PM Masahiko Sawada wrote: > > On Mon, Feb 27, 2023 at 3:34 PM Amit Kapila wrote: > > > > > --- > > > Why do we not to delay sending COMMIT PREPARED messages? > > > > > > > I think we need to either add delay for prepare or commit prepared as > > otherwise, it will lea

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-02-27 Thread wangw.f...@fujitsu.com
On Thur, Feb 23, 2023 at 18:41 PM Kuroda, Hayato/�\田 隼人 wrote: > Dear Wang, > > Thank you for making the patch. IIUC your patch basically can achieve that > output plugin > does not have to call UpdateProgress. Thanks for your review and comments. > I think the basic approach is as follows, is

Re: pg_upgrade and logical replication

2023-02-27 Thread Amit Kapila
On Sun, Feb 26, 2023 at 8:35 AM Julien Rouhaud wrote: > > On Sat, Feb 25, 2023 at 11:24:17AM +0530, Amit Kapila wrote: > > > > > > The new command is of the form > > > > > > ALTER SUBSCRIPTION name ADD TABLE (relid = X, state = 'Y', lsn = 'Z/Z') > > > > > > with the lsn part being optional. > > >

Re: Allow logical replication to copy tables in binary format

2023-02-27 Thread Bharath Rupireddy
On Fri, Feb 24, 2023 at 8:32 AM Peter Smith wrote: > > Here is my summary of this thread so far, plus some other thoughts. Thanks. > 1. Initial Goal > -- > > Currently, the CREATE SUBSCRIPTION ... WITH(binary=true) mode does > data replication in binary mode, but tablesync COPY p

Re: SQL/JSON revisited

2023-02-27 Thread Amit Langote
On Mon, Feb 27, 2023 at 4:45 PM Amit Langote wrote: > On Tue, Feb 21, 2023 at 2:25 AM Andres Freund wrote: > > Evaluating N expressions for a json table isn't a good approach, both memory > > and CPU efficiency wise. > > Are you referring to JsonTableInitOpaque() initializing all these > sub-expr

Re: meson vs make: missing/inconsistent ENV

2023-02-27 Thread Dagfinn Ilmari Mannsåker
Justin Pryzby writes: > On Sun, Feb 26, 2023 at 03:21:04PM -0800, Andres Freund wrote: >> > Is there any consideration of promoting these or other warnings to >> > fatal? >> >> You mean the perl warnings? > > Yes - it'd be nice if the warnings caused an obvious failure to allow > addressing the

Re: WIN32 pg_import_system_collations

2023-02-27 Thread Andrew Dunstan
On 2023-02-26 Su 16:02, Andrew Dunstan wrote: On 2023-01-03 Tu 08:48, Peter Eisentraut wrote: On 09.12.22 13:48, Juan José Santamaría Flecha wrote: On Thu, Dec 1, 2022 at 8:46 AM Peter Eisentraut > wrote:     What is the status of this now?  I thi

Re: how does postgresql handle LOB/CLOB/BLOB column data that dies before the query ends

2023-02-27 Thread Noel Grandin
On Sat, 25 Feb 2023 at 19:06, Tom Lane wrote: > That could be a piece of the puzzle, yeah. > > Thank you very much, this conversion has been a great help. Regards, Noel Grandin

Re: meson vs make: missing/inconsistent ENV

2023-02-27 Thread Dagfinn Ilmari Mannsåker
Dagfinn Ilmari Mannsåker writes: > Justin Pryzby writes: > >> On Sun, Feb 26, 2023 at 03:21:04PM -0800, Andres Freund wrote: >>> > Is there any consideration of promoting these or other warnings to >>> > fatal? >>> >>> You mean the perl warnings? >> >> Yes - it'd be nice if the warnings caused

Re: meson vs make: missing/inconsistent ENV

2023-02-27 Thread Andrew Dunstan
On 2023-02-27 Mo 06:17, Dagfinn Ilmari Mannsåker wrote: Justin Pryzby writes: On Sun, Feb 26, 2023 at 03:21:04PM -0800, Andres Freund wrote: Is there any consideration of promoting these or other warnings to fatal? You mean the perl warnings? Yes - it'd be nice if the warnings caused an ob

Add error functions: erf() and erfc()

2023-02-27 Thread Dean Rasheed
Now that we have random_normal(), it seems like it would be useful to add the error functions erf() and erfc(), which I think are potentially useful to the people who will find random_normal() useful, and possibly others. An immediate use for erf() is that it allows us to do a Kolmogorov-Smirnov t

Re: buildfarm + meson

2023-02-27 Thread Juan José Santamaría Flecha
On Fri, Feb 24, 2023 at 2:22 PM Andrew Dunstan wrote: > > On drongo, this test isn't failing, and I think the reason is that it runs > "make NO_LOCALE=1 check" so it never gets a database with win1252 encoding. > > I'm going to try adding a win1252 test to drongo's locales. > What seems to be fa

[PoC] Add CANONICAL option to xmlserialize

2023-02-27 Thread Jim Jones
Hi, In order to compare pairs of XML documents for equivalence it is necessary to convert them first to their canonical form, as described at W3C Canonical XML 1.1.[1] This spec basically defines a standard physical representation of xml documents that have more then one possible representati

Adding argument names to aggregate functions

2023-02-27 Thread Dagfinn Ilmari Mannsåker
Hi hackers, I'm sure I'm not the only one who can never remember which way around the value and delimiter arguments go for string_agg() and has to look it up in the manual every time. To make it more convenient, here's a patch that adds proargnames to its pg_proc entries so that it can be seen wit

Re: Allow logical replication to copy tables in binary format

2023-02-27 Thread Bharath Rupireddy
On Tue, Feb 21, 2023 at 7:18 PM Bharath Rupireddy wrote: > > On Mon, Feb 20, 2023 at 5:17 PM Melih Mutlu wrote: > > > > Thanks for letting me know. > > Attached the fixed version of the patch. > > Thanks. I have few comments on v9 patch: > > 1. > +/* Do not allow binary = fals

Re: Stale references to guc.c in comments/tests

2023-02-27 Thread Daniel Gustafsson
> On 24 Feb 2023, at 16:19, Tom Lane wrote: > > Daniel Gustafsson writes: >> I happened to notice that there were a few references to guc.c regarding >> variables, which with the recent refactoring in 0a20ff54f have become stale. >> Attached is a trivial patch to instead point to guc_tables.c. >

Re: meson vs make: missing/inconsistent ENV

2023-02-27 Thread Andrew Dunstan
On 2023-02-27 Mo 07:33, Andrew Dunstan wrote: On 2023-02-27 Mo 06:17, Dagfinn Ilmari Mannsåker wrote: Justin Pryzby writes: On Sun, Feb 26, 2023 at 03:21:04PM -0800, Andres Freund wrote: Is there any consideration of promoting these or other warnings to fatal? You mean the perl warnings?

Re: libpq: PQgetCopyData() and allocation overhead

2023-02-27 Thread Bharath Rupireddy
On Fri, Feb 10, 2023 at 5:49 PM Jeroen Vermeulen wrote: > > OK, I've updated the PR with a benchmark (in the main directory). > > On this benchmark I'm seeing about a 24% reduction in "user" CPU time, and a > 8% reduction in "system" CPU time. (Almost no reduction in wall-clock time.) I can hel

Re: SLRUs in the main buffer pool - Page Header definitions

2023-02-27 Thread Heikki Linnakangas
On 08/02/2023 22:26, Andres Freund wrote: On 2023-02-08 20:04:52 +, Bagga, Rishu wrote: To summarize, our underlying effort is to move the SLRUs to the buffer cache. We were working with Thomas Munro off a patch he introduced here [1]. Munro’s patch moves SLRUs to the buffer cache by introdu

Re: PATCH: Using BRIN indexes for sorted output

2023-02-27 Thread Matthias van de Meent
On Fri, 24 Feb 2023, 20:14 Tomas Vondra, wrote: > > On 2/24/23 19:03, Matthias van de Meent wrote: > > On Thu, 23 Feb 2023 at 19:48, Tomas Vondra > >> Yeah, that sounds like a bug. Also a sign the tests should have some > >> by-ref data types (presumably there are none, as that would certainly > >

Re: Should vacuum process config file reload more often

2023-02-27 Thread Masahiko Sawada
Hi, On Fri, Feb 24, 2023 at 7:08 AM Melanie Plageman wrote: > > Hi, > > Users may wish to speed up long-running vacuum of a large table by > decreasing autovacuum_vacuum_cost_delay/vacuum_cost_delay, however the > config file is only reloaded between tables (for autovacuum) or after > the stateme

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

2023-02-27 Thread Melanie Plageman
On Sun, Feb 26, 2023 at 1:52 PM Tom Lane wrote: > > I wrote: > > The issue seems to be that code like this: > > ... > > is far too cute for its own good. > > Oh, there's another thing here that qualifies as too-cute: loops like > > for (IOObject io_object = IOOBJECT_FIRST; > io_object

Re: Add LZ4 compression in pg_dump

2023-02-27 Thread gkokolatos
--- Original Message --- On Sunday, February 26th, 2023 at 3:59 PM, Tomas Vondra wrote: > > > > > On 2/25/23 06:02, Justin Pryzby wrote: > > > I have some fixes (attached) and questions while polishing the patch for > > zstd compression. The fixes are small and could be integ

Re: libpq: PQgetCopyData() and allocation overhead

2023-02-27 Thread Jelte Fennema
Instead of implementing new growable buffer logic in this patch. It seems much nicer to reuse the already existing PQExpBuffer type for this patch. On Mon, 27 Feb 2023 at 14:48, Bharath Rupireddy wrote: > > On Fri, Feb 10, 2023 at 5:49 PM Jeroen Vermeulen wrote: > > > > OK, I've updated the PR

meson / pg_regress --no-locale

2023-02-27 Thread Andrew Dunstan
I can't see an obvious way to run the regression tests via meson with the --no-locale setting. This is particularly important on Windows. The buildfarm client first runs the regression tests with this setting and then tests (via installcheck) against instances set up with its configured locales

Re: Add LZ4 compression in pg_dump

2023-02-27 Thread gkokolatos
--- Original Message --- On Saturday, February 25th, 2023 at 3:05 PM, Justin Pryzby wrote: > > > On Fri, Feb 24, 2023 at 11:02:14PM -0600, Justin Pryzby wrote: > > > I have some fixes (attached) and questions while polishing the patch for > > zstd compression. The fixes are sma

Re: tests against running server occasionally fail, postgres_fdw & tenk1

2023-02-27 Thread Tom Lane
I wrote: > ... maybe we could do "select 1 from > pg_stat_activity where application_name = computed-pattern", but that > has the same problem that a cache flush might have terminated the > remote session. Hah - I thought of a solution. We can avoid this race condition if we make the remote sessi

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

2023-02-27 Thread Tom Lane
Melanie Plageman writes: > Attached is a patch to remove the *_FIRST macros. > I was going to add in code to change > for (IOObject io_object = 0; io_object < IOOBJECT_NUM_TYPES; io_object++) > to > for (IOObject io_object = 0; (int) io_object < IOOBJECT_NUM_TYPES; > io_object++) I

Re: PATCH: Using BRIN indexes for sorted output

2023-02-27 Thread Matthias van de Meent
Hi, On Thu, 23 Feb 2023 at 17:44, Matthias van de Meent wrote: > > I'll see to further reviewing 0004 and 0005 when I have additional time. Some initial comments on 0004: > +/* > + * brin_minmax_ranges > + *Load the BRIN ranges and sort them. > + */ > +Datum > +brin_minmax_ranges(PG_FUN

Re: Non-superuser subscription owners

2023-02-27 Thread Robert Haas
On Wed, Feb 22, 2023 at 12:18 PM Jeff Davis wrote: > There are two questions: > > 1. Is the security situation with logical replication bad? Yes. You > nicely summarized just how bad. > > 2. Is it the same situation as accessing a table owned by a user you > don't absolutely trust? > > Regardless

Re: pg_dump versus hash partitioning

2023-02-27 Thread Robert Haas
On Tue, Feb 14, 2023 at 2:21 PM Tom Lane wrote: > This made me wonder if this could be a usable solution at all, but > after thinking for awhile, I don't see how the claim about foreign key > constraints is anything but FUD. pg_dump/pg_restore have sufficient > dependency logic to prevent that fr

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

2023-02-27 Thread Heikki Linnakangas
On 21/02/2023 18:33, Alvaro Herrera wrote: On 2023-Feb-21, Heikki Linnakangas wrote: +static BlockNumber +BulkExtendSharedRelationBuffered(Relation rel, +SMgrRelation smgr, +

Re: SLRUs in the main buffer pool - Page Header definitions

2023-02-27 Thread Robert Haas
On Mon, Feb 27, 2023 at 8:56 AM Heikki Linnakangas wrote: > I'm not sure if I like that or not. I think we should clean up and > finish the other patches that this builds on first, and then decide if > we want to use the standard page header for the SLRUs or not. And if we > decide that we want th

Re: pg_dump versus hash partitioning

2023-02-27 Thread Tom Lane
Robert Haas writes: > On Tue, Feb 14, 2023 at 2:21 PM Tom Lane wrote: >> This made me wonder if this could be a usable solution at all, but >> after thinking for awhile, I don't see how the claim about foreign key >> constraints is anything but FUD. pg_dump/pg_restore have sufficient >> dependen

Re: pgsql: pg_rewind: Fix determining TLI when server was just promoted.

2023-02-27 Thread Robert Haas
On Thu, Feb 23, 2023 at 8:40 AM Heikki Linnakangas wrote: > This is arguably a bug fix, but don't backpatch because we haven't > really treated it as a bug so far. I guess I'm having trouble understanding why this is only arguably a bug fix. Seems like flat-out wrong behavior. -- Robert Haas ED

Re: Stale references to guc.c in comments/tests

2023-02-27 Thread Tom Lane
Daniel Gustafsson writes: > On 24 Feb 2023, at 16:19, Tom Lane wrote: >> Perhaps you could use "the GUC mechanisms" in these places, but it's a bit >> longer than "guc.c". Leaving such references alone seems OK too. > I've opted for mostly leaving them in the attached v2. This version seems OK

Re: pg_dump versus hash partitioning

2023-02-27 Thread Robert Haas
On Mon, Feb 27, 2023 at 11:20 AM Tom Lane wrote: > Well, that's a user error not pg_dump's fault. Particularly so for hash > partitioning, where there is no defensible reason to make the partitions > semantically different. I am still of the opinion that you're going down a dangerous path of red

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

2023-02-27 Thread John Naylor
On Fri, Feb 24, 2023 at 3:41 PM Masahiko Sawada wrote: > > In v29 vacuum took twice as long (286 s vs. 573 s)? Not sure what happened there, and clearly I was looking at the wrong number :/ I scripted the test for reproducibility and ran it three times. Also included some variations (attached):

Re: tests against running server occasionally fail, postgres_fdw & tenk1

2023-02-27 Thread Tom Lane
I wrote: > Hah - I thought of a solution. We can avoid this race condition if > we make the remote session itself inspect pg_stat_activity and > return its displayed application_name. Just need a foreign table > that maps onto pg_stat_activity. I went ahead and coded it that way, and it doesn't

Re: libpq: PQgetCopyData() and allocation overhead

2023-02-27 Thread Jeroen Vermeulen
Done. Thanks for looking! Jelte Fennema pointed out that I should probably be using PQExpBuffer for this. I'll look into that later; this is a proof of concept, not a production-ready API proposal. Jeroen On Mon, 27 Feb 2023 at 14:48, Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com

Re: pg_dump versus hash partitioning

2023-02-27 Thread Tom Lane
Robert Haas writes: > On Mon, Feb 27, 2023 at 11:20 AM Tom Lane wrote: >> Well, that's a user error not pg_dump's fault. Particularly so for hash >> partitioning, where there is no defensible reason to make the partitions >> semantically different. > I am still of the opinion that you're going

Re: pg_dump versus hash partitioning

2023-02-27 Thread Robert Haas
On Mon, Feb 27, 2023 at 12:50 PM Tom Lane wrote: > Robert Haas writes: > > On Mon, Feb 27, 2023 at 11:20 AM Tom Lane wrote: > >> Well, that's a user error not pg_dump's fault. Particularly so for hash > >> partitioning, where there is no defensible reason to make the partitions > >> semanticall

Re: pg_dump versus hash partitioning

2023-02-27 Thread Tom Lane
Robert Haas writes: > Sure, but I was responding to your assertion that there's no case in > which --load-via-partition-root could cause a restore failure. I'm not > sure that's accurate. Perhaps it's not, but it's certainly far less likely to cause a restore failure than the behavior I want to r

Re: SLRUs in the main buffer pool - Page Header definitions

2023-02-27 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Mon, Feb 27, 2023 at 8:56 AM Heikki Linnakangas wrote: > > I'm not sure if I like that or not. I think we should clean up and > > finish the other patches that this builds on first, and then decide if > > we want to use the standard pag

Re: Non-superuser subscription owners

2023-02-27 Thread Jeff Davis
On Mon, 2023-02-27 at 10:45 -0500, Robert Haas wrote: > Suppose Alice owns a table and attaches a trigger to it. If > Bob inserts into that table, I think we have to run the trigger, > because Alice is entitled to assume that, for example, any BEFORE > triggers she might have defined that block c

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

2023-02-27 Thread Melanie Plageman
On Mon, Feb 27, 2023 at 10:30 AM Tom Lane wrote: > > Melanie Plageman writes: > > Attached is a patch to remove the *_FIRST macros. > > I was going to add in code to change > > > for (IOObject io_object = 0; io_object < IOOBJECT_NUM_TYPES; > > io_object++) > > to > > for (IOObject io

Re: meson / pg_regress --no-locale

2023-02-27 Thread Andrew Dunstan
On 2023-02-27 Mo 09:34, Andrew Dunstan wrote: I can't see an obvious way to run the regression tests via meson with the --no-locale setting. This is particularly important on Windows. The buildfarm client first runs the regression tests with this setting and then tests (via installcheck) aga

Re: Non-superuser subscription owners

2023-02-27 Thread Stephen Frost
Greetings, * Jeff Davis (pg...@j-davis.com) wrote: > On Mon, 2023-02-27 at 10:45 -0500, Robert Haas wrote: > > Suppose Alice owns a table and attaches a trigger to it. If > > Bob inserts into that table, I think we have to run the trigger, > > because Alice is entitled to assume that, for example

SQL JSON path enhanced numeric literals

2023-02-27 Thread Peter Eisentraut
Attached is a patch to add nondecimal integer literals and underscores in numeric literals to the SQL JSON path language. This matches the recent additions to the core SQL syntax. It follows ECMAScript in combination with the current SQL draft. Internally, all the numeric literal parsing of

Re: Move defaults toward ICU in 16?

2023-02-27 Thread Jeff Davis
On Fri, 2023-02-24 at 15:54 -0800, Jeff Davis wrote: >   0001: default autoconf to build with ICU (meson already uses > 'auto') What's the best way to prepare for the impact of this on the buildfarm? How should we migrate to using --without-icu for those animals not currently specifying --with-icu

Re: tests against running server occasionally fail, postgres_fdw & tenk1

2023-02-27 Thread Andres Freund
Hi, On 2023-02-27 12:42:00 -0500, Tom Lane wrote: > I wrote: > > Hah - I thought of a solution. We can avoid this race condition if > > we make the remote session itself inspect pg_stat_activity and > > return its displayed application_name. Just need a foreign table > > that maps onto pg_stat_a

Re: Allow logical replication to copy tables in binary format

2023-02-27 Thread Melih Mutlu
Hi, Thanks for all of your reviews! So, I made some changes in the v10 according to your comments. 1- copy_format is changed to a boolean parameter copy_binary. It sounds easier to use a boolean to enable/disable binary copy. Default value is false, so nothing changes in the current behaviour if

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

2023-02-27 Thread Tom Lane
Melanie Plageman writes: > On Mon, Feb 27, 2023 at 10:30 AM Tom Lane wrote: >> The risk of needing to cast when using the "int" loop variable >> as an enum is obviously the downside of that approach, but we have >> not seen any indication that any compilers actually do warn. >> It's interesting t

Re: psql: Add role's membership options to the \du+ command

2023-02-27 Thread Pavel Luzanov
On 22.02.2023 00:34, David G. Johnston wrote: This is the format I've gone for (more-or-less) in my RoleGraph view (I'll be sharing it publicly in the near future). bob from grantor (a, s, i) \n adam from postgres (a, s, i) \n emily from postgres (empty) I think this is a good compromise. Ba

Re: Move defaults toward ICU in 16?

2023-02-27 Thread Tom Lane
Jeff Davis writes: > On Fri, 2023-02-24 at 15:54 -0800, Jeff Davis wrote: >> 0001: default autoconf to build with ICU (meson already uses >> 'auto') > What's the best way to prepare for the impact of this on the buildfarm? > How should we migrate to using --without-icu for those animals not > cur

Re: [PoC] Federated Authn/z with OAUTHBEARER

2023-02-27 Thread Stephen Frost
Greetings, * Andrey Chudnovsky (achudnovs...@gmail.com) wrote: > > This really doesn't feel like a great area to try and do hooks or > > similar in, not the least because that approach has been tried and tried > > again (PAM, GSSAPI, SASL would all be examples..) and frankly none of > > them has t

Re: Auth extensions, with an LDAP/SCRAM example [was: Proposal: Support custom authentication methods using hooks]

2023-02-27 Thread Stephen Frost
Greetings, * Jacob Champion (jchamp...@timescale.com) wrote: > This patchset should ideally have required zero client side changes, but > because our SCRAM implementation is slightly nonstandard too -- it > doesn't embed the username into the SCRAM data -- libpq can't talk to > the OpenLDAP/Cyrus

Re: tests against running server occasionally fail, postgres_fdw & tenk1

2023-02-27 Thread Tom Lane
Andres Freund writes: > On 2023-02-27 12:42:00 -0500, Tom Lane wrote: >> I went ahead and coded it that way, and it doesn't look too awful. >> Any objections? > Looks good to me. > I think it'd be an indication of a bug around the invalidation handling if the > terminations were required. So eve

Re: Non-superuser subscription owners

2023-02-27 Thread Robert Haas
On Mon, Feb 27, 2023 at 1:25 PM Jeff Davis wrote: > I think you are saying that we should still run Alice's code with the > privileges of Bob, but somehow make that safe(r) for Bob. Is that > right? Yeah. That's the idea I was floating, at least. > That sounds hard, and I'm still stuck at the "w

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

2023-02-27 Thread Andres Freund
Hi, On 2023-02-22 16:32:53 -0500, Melanie Plageman wrote: > I was wondering about the status of the autovacuum wraparound failsafe > test suggested in [1]. I don't see it registered for the March's > commitfest. I'll probably review it since it will be useful for this > patchset. It's pretty hard

Re: PGDOCS - sgml linkend using single-quotes

2023-02-27 Thread Peter Smith
On Mon, Feb 27, 2023 at 7:04 PM Heikki Linnakangas wrote: > ... > > There were also a few "id" attributes using single-quotes. Fixed those > too, and pushed. Thanks! > Thankyou for pushing. -- Kind Regards, Peter Smith. Fujitsu Australia

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

2023-02-27 Thread Andres Freund
Hi, On 2023-02-27 18:06:22 +0200, Heikki Linnakangas wrote: > We also do this in freespace.c and visibilitymap.c: > > /* Extend as needed. */ > while (fsm_nblocks_now < fsm_nblocks) > { > PageSetChecksumInplace((Page) pg.data, fsm_nblocks_now); > > smgrextend(reln, FS

Re: WIN32 pg_import_system_collations

2023-02-27 Thread Juan José Santamaría Flecha
On Mon, Feb 27, 2023 at 1:10 PM Andrew Dunstan wrote: > On 2023-02-26 Su 16:02, Andrew Dunstan wrote: > > Now that I have removed the barrier to testing this in the buildfarm, and > added an appropriate locale setting to drongo, we can see that this test > fails like this: > > > diff -w -U3 > c:

Re: WIN32 pg_import_system_collations

2023-02-27 Thread Juan José Santamaría Flecha
El lun, 27 feb 2023, 23:05, Juan José Santamaría Flecha < juanjo.santama...@gmail.com> escribió: > > The command that's failing is "SET lc_time TO 'de_DE';", and that area of > code is untouched by this patch. As mentioned in [1], the problem seems to > come from a Windows bug that the CI images a

Re: Proposal: :SQL_EXEC_TIME (like :ROW_COUNT) Variable (psql)

2023-02-27 Thread Kirk Wolak
On Sun, Feb 26, 2023 at 11:45 PM Pavel Stehule wrote: > po 27. 2. 2023 v 5:08 odesílatel Kirk Wolak napsal: > >> On Fri, Feb 24, 2023 at 10:56 PM Kirk Wolak wrote: >> >>> On Fri, Feb 24, 2023 at 2:11 AM Gurjeet Singh wrote: >>> On Thu, Feb 23, 2023 at 8:42 PM Kirk Wolak wrote: >>> .

Re: Doc update for pg_stat_statements normalization

2023-02-27 Thread Imseih (AWS), Sami
>On Sat, Feb 25, 2023 at 01:59:04PM +, Imseih (AWS), Sami wrote:> >> The overhead of storing this additional private data for the life of the > query >> execution may not be desirable. >Okay, but why? Additional memory to maintain the JumbleState data in other structs, and t

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

2023-02-27 Thread Andres Freund
On 2023-02-27 14:58:30 -0500, Tom Lane wrote: > Agreed. I'll push this along with the earlier patch if there are > not objections. None here.

Re: Adding argument names to aggregate functions

2023-02-27 Thread Vik Fearing
On 2/27/23 14:22, Dagfinn Ilmari Mannsåker wrote: Hi hackers, I'm sure I'm not the only one who can never remember which way around the value and delimiter arguments go for string_agg() and has to look it up in the manual every time. To make it more convenient, here's a patch that adds proargnam

Re: Provide PID data for "cannot wait on a latch owned by another process" in latch.c

2023-02-27 Thread Michael Paquier
On Mon, Feb 27, 2023 at 05:48:10PM +0900, Kyotaro Horiguchi wrote: > +1 for adding that information, I'm afraid that MyProcId is not > necessary since it is displayed in log lines in most cases. If you > want to display the both PIDs I suggest making them more distinctive. What would you suggest?

Re: verbose mode for pg_input_error_message?

2023-02-27 Thread Michael Paquier
On Mon, Feb 27, 2023 at 11:25:01AM -0800, Nathan Bossart wrote: > I found a couple of more small changes required to make cfbot happy. > Otherwise, it looks good to me. Thanks, I have confirmed the spots the CI was complaining about, so applied. There was an extra place that was not right in xml_

Re: Non-superuser subscription owners

2023-02-27 Thread Jeff Davis
On Mon, 2023-02-27 at 14:10 -0500, Stephen Frost wrote: > I do think there are some use-cases for it, but agree that it'd be > better to encourage more use of SECURITY DEFINER and one approach to > that might be to have a way for users to explicitly say "don't run > code > that isn't mine or a supe

Re: Doc update for pg_stat_statements normalization

2023-02-27 Thread Michael Paquier
On Mon, Feb 27, 2023 at 10:53:26PM +, Imseih (AWS), Sami wrote: > Wouldn't be less in terms of memory usage to just store the required > JumbleState fields in Query[Desc]? > > clocations_count, > highest_extern_param_id, > clocations_locations, > clocations_length Yes, these would be enough t

Re: SQL JSON path enhanced numeric literals

2023-02-27 Thread Vik Fearing
On 2/27/23 20:13, Peter Eisentraut wrote: Attached is a patch to add nondecimal integer literals and underscores in numeric literals to the SQL JSON path language.  This matches the recent additions to the core SQL syntax.  It follows ECMAScript in combination with the current SQL draft. Inte

Re: verbose mode for pg_input_error_message?

2023-02-27 Thread Nathan Bossart
On Tue, Feb 28, 2023 at 09:01:48AM +0900, Michael Paquier wrote: > On Mon, Feb 27, 2023 at 11:25:01AM -0800, Nathan Bossart wrote: >> I found a couple of more small changes required to make cfbot happy. >> Otherwise, it looks good to me. > > Thanks, I have confirmed the spots the CI was complainin

Re: Track Oldest Initialized WAL Buffer Page

2023-02-27 Thread Nathan Bossart
On Tue, Feb 07, 2023 at 07:30:00PM +0530, Bharath Rupireddy wrote: > + /* > + * Try updating oldest initialized XLog buffer page. > + * > + * Update it if we are initializing an XLog buffer page for the > first > + * time or if XLog b

Re: Non-superuser subscription owners

2023-02-27 Thread Jeff Davis
On Mon, 2023-02-27 at 16:13 -0500, Robert Haas wrote: > On Mon, Feb 27, 2023 at 1:25 PM Jeff Davis wrote: > > I think you are saying that we should still run Alice's code with > > the > > privileges of Bob, but somehow make that safe(r) for Bob. Is that > > right? > > Yeah. That's the idea I was

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2023-02-27 Thread Nathan Bossart
On Wed, Feb 08, 2023 at 08:00:00PM +0530, Bharath Rupireddy wrote: > + /* > + * We read some of the requested bytes. Continue to > read remaining > + * bytes. > + */ > + ptr += nread; > +

Re: Rework LogicalOutputPluginWriterUpdateProgress

2023-02-27 Thread Peter Smith
Here are some comments for the v2-0001 patch. (I haven't looked at the v3 that was posted overnight; maybe some of my comments have already been addressed.) == General 1. (Info from the commit message) Since we can know whether the change is an end of transaction change in the common code, w

Re: Should vacuum process config file reload more often

2023-02-27 Thread Andres Freund
Hi, On 2023-02-27 23:11:53 +0900, Masahiko Sawada wrote: > As far as I know there are not such GUC parameters in the core but > there might be in third-party table AM and index AM extensions. We already reload in a pretty broad range of situations, so I'm not sure there's a lot that could be unsa

Re: pg_rewind: warn when checkpoint hasn't happened after promotion

2023-02-27 Thread kuroda . keisuke
hi Heikki, Thanks to mail, and thanks also for the commit(0a0500207a) to fix the document. I'm glad the problem was solved. Best Regards, Keisuke Kuroda NTT COMWARE 2023-02-27 16:33 に Heikki Linnakangas さんは書きました: On 16/11/2022 07:17, kuroda.keis...@nttcom.co.jp wrote: I fixed this last week i

Re: Should vacuum process config file reload more often

2023-02-27 Thread Masahiko Sawada
On Tue, Feb 28, 2023 at 10:21 AM Andres Freund wrote: > > Hi, > > On 2023-02-27 23:11:53 +0900, Masahiko Sawada wrote: > > As far as I know there are not such GUC parameters in the core but > > there might be in third-party table AM and index AM extensions. > > We already reload in a pretty broad

Re: pg_upgrade and logical replication

2023-02-27 Thread Julien Rouhaud
On Mon, Feb 27, 2023 at 03:39:18PM +0530, Amit Kapila wrote: > > BTW, thinking some more > on this, how will we allow to continue replication after upgrading the > publisher? During upgrade, we don't retain slots, so the replication > won't continue. I think after upgrading subscriber-node, user wi

Re: Non-superuser subscription owners

2023-02-27 Thread Stephen Frost
Greetings, * Jeff Davis (pg...@j-davis.com) wrote: > On Mon, 2023-02-27 at 14:10 -0500, Stephen Frost wrote: > > I do think there are some use-cases for it, but agree that it'd be > > better to encourage more use of SECURITY DEFINER and one approach to > > that might be to have a way for users to

Re: Non-superuser subscription owners

2023-02-27 Thread Stephen Frost
Greetings, * Jeff Davis (pg...@j-davis.com) wrote: > Not all steps would be breaking changes, and a lot of those steps are > things we should do anyway. We could make it easier to write safe > SECURITY DEFINER functions, provide more tools for users to opt-out of > executing SECURITY INVOKER code,

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

2023-02-27 Thread Kyotaro Horiguchi
At Mon, 27 Feb 2023 14:56:19 +0530, Amit Kapila wrote in > The one difference w.r.t recovery_min_apply_delay is that here we will > hold locks for the duration of the delay which didn't seem to be a > good idea. This will also probably lead to more bloat as we will keep > transactions open for a

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

2023-02-27 Thread Amit Kapila
On Tue, Feb 28, 2023 at 8:14 AM Kyotaro Horiguchi wrote: > > At Mon, 27 Feb 2023 14:56:19 +0530, Amit Kapila > wrote in > > The one difference w.r.t recovery_min_apply_delay is that here we will > > hold locks for the duration of the delay which didn't seem to be a > > good idea. This will also

  1   2   >