Re: Fix order of checking ICU options in initdb and create database

2022-11-23 Thread Peter Eisentraut
On 19.11.22 20:36, Марина Полякова wrote: Here is another set of proposed patches: v2-0001-Fix-encoding-check-in-initdb-when-the-option-icu-.patch Target: PG 15+ Fix encoding check in initdb when the option --icu-locale is not used: I'm having a hard time figuring out from your examples what

Re: fixing CREATEROLE

2022-11-23 Thread walther
Robert Haas: I have to admit that when I realized that was the natural place to put them to make the patch work, my first reaction internally was "well, that can't possibly be right, role properties suck!". But I didn't and still don't see where else to put them that makes any sense at all, so I

Re: ps command does not show walsender's connected db

2022-11-23 Thread Michael Paquier
On Tue, Nov 22, 2022 at 08:46:22AM +0530, Bharath Rupireddy wrote: > Are you looking at the latest v3 patch > https://www.postgresql.org/message-id/4b5691462b994c18ff370aaa84cef0d0%40oss.nttdata.com? > It has no printf() calls. Yes, I was looking at v1. v3 can be simpler. All this information

Re: Allow file inclusion in pg_hba and pg_ident files

2022-11-23 Thread Julien Rouhaud
On Thu, Nov 24, 2022 at 02:07:21PM +0900, Michael Paquier wrote: > On Wed, Nov 23, 2022 at 03:56:50PM +0800, Julien Rouhaud wrote: > > The depth 0 is getting used quite a lot now, maybe we should have a define > > for > > it to make it easier to grep, like TOP_LEVEL_AUTH_FILE or something like >

Re: Patch: Global Unique Index

2022-11-23 Thread Pavel Stehule
st 23. 11. 2022 v 23:42 odesílatel Thomas Kellerer napsal: > Tom Lane schrieb am 18.11.2022 um 16:06: > >> Do we need new syntax actually? I think that a global unique index > >> can be created automatically instead of raising an error "unique > >> constraint on partitioned table must include

RE: wake up logical workers after ALTER SUBSCRIPTION

2022-11-23 Thread Hayato Kuroda (Fujitsu)
Dear Nathan, Thank you for updating the patch! > In v3, I moved the call to LogicalRepWorkersWakeupAtCommit() to the end of > the function. This should avoid waking up workers in some cases where it's > unnecessary (e.g., if ALTER SUBSCRIPTION ERRORs in a subtransaction), but > there are still

RE: failures in t/031_recovery_conflict.pl on CI

2022-11-23 Thread Факеев Алексей
Hello. Even after applying the patch, we are still facing an "ack Broken pipe" problem. It occurs on the arm64 platform, presumably under high load. Here is a log snippet from buildfarm: ... [19:08:12.150](0.394s) ok 13 - startup deadlock: cursor holding conflicting pin, also waiting for lock,

Allow processes to reset procArrayGroupNext themselves instead of leader resetting for all the followers

2022-11-23 Thread Bharath Rupireddy
Hi, While working on something else, I noticed that the proc array group XID clearing leader resets procArrayGroupNext of all the followers atomically along with procArrayGroupMember. ISTM that it's enough for the followers to exit the wait loop and continue if the leader resets just

Re: Allow file inclusion in pg_hba and pg_ident files

2022-11-23 Thread Michael Paquier
On Wed, Nov 23, 2022 at 03:56:50PM +0800, Julien Rouhaud wrote: > The depth 0 is getting used quite a lot now, maybe we should have a define for > it to make it easier to grep, like TOP_LEVEL_AUTH_FILE or something like that? > And also add a define for the magical 10 for the max inclusion depth,

Re: Collation version tracking for macOS

2022-11-23 Thread Thomas Munro
On Thu, Nov 24, 2022 at 3:07 PM Jeff Davis wrote: > I'd vote for 1 on the grounds that it's easier to document and > understand a single collation version, which comes straight from > ucol_getVersion(). This approach makes it a separate problem to find > the collation version among whatever

Re: Hash index build performance tweak from sorting

2022-11-23 Thread David Rowley
On Thu, 24 Nov 2022 at 02:27, Simon Riggs wrote: > > On Wed, 23 Nov 2022 at 13:04, David Rowley wrote: > > I'd rather see this solved like v4 is doing it. > > Please do. No further comments. Thanks for your help Thanks. I pushed the v4 patch with some minor comment adjustments and also renamed

Re: Add 64-bit XIDs into PostgreSQL 15

2022-11-23 Thread Chris Travers
On Tue, Nov 22, 2022 at 10:01 AM Aleksander Alekseev < aleksan...@timescale.com> wrote: > Hi Chris, > > > Right now the way things work is: > > 1. Database starts throwing warnings that xid wraparound is approaching > > 2. Database-owning team initiates an emergency response, may take >

Re: [PoC] Federated Authn/z with OAUTHBEARER

2022-11-23 Thread Andrey Chudnovsky
> How does this differ from the previous proposal? The OAUTHBEARER SASL > mechanism already relies on OIDC for discovery. (I think that decision > is confusing from an architectural and naming standpoint, but I don't > think they really had an alternative...) Mostly terminology questions here.

Re: Bug in row_number() optimization

2022-11-23 Thread Richard Guo
On Tue, Nov 22, 2022 at 3:44 PM Richard Guo wrote: > On Wed, Nov 16, 2022 at 7:38 AM Sergey Shinderuk < > s.shinde...@postgrespro.ru> wrote: > >> The failing query is: >> SELECT * FROM >>(SELECT *, >>count(salary) OVER (PARTITION BY depname || '') c1, -- w1 >>

Re: Collation version tracking for macOS

2022-11-23 Thread Thomas Munro
On Thu, Nov 24, 2022 at 3:07 PM Jeff Davis wrote: > I'm sure this has been discussed, but which distros even support > multiple major versions of ICU? For Debian and friends, you can install any number of libicuNN packages (if you can find them eg from previous release repos), but there's only

Re: Collation version tracking for macOS

2022-11-23 Thread Jeff Davis
On Wed, 2022-11-23 at 18:08 +1300, Thomas Munro wrote: > (1) the default behaviour on failure to search would > likely be to use the linked library instead and WARN about > [dat]collversion mismatch, so far the same, and  Agreed. > (2) the set of people > who would really be prepared to compile

Re: odd buildfarm failure - "pg_ctl: control file appears to be corrupt"

2022-11-23 Thread Thomas Munro
On Thu, Nov 24, 2022 at 2:02 PM Thomas Munro wrote: > ... and you'll soon see: > > ERROR: calculated CRC checksum does not match value stored in file I forgot to mention: this reproducer only seems to work if fsync = off. I don't know why, but I recall that was true also for bug #17064.

Re: More efficient build farm animal wakeup?

2022-11-23 Thread Andrew Dunstan
On 2022-11-23 We 16:59, Tom Lane wrote: > Thomas Munro writes: >> On Thu, Nov 24, 2022 at 10:00 AM Magnus Hagander wrote: >>> On Wed, Nov 23, 2022 at 9:15 AM Thomas Munro wrote: >>> Are you saying you still think it's worth pursuing longpoll or similar >>> methods for it, or that this is

Re: cleanup in open_auth_file

2022-11-23 Thread Michael Paquier
On Wed, Nov 23, 2022 at 05:09:22PM -0800, Ted Yu wrote: > Thinking more on this. > The context should be created when the file is successfully opened. Indeed. Both operations ought to be done in the reverse order, or we would run into leaks in the postmaster on reload if pg_ident.conf has been

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-23 Thread Andrew Dunstan
On 2022-11-22 Tu 20:36, Tom Lane wrote: > Andres Freund writes: >> While looking into a weird buildfarm failure ([1]), I noticed this: >> # Checking port 62707 >> Use of uninitialized value $pid in scalar chomp at >>

Re: cleanup in open_auth_file

2022-11-23 Thread Ted Yu
On Wed, Nov 23, 2022 at 4:54 PM Ted Yu wrote: > Hi, > I was looking at the following commit: > > commit efc981627a723d91e86865fb363d793282e473d1 > Author: Michael Paquier > Date: Thu Nov 24 08:21:55 2022 +0900 > > Rework memory contexts in charge of HBA/ident tokenization > > I think when

Re: odd buildfarm failure - "pg_ctl: control file appears to be corrupt"

2022-11-23 Thread Thomas Munro
On Thu, Nov 24, 2022 at 11:05 AM Tom Lane wrote: > Thomas Munro writes: > > On Wed, Nov 23, 2022 at 11:03 PM Thomas Munro > > wrote: > > As for what to do about it, some ideas: > > 2. Retry after a short time on checksum failure. The probability is > > already miniscule, and becomes pretty

cleanup in open_auth_file

2022-11-23 Thread Ted Yu
Hi, I was looking at the following commit: commit efc981627a723d91e86865fb363d793282e473d1 Author: Michael Paquier Date: Thu Nov 24 08:21:55 2022 +0900 Rework memory contexts in charge of HBA/ident tokenization I think when the file cannot be opened, the context should be deleted.

Re: O(n) tasks cause lengthy startups and checkpoints

2022-11-23 Thread Nathan Bossart
On Sun, Nov 06, 2022 at 02:38:42PM -0800, Nathan Bossart wrote: > rebased another rebase for cfbot -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From b2c36a6d0d8ca5cde374b1c8b34aafaabbd7f6c2 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Wed, 5 Jan 2022 19:24:22 +

Re: drop postmaster symlink

2022-11-23 Thread Daniel Gustafsson
> On 23 Nov 2022, at 21:10, Robert Haas wrote: > I don't actually care very much whether we get rid of the postmaster > symlink or not, but if we aren't going to, we should stop calling it > deprecated. If 15 years isn't enough time to remove it, what ever will > be? +1. If we actively add

Re: predefined role(s) for VACUUM and ANALYZE

2022-11-23 Thread Nathan Bossart
On Wed, Nov 23, 2022 at 02:56:28PM -0500, Andrew Dunstan wrote: > I have committed the first couple of these to get them out of the way. Thanks! > But I think we need a bit of cleanup in the next patch. > vacuum_is_relation_owner() looks like it's now rather misnamed. Maybe >

Re: PGDOCS - Logical replication GUCs - added some xrefs

2022-11-23 Thread Peter Smith
On Wed, Nov 23, 2022 at 9:16 AM Peter Smith wrote: > > On Wed, Nov 16, 2022 at 10:24 PM vignesh C wrote: > > > ... > > > One suggestion: > > The format of subscribers includes the data type and default values, > > the format of publishers does not include data type and default > > values. We can

Re: Patch: Global Unique Index

2022-11-23 Thread Thomas Kellerer
Tom Lane schrieb am 18.11.2022 um 16:06: Do we need new syntax actually? I think that a global unique index can be created automatically instead of raising an error "unique constraint on partitioned table must include all partitioning columns" I'm not convinced that we want this feature at

Re: Patch: Global Unique Index

2022-11-23 Thread Cary Huang
Hi Simon Thank you so much for sharing these valuable comments and concerns to our work. We understand there is a lot of TODOs left to be done to move forward with this in a serious matter. Your comments have been very helpful and we are very grateful. > You don't seem to mention that

Re: odd buildfarm failure - "pg_ctl: control file appears to be corrupt"

2022-11-23 Thread Tom Lane
Thomas Munro writes: > On Wed, Nov 23, 2022 at 11:03 PM Thomas Munro wrote: >> I assume this is ext4. Presumably anything that reads the >> controlfile, like pg_ctl, pg_checksums, pg_resetwal, >> pg_control_system(), ... by reading without interlocking against >> writes could see garbage. I

Re: odd buildfarm failure - "pg_ctl: control file appears to be corrupt"

2022-11-23 Thread Thomas Munro
On Wed, Nov 23, 2022 at 11:03 PM Thomas Munro wrote: > On Wed, Nov 23, 2022 at 2:42 PM Andres Freund wrote: > > The failure has to be happening in wait_for_postmaster_promote(), because > > the > > standby2 is actually successfully promoted. > > I assume this is ext4. Presumably anything that

Re: More efficient build farm animal wakeup?

2022-11-23 Thread Tom Lane
Thomas Munro writes: > On Thu, Nov 24, 2022 at 10:00 AM Magnus Hagander wrote: >> On Wed, Nov 23, 2022 at 9:15 AM Thomas Munro wrote: >> Are you saying you still think it's worth pursuing longpoll or similar >> methods for it, or that this is good enough? > I personally think it'd be pretty

Re: Allow single table VACUUM in transaction block

2022-11-23 Thread Justin Pryzby
On Tue, Nov 22, 2022 at 05:16:59PM +, Simon Riggs wrote: > Justin, if you wanted to take up the patch from here, I would be more > than happy. You have the knowledge and insight to make this work > right. I have no particular use for this, so I wouldn't be a good person to finish or shepherd

Re: More efficient build farm animal wakeup?

2022-11-23 Thread Thomas Munro
On Thu, Nov 24, 2022 at 10:00 AM Magnus Hagander wrote: > On Wed, Nov 23, 2022 at 9:15 AM Thomas Munro wrote: > Are you saying you still think it's worth pursuing longpoll or similar > methods for it, or that this is good enough? I personally think it'd be pretty neat, to squeeze out that last

Re: fixing CREATEROLE

2022-11-23 Thread Robert Haas
On Wed, Nov 23, 2022 at 4:18 PM Tom Lane wrote: > To be clear, I'm not saying that I know a better answer. But the fact > that these end up so different from other role-property bits seems to > me to suggest that making them role-property bits is the wrong thing. > They aren't privileges in any

Re: fixing CREATEROLE

2022-11-23 Thread Tom Lane
"David G. Johnston" writes: > On Wed, Nov 23, 2022 at 2:18 PM Robert Haas wrote: >> Either way, I'm not quite sure what the benefit of converting these >> things to predefined roles is. > Specifically, you gain inheritance/set and "admin option" for free. Right: the practical issue with

Re: fixing CREATEROLE

2022-11-23 Thread David G. Johnston
On Wed, Nov 23, 2022 at 2:18 PM Robert Haas wrote: > On Wed, Nov 23, 2022 at 3:59 PM David G. Johnston > wrote: > > I haven't yet formed a complete thought here but is there any reason we > cannot convert the permission-like attributes to predefined roles? > > > > pg_login > > pg_replication >

Re: Documentation for building with meson

2022-11-23 Thread samay sharma
Hi, On Wed, Nov 23, 2022 at 12:16 PM Justin Pryzby wrote: > On Wed, Nov 23, 2022 at 11:30:54AM -0800, samay sharma wrote: > > Thanks for the feedback. Addressed all and added markup at a few more > > places in v6 (attached). > > Thanks. It looks good to me. A couple thoughts, maybe they're

Re: fixing CREATEROLE

2022-11-23 Thread David G. Johnston
On Wed, Nov 23, 2022 at 2:01 PM Robert Haas wrote: > In the latter case there are two, one with > > grantor=bootstrap_supeuser/admin_option=true/set_option=false/inherit_option=false > and a second with > grantor=alice/admin_option=false/set_option=true/inherit_option=true. > This, IMO, is

Re: fixing CREATEROLE

2022-11-23 Thread Tom Lane
Robert Haas writes: > But having said that, I could certainly change the patches so that any > user, or maybe just a createrole user since it's otherwise irrelevant, > can flip the INHERITCREATEDROLE and SETCREATEDROLE bits on their own > account. There would be no harm in that from a security or

Re: fixing CREATEROLE

2022-11-23 Thread Robert Haas
On Wed, Nov 23, 2022 at 3:59 PM David G. Johnston wrote: > I haven't yet formed a complete thought here but is there any reason we > cannot convert the permission-like attributes to predefined roles? > > pg_login > pg_replication > pg_bypassrls > pg_createdb > pg_createrole > pg_haspassword

Re: drop postmaster symlink

2022-11-23 Thread Andres Freund
Hi, On 2022-11-23 15:48:04 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2022-11-23 10:07:49 -0500, Tom Lane wrote: > >> On the whole, is it really that hard to add the symlink to the meson build? > > > No. Meson has a builtin command for it, just not in the meson version we're > >

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-11-23 Thread Nathan Bossart
On Tue, Nov 22, 2022 at 04:59:28PM +0530, Amit Kapila wrote: > On Tue, Nov 22, 2022 at 6:11 AM Nathan Bossart > wrote: >> While working on avoiding unnecessary wakeups in logical/worker.c (as was >> done for walreceiver.c in 05a7be9), I noticed that the tests began taking >> much longer. This

Re: fixing CREATEROLE

2022-11-23 Thread Robert Haas
On Wed, Nov 23, 2022 at 3:33 PM Tom Lane wrote: > > Because they are role-level properties, they can be set by whoever has > > ADMIN OPTION on the role. That always includes every superuser, and it > > never includes Alice herself (except if she's a superuser). > > That is just bizarre. Alice

Re: More efficient build farm animal wakeup?

2022-11-23 Thread Magnus Hagander
On Wed, Nov 23, 2022 at 9:15 AM Thomas Munro wrote: > On Wed, Nov 23, 2022 at 2:09 PM Andres Freund wrote: > > It's a huge improvement here. > > Same here. eelpout + elver looking good, just a fraction of a second > hitting that web server each minute. Long polling will be better and > shave

Re: fixing CREATEROLE

2022-11-23 Thread David G. Johnston
On Wed, Nov 23, 2022 at 1:04 PM Robert Haas wrote: > > I'm not very certain about any of that stuff; I don't have a clear > mental model of how it should work, or even what exact problem we're > trying to solve. To me, the patches that I posted make sense as far as > they go, but I'm not under

Re: Add sub-transaction overflow status in pg_stat_activity

2022-11-23 Thread Andres Freund
Hi, On 2022-11-23 15:25:39 -0500, Robert Haas wrote: > One thing that I'd really like to see better documented is exactly > what it is that causes a problem. But first we'd have to understand it > ourselves. It's not as simple as "if you have more than 64 subxacts in > any top-level xact, kiss

Re: Add LZ4 compression in pg_dump

2022-11-23 Thread Justin Pryzby
On Tue, Nov 22, 2022 at 10:00:47AM +, gkokola...@pm.me wrote: > For the record I am currently working on it simply unsure if I should submit > WIP patches and add noise to the list or wait until it is in a state that I > feel that the comments have been addressed. > > A new version that I

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-11-23 Thread Nathan Bossart
On Tue, Nov 22, 2022 at 07:25:36AM +, houzj.f...@fujitsu.com wrote: > On Tuesday, November 22, 2022 2:49 PM Hayato Kuroda (Fujitsu) > >> Thanks for updating! It becomes better. Further comments: >> >> 01. AlterSubscription() >> >> ``` >> +LogicalRepWorkersWakeupAtCommit(subid); >> + >>

Re: drop postmaster symlink

2022-11-23 Thread Tom Lane
Andres Freund writes: > On 2022-11-23 10:07:49 -0500, Tom Lane wrote: >> On the whole, is it really that hard to add the symlink to the meson build? > No. Meson has a builtin command for it, just not in the meson version we're > currently requiring. We can create the symlink ourselves instead.

Re: fixing CREATEROLE

2022-11-23 Thread Robert Haas
On Wed, Nov 23, 2022 at 3:11 PM Mark Dilger wrote: > Ok, so the critical part of this proposal is that auditing tools can tell > when Alice circumvents these settings. Without that bit, the whole thing is > inane. Why make Alice jump through hoops that you are explicitly allowing > her to

Re: Document parameter count limit

2022-11-23 Thread Justin Pryzby
On Wed, Nov 23, 2022 at 12:35:59PM -0700, David G. Johnston wrote: > On Wed, Nov 23, 2022 at 11:47 AM Tom Lane wrote: > > > Bruce Momjian writes: > > > Does this come up enough to document it? I assume the error message the > > > user receives is clear. > > > > Looks like you get > > > >

Re: fixing CREATEROLE

2022-11-23 Thread Tom Lane
Robert Haas writes: > On Wed, Nov 23, 2022 at 2:28 PM Mark Dilger > wrote: >> I had incorrectly imagined that if the bootstrap superuser granted >> CREATEROLE to Alice with particular settings, those settings would >> limit the things that Alice could do when creating role Bob, >> specifically

Re: drop postmaster symlink

2022-11-23 Thread Joe Conway
On 11/23/22 15:10, Robert Haas wrote: On Wed, Nov 23, 2022 at 2:50 PM Andres Freund wrote: On 2022-11-23 10:07:49 -0500, Tom Lane wrote: > Devrim =?ISO-8859-1?Q?G=FCnd=FCz?= writes: > > ...and it helps us to find the "main" process a bit easily. > > Hmm, that's a nontrivial point perhaps.

Re: Document parameter count limit

2022-11-23 Thread Tom Lane
"David G. Johnston" writes: > I do believe that people who want to use a large parameter list likely have > that question in the back of their mind, and looking at a page called > "System Limits" is at least plausibly something they would do. Since they > are really caring about

Re: Add sub-transaction overflow status in pg_stat_activity

2022-11-23 Thread Robert Haas
On Wed, Nov 23, 2022 at 2:01 PM Bruce Momjian wrote: > I originally thought having this value in pg_stat_activity was overkill, > but seeing the other internal/warning columns in that view, I think it > makes sense. Oddly, is our 64 snapshot performance limit even > documented anywhere? I know

Re: Tests for psql \g and \o

2022-11-23 Thread Daniel Verite
Michael Paquier wrote: > +psql_like($node, "SELECT 'one' \\g | cat >$g_file", qr//, "one command > \\g"); > +my $c1 = slurp_file($g_file); > +like($c1, qr/one/); > > Windows may not have an equivalent for "cat", no? Note that psql's > 001_basic.pl has no restriction in place for

Re: Documentation for building with meson

2022-11-23 Thread Justin Pryzby
On Wed, Nov 23, 2022 at 11:30:54AM -0800, samay sharma wrote: > Thanks for the feedback. Addressed all and added markup at a few more > places in v6 (attached). Thanks. It looks good to me. A couple thoughts, maybe they're not important. - LZ4 and Zstd refer to wal_compression and

Re: fixing CREATEROLE

2022-11-23 Thread Mark Dilger
> On Nov 23, 2022, at 12:04 PM, Robert Haas wrote: > >> But if that's the case, did I misunderstand upthread that these are >> properties the superuser specifies about Alice? Can Alice just set these >> properties about herself, so she gets the behavior she wants? I'm confused >> now

Re: drop postmaster symlink

2022-11-23 Thread Robert Haas
On Wed, Nov 23, 2022 at 2:50 PM Andres Freund wrote: > On 2022-11-23 10:07:49 -0500, Tom Lane wrote: > > Devrim =?ISO-8859-1?Q?G=FCnd=FCz?= writes: > > > ...and it helps us to find the "main" process a bit easily. > > > > Hmm, that's a nontrivial point perhaps. It's certain that this > > will

Re: [PoC] Federated Authn/z with OAUTHBEARER

2022-11-23 Thread Jacob Champion
On 11/23/22 01:58, mahendrakar s wrote: > We validated on  libpq handling OAuth natively with different flows > with different OIDC certified providers. > > Flows: Device Code, Client Credentials and Refresh Token. > Providers: Microsoft, Google and Okta. Great, thank you! > Also validated with

Re: fixing CREATEROLE

2022-11-23 Thread Robert Haas
On Wed, Nov 23, 2022 at 2:28 PM Mark Dilger wrote: > > On Nov 23, 2022, at 11:02 AM, Robert Haas wrote: > > For me, this > > clearly falls into the "good" category: it's configuration that you > > put into the database that makes things happen the way you want, not a > > behavior-changing

Re: predefined role(s) for VACUUM and ANALYZE

2022-11-23 Thread Andrew Dunstan
On 2022-11-20 Su 11:57, Nathan Bossart wrote: > On Sat, Nov 19, 2022 at 10:50:04AM -0800, Nathan Bossart wrote: >> another rebase > Another rebase for cfbot. > I have committed the first couple of these to get them out of the way. But I think we need a bit of cleanup in the next patch.

Re: drop postmaster symlink

2022-11-23 Thread Andres Freund
Hi, On 2022-11-23 10:07:49 -0500, Tom Lane wrote: > Devrim =?ISO-8859-1?Q?G=FCnd=FCz?= writes: > > ...and it helps us to find the "main" process a bit easily. > > Hmm, that's a nontrivial point perhaps. It's certain that this > will break some other people's start scripts too. OTOH,

Re: Document parameter count limit

2022-11-23 Thread David G. Johnston
On Wed, Nov 23, 2022 at 11:47 AM Tom Lane wrote: > Bruce Momjian writes: > > Does this come up enough to document it? I assume the error message the > > user receives is clear. > > Looks like you get > > if (nParams < 0 || nParams > PQ_QUERY_PARAM_MAX_LIMIT) > { >

Re: Documentation for building with meson

2022-11-23 Thread samay sharma
Hi, On Tue, Nov 22, 2022 at 10:36 PM Justin Pryzby wrote: > On Mon, Nov 14, 2022 at 10:41:21AM -0800, samay sharma wrote: > > > You need LZ4, if you want to support compression of data with that > > method; see default_toast_compression and wal_compression. > > => The first comma is odd. Maybe

Re: fixing CREATEROLE

2022-11-23 Thread Mark Dilger
> On Nov 23, 2022, at 11:02 AM, Robert Haas wrote: > > For me, this > clearly falls into the "good" category: it's configuration that you > put into the database that makes things happen the way you want, not a > behavior-changing setting that comes along and ruins somebody's day. I had

Re: postgres_fdw binary protocol support

2022-11-23 Thread Greg Stark
On Tue, 22 Nov 2022 at 08:17, Ashutosh Bapat wrote: > > AFAIU, binary compatibility of two postgresql servers depends upon the > binary compatibility of the platforms on which they run. No, libpq binary mode is not architecture-specific. I think you're thinking of on-disk binary compatibility.

Re: Hash index build performance tweak from sorting

2022-11-23 Thread Tomas Vondra
On 11/23/22 14:07, David Rowley wrote: > On Fri, 18 Nov 2022 at 03:34, Tomas Vondra > wrote: >> I did some simple benchmark with v2 and v3, using the attached script, >> which essentially just builds hash index on random data, with different >> data types and maintenance_work_mem values. And

Re: fixing CREATEROLE

2022-11-23 Thread Robert Haas
On Wed, Nov 23, 2022 at 1:11 PM Tom Lane wrote: > I haven't thought about these issues hard enough to form an overall > opinion (though I agree that making CREATEROLE less tantamount > to superuser would be an improvement). However, I share Mark's > discomfort about making these commands act

Re: Add sub-transaction overflow status in pg_stat_activity

2022-11-23 Thread Bruce Momjian
On Mon, Nov 14, 2022 at 10:09:57AM -0500, Robert Haas wrote: > I think I fundamentally disagree with the idea that we should refuse > to expose instrumentation data because some day the internals might > change. If we accepted that argument categorically, we wouldn't have > things like

Re: Another multi-row VALUES bug

2022-11-23 Thread Tom Lane
Dean Rasheed writes: > On Wed, 23 Nov 2022 at 15:30, Tom Lane wrote: >> Hmm ... this patch does not feel any more principled or future-proof >> than what it replaces, because now instead of making assumptions >> about what's in the jointree, you're making assumptions about what's >> in the

Re: Document parameter count limit

2022-11-23 Thread Tom Lane
Bruce Momjian writes: > Does this come up enough to document it? I assume the error message the > user receives is clear. Looks like you get if (nParams < 0 || nParams > PQ_QUERY_PARAM_MAX_LIMIT) { libpq_append_conn_error(conn, "number of parameters must be between 0 and %d",

Re: Transparent column encryption

2022-11-23 Thread Peter Eisentraut
On 28.10.22 12:16, Jehan-Guillaume de Rorthais wrote: I did a review of the documentation and usability. I have incorporated some of your feedback into the v11 patch I just posted. # Applying patch The patch applied on top of f13b2088fa2 without trouble. Notice a small warning during

Re: Another multi-row VALUES bug

2022-11-23 Thread Dean Rasheed
On Wed, 23 Nov 2022 at 15:30, Tom Lane wrote: > > > So I think what the code needs to do is examine the targetlist, and > > identify the VALUES RTE that the current query is using as a source, > > and rewrite just that RTE (so any original VALUES RTE is rewritten at > > the top level, and any

Re: Question concerning backport of CVE-2022-2625

2022-11-23 Thread Roberto C . Sánchez
Hi Tom, On Sun, Nov 20, 2022 at 11:43:41AM -0500, Tom Lane wrote: > > It'd likely be a good idea to reproduce this with a gdb breakpoint > set at errfinish, and see exactly what's leading up to the error. > So, I did as you suggested. The top few frames of the backtrace were: #0 errfinish

Re: Document parameter count limit

2022-11-23 Thread Bruce Momjian
On Thu, Nov 10, 2022 at 11:01:18AM -0700, David G. Johnston wrote: > On Thu, Nov 10, 2022 at 10:58 AM Corey Huinker > wrote: > > > +    if you are reading this prepatorily, please redesign your > query to use temporary tables or arrays > > > I agree with the documentation

Questions regarding distinct operation implementation

2022-11-23 Thread Ankit Kumar Pandey
Hello, I have questions regarding distinct operation and would be glad if someone could help me out. Consider the following table (mytable): id, name 1, A 1, A 2, B 3, A 1, A If we do /select avg(id) over (partition by name) from mytable/, partition logic goes like this: for A: 1,

Re: fixing CREATEROLE

2022-11-23 Thread Tom Lane
Robert Haas writes: > On Wed, Nov 23, 2022 at 12:36 PM Mark Dilger > wrote: >> Yes, this all makes sense, but does it entail that the CREATE ROLE command >> must behave differently on the basis of a setting? > Well, we certainly don't HAVE to add those new role-level properties; > that's why

Re: code cleanups

2022-11-23 Thread Robert Haas
On Wed, Nov 23, 2022 at 12:53 PM Tom Lane wrote: > at least for bool arrays, that's true of memset'ing as well. But this, > if you decide you need something other than zeroes, is a foot-gun. > In particular, someone whose C is a bit weak might mistakenly think that > > bool

Re: fixing CREATEROLE

2022-11-23 Thread Robert Haas
On Wed, Nov 23, 2022 at 12:36 PM Mark Dilger wrote: > Oh, I don't mean that it will be poorly documented. I mean that the way the > command is written won't advertise what it is going to do. That's concerning > if you fat-finger a CREATE ROLE command, then realize you need to drop and >

Re: code cleanups

2022-11-23 Thread Tom Lane
Justin Pryzby writes: > Some modest cleanups I've accumulated. Hmm ... I don't especially care for either 0001 or 0002, mainly because I do not agree that this is good style: - boolnulls[PG_STAT_GET_RECOVERY_PREFETCH_COLS]; + bool

Re: fixing CREATEROLE

2022-11-23 Thread Mark Dilger
> On Nov 23, 2022, at 9:01 AM, Robert Haas wrote: > >> That's not to say that I wouldn't rather that it always work one way or >> always the other. It's just to say that I don't want it to work differently >> based on some poorly advertised property of the role executing the command. > >

code cleanups

2022-11-23 Thread Justin Pryzby
Some modest cleanups I've accumulated. >From 9c5846cc3f04c6797696a234fac0953815e09e4b Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 23 Oct 2022 14:52:48 -0500 Subject: [PATCH 1/6] WIP: do not loop to set an array to false See also: 9fd45870c1436b477264c0c82eb195df52bc0919

Re: fixing CREATEROLE

2022-11-23 Thread Robert Haas
On Tue, Nov 22, 2022 at 5:48 PM Mark Dilger wrote: > Whatever behavior is to happen in the CREATE ROLE statement should be spelled > out in that statement. "CREATE ROLE bob WITH INHERIT false WITH SET false" > doesn't seem too unwieldy, and has the merit that it can be read and > understood

Re: pgsql: Prevent instability in contrib/pageinspect's regression test.

2022-11-23 Thread Greg Stark
On Mon, 21 Nov 2022 at 15:01, Andres Freund wrote: > > It's somewhat sad to add this restriction - I've used get_raw_page() (+ > other functions) to scan a whole database for a bug. IIRC that actually > did end up using parallelism, albeit likely not very efficiently. > > Don't really have a

Re: Non-decimal integer literals

2022-11-23 Thread Dean Rasheed
On Tue, 22 Nov 2022 at 13:37, Peter Eisentraut wrote: > > On 15.11.22 11:31, Peter Eisentraut wrote: > > On 14.11.22 08:25, John Naylor wrote: > >> Regarding the patch, it looks good overall. My only suggestion would > >> be to add a regression test for just below and just above overflow, at > >>

Re: Prefetch the next tuple's memory during seqscans

2022-11-23 Thread Bruce Momjian
On Wed, Nov 23, 2022 at 11:03:22AM -0500, Bruce Momjian wrote: > > CPUs have several different kinds of 'hardware prefetchers' (worth > > reading about), that look out for sequential and striding patterns and > > try to get the cache line ready before you access it. Using the > > prefetch

Re: Fix for visibility check on 14.5 fails on tpcc with high concurrency

2022-11-23 Thread Peter Geoghegan
On Wed, Nov 23, 2022 at 2:54 AM Alvaro Herrera wrote: > Something like the attached. It would result in output like this: > WARNING: new multixact has more than one updating member: 0 2[17378 (keysh), > 17381 (nokeyupd)] > > Then it should be possible to trace (in pg_waldump output) the >

Re: Prefetch the next tuple's memory during seqscans

2022-11-23 Thread Bruce Momjian
On Wed, Nov 2, 2022 at 12:42:11AM +1300, Thomas Munro wrote: > On Wed, Nov 2, 2022 at 12:09 AM Andy Fan wrote: > > By theory, Why does the preferch make thing better? I am asking this > > because I think we need to read the data from buffer to cache line once > > in either case (I'm obvious

Re: [PATCH] minor optimization for ineq_histogram_selectivity()

2022-11-23 Thread Tom Lane
=?UTF-8?Q?Fr=c3=a9d=c3=a9ric_Yhuel?= writes: > On 10/24/22 17:26, Frédéric Yhuel wrote: >> When studying the weird planner issue reported here [1], I came up with >> the attached patch. It reduces the probability of calling >> get_actual_variable_range(). > This isn't very useful anymore

Re: Bug in MERGE's test for tables with rules

2022-11-23 Thread Tom Lane
Dean Rasheed writes: > While playing around with rules and MERGE, I noticed that there is a > bug in the way that it detects whether the target table has rules --- > it uses rd_rel->relhasrules, which can be incorrect, since it might be > set for a table that doesn't currently have rules, but did

Re: Another multi-row VALUES bug

2022-11-23 Thread Tom Lane
Dean Rasheed writes: > In RewriteQuery(), the code assumes that in a multi-row INSERT query, > the VALUES RTE will be the only thing in the query's fromlist. That's > true for the original query, but it's not necessarily the case for > product queries, if the rule action performs a multi-row

Re: [PATCH] minor optimization for ineq_histogram_selectivity()

2022-11-23 Thread Frédéric Yhuel
On 10/24/22 17:26, Frédéric Yhuel wrote: Hello, When studying the weird planner issue reported here [1], I came up with the attached patch. It reduces the probability of calling get_actual_variable_range(). This isn't very useful anymore thanks to this patch:

Re: drop postmaster symlink

2022-11-23 Thread Tom Lane
Devrim =?ISO-8859-1?Q?G=FCnd=FCz?= writes: > ...and it helps us to find the "main" process a bit easily. Hmm, that's a nontrivial point perhaps. It's certain that this will break some other people's start scripts too. On the whole, is it really that hard to add the symlink to the meson build?

Re: New docs chapter on Transaction Management and related changes

2022-11-23 Thread Bruce Momjian
On Wed, Nov 23, 2022 at 02:17:19AM -0600, Justin Pryzby wrote: > On Tue, Nov 22, 2022 at 01:50:36PM -0500, Bruce Momjian wrote: > > + > > + > > + A more complex example with multiple nested subtransactions: > > + > > +BEGIN; > > +INSERT INTO table1 VALUES (1); > > +SAVEPOINT sp1; > > +

Re: drop postmaster symlink

2022-11-23 Thread Devrim Gündüz
Hi, On Wed, 2022-11-23 at 09:18 -0500, Joe Conway wrote: > I am a big +1 on removing the symlink, however it is worth pointing > out > that the PGDG RPMs still use the symlink in the included systemd > service > file: > > 8<-- > ExecStart=/usr/pgsql-15/bin/postmaster -D ${PGDATA}

Re: drop postmaster symlink

2022-11-23 Thread Joe Conway
On 11/23/22 02:52, Peter Eisentraut wrote: A little while ago we discussed briefly over in the meson thread whether we could remove the postmaster symlink [0]. The meson build system currently does not install a postmaster symlink. (AFAICT, the MSVC build system does not either.) So if we

Re: New docs chapter on Transaction Management and related changes

2022-11-23 Thread Bruce Momjian
On Wed, Nov 23, 2022 at 08:57:33AM +0100, Laurenz Albe wrote: > On Tue, 2022-11-22 at 13:50 -0500, Bruce Momjian wrote: > > Agreed, updated patch attached. > > I cannot find any more problems, and I shouldn't mention the extra empty > line at the end of the patch. Fixed. ;-) > I'd change the

Re: [PATCH] Const'ify the arguments of ilist.c/ilist.h functions

2022-11-23 Thread Aleksander Alekseev
Hi Andres, Thanks for the review! > I don't think it is correct for any of these to add const. The only reason it > works is because of casting etc. Fair enough. PFA the corrected patch v2. -- Best regards, Aleksander Alekseev v2-0001-Constify-the-arguments-of-ilist.c-h-functions.patch

  1   2   >