Re: Refactoring SysCacheGetAttr to know when attr cannot be NULL

2023-03-25 Thread Tom Lane
Justin Pryzby writes: > On Mon, Mar 13, 2023 at 02:19:07PM +0100, Daniel Gustafsson wrote: >> + elog(ERROR, >> +"unexpected NULL value in cached tuple for >> pg_catalog.%s.%s", >> +get_rel_name(cacheinfo[cacheId].reloid), > Question:

Re: Refactoring SysCacheGetAttr to know when attr cannot be NULL

2023-03-25 Thread Justin Pryzby
On Mon, Mar 13, 2023 at 02:19:07PM +0100, Daniel Gustafsson wrote: > > On 2 Mar 2023, at 15:44, Tom Lane wrote: > > > > Peter Eisentraut writes: > >> I think an error message like > >> "unexpected null value in system cache %d column %d" > >> is sufficient. Since these are "can't happen"

Re: Request for comment on setting binary format output per session

2023-03-25 Thread Dave Cramer
Dave Cramer On Sat, 25 Mar 2023 at 19:06, Jeff Davis wrote: > On Thu, 2023-03-23 at 15:37 -0400, Dave Cramer wrote: > > So where do we go from here ? > > > > I can implement using type names as well as OID's > > My current thought is that you should use the protocol extension and > make type

Re: Request for comment on setting binary format output per session

2023-03-25 Thread Jeff Davis
On Thu, 2023-03-23 at 15:37 -0400, Dave Cramer wrote: > So where do we go from here ? > > I can implement using type names as well as OID's My current thought is that you should use the protocol extension and make type names work (in addition to OIDs) at least for fully-qualified type names. I

Re: Request for comment on setting binary format output per session

2023-03-25 Thread Jeff Davis
On Fri, 2023-03-24 at 07:52 -0500, Merlin Moncure wrote: > I think so.  Dave's idea puts a lot of flexibility into the client > side, and that's good.  Search path mechanics are really well > understood and well integrated with extensions already (create > extension ..schema) assuming that the

Re: Refactoring SysCacheGetAttr to know when attr cannot be NULL

2023-03-25 Thread Daniel Gustafsson
> On 14 Mar 2023, at 08:00, Peter Eisentraut > wrote: > I prefer to use "null value" for SQL null values, and NULL for the C symbol. Thats a fair point, I agree with that. > I'm a bit hesitant about hardcoding pg_catalog here. That happens to be > true, of course, but isn't actually

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

2023-03-25 Thread Melanie Plageman
On Tue, Mar 21, 2023 at 6:03 AM Ants Aasma wrote: > > On Mon, 20 Mar 2023 at 00:59, Melanie Plageman > wrote: > > > > On Wed, Mar 15, 2023 at 6:46 AM Ants Aasma wrote: > > > > > > On Wed, 15 Mar 2023 at 02:29, Melanie Plageman > > > wrote: > > > > As for routine vacuuming and the other buffer

Re: what should install-world do when docs are not available?

2023-03-25 Thread Andres Freund
Hi, On 2023-03-25 16:40:03 -0400, Tom Lane wrote: > Andres Freund writes: > > Right now if one does install-world with autoconf, without having xmllint or > > xsltproc available, one gets an error: > > ERROR: `xmllint' is missing on your system. > > > Is that good? Should meson behave the same?

Re: Parallel Full Hash Join

2023-03-25 Thread Melanie Plageman
On Sat, Mar 25, 2023 at 09:21:34AM +1300, Thomas Munro wrote: > * reuse the same umatched_scan_{chunk,idx} variables as above > * rename the list of chunks to scan to work_queue > * fix race/memory leak if we see PHJ_BATCH_SCAN when we attach (it > wasn't OK to just fall through) ah, good

Re: what should install-world do when docs are not available?

2023-03-25 Thread Tom Lane
Andres Freund writes: > Right now if one does install-world with autoconf, without having xmllint or > xsltproc available, one gets an error: > ERROR: `xmllint' is missing on your system. > Is that good? Should meson behave the same? Since install-world is defined to install documentation, it

Re: Infinite Interval

2023-03-25 Thread Isaac Morland
On Sat, 25 Mar 2023 at 15:59, Tom Lane wrote: > Joseph Koshakow writes: > > In terms of adding/subtracting infinities, the IEEE standard is pay > > walled and I don't have a copy. I tried finding information online but > > I also wasn't able to find anything useful. I additionally checked to

what should install-world do when docs are not available?

2023-03-25 Thread Andres Freund
Hi, A question by Justin made me wonder what the right behaviour for world, install-world should be when the docs tools aren't available. I'm wondering from the angle of meson, but it also seems something we possibly should think about for autoconf. Right now if one does install-world with

Re: windows/meson cfbot warnings

2023-03-25 Thread Justin Pryzby
On Sun, Feb 26, 2023 at 09:54:25AM -0800, Andres Freund wrote: > On 2023-02-25 16:45:38 -0600, Justin Pryzby wrote: > > Unrelated, but something else changed and now there's this. > > > > https://cirrus-ci.com/task/6202242768830464 > > > > [20:10:34.310] c:\cirrus>call sh -c 'if grep ": warning

Re: Infinite Interval

2023-03-25 Thread Tom Lane
Joseph Koshakow writes: > In terms of adding/subtracting infinities, the IEEE standard is pay > walled and I don't have a copy. I tried finding information online but > I also wasn't able to find anything useful. I additionally checked to see > the results of C++, C, and Java, and they all match

Re: Progress report of CREATE INDEX for nested partitioned tables

2023-03-25 Thread Tom Lane
I pushed 0001 with some cosmetic changes (for instance, trying to make the style of the doc entries for partitions_total/partitions_done match the rest of their table). I'm not touching 0002 or 0003, because I think they're fundamentally a bad idea. Progress reporting is inherently inexact,

Re: Non-superuser subscription owners

2023-03-25 Thread Jeff Davis
On Fri, 2023-03-24 at 09:24 -0400, Robert Haas wrote: > I certainly agree that the security model isn't in a reasonable place > right now. However, I feel that: > > (1) adding an extra predefined role > (2) even adding the connection string security stuff I don't see how these points are

Re: Should vacuum process config file reload more often

2023-03-25 Thread Melanie Plageman
On Thu, Mar 23, 2023 at 8:27 PM Melanie Plageman wrote: > On Thu, Mar 23, 2023 at 2:09 AM Masahiko Sawada wrote: > > > And, I was wondering if it was worth trying to split up the part that > > > reloads the config file and all of the autovacuum stuff. The reloading > > > of the config file by

Re: hio.c does visibilitymap_pin()/IO while holding buffer lock

2023-03-25 Thread Peter Geoghegan
On Sat, Mar 25, 2023 at 11:17 AM Andres Freund wrote: > Thinking more about this, I think there's no inherent deadlock danger with > reading the VM while holding a buffer lock, "just" an efficiency issue. If we > avoid needing to do IO nearly all the time, by trying to pin the right page > before

Re: hio.c does visibilitymap_pin()/IO while holding buffer lock

2023-03-25 Thread Andres Freund
Hi, On 2023-03-25 12:57:17 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2023-03-25 14:34:25 +0100, Tomas Vondra wrote: > >> Can't we ensure we actually lock the vm buffer too in ReadBufferBI, > >> before calling ReadBufferExtended? Or am I confused and that's not > >> possible for some

Re: Bug with ICU for merge join

2023-03-25 Thread Jeff Davis
On Fri, 2023-03-24 at 15:45 -0400, Jeff Janes wrote: > Ever since 27b62377b47f9e7bf58613, I have been getting "ERROR: >  mergejoin input data is out of order" for the attached reproducer. Thank you for the report! And the simple repro. Fixed in 81a6d57e33. Regards, Jeff Davis

Re: Progress report of CREATE INDEX for nested partitioned tables

2023-03-25 Thread Tom Lane
Justin Pryzby writes: > On Sat, Mar 25, 2023 at 11:55:13AM -0400, Tom Lane wrote: >> That's why I wanted list_length() not list_length() - 1. We are >> doing *something* at the top partitioned table, it just doesn't >> involve a table scan, so I don't find this totally unreasonable. >> If you

Re: hio.c does visibilitymap_pin()/IO while holding buffer lock

2023-03-25 Thread Tom Lane
Andres Freund writes: > On 2023-03-25 14:34:25 +0100, Tomas Vondra wrote: >> Can't we ensure we actually lock the vm buffer too in ReadBufferBI, >> before calling ReadBufferExtended? Or am I confused and that's not >> possible for some reason? > Note that this is using P_NEW. I.e. we don't know

Re: hio.c does visibilitymap_pin()/IO while holding buffer lock

2023-03-25 Thread Andres Freund
Hi, On 2023-03-25 14:34:25 +0100, Tomas Vondra wrote: > On 3/25/23 03:57, Andres Freund wrote: > > 2) Change relevant code so that we only return a valid vmbuffer if we could > > do > >so without blocking / IO and, obviously, skip updating the VM if we > >couldn't get the buffer. > > >

Re: meson/msys2 fails with plperl/Strawberry

2023-03-25 Thread Andres Freund
Hi, On 2023-03-25 08:46:42 -0400, Andrew Dunstan wrote: > config/perl.m4 contains this: > > >AC_MSG_CHECKING(for flags to link embedded Perl) >if test "$PORTNAME" = "win32" ; then > perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib` > if test -e

Re: Progress report of CREATE INDEX for nested partitioned tables

2023-03-25 Thread Justin Pryzby
On Sat, Mar 25, 2023 at 11:55:13AM -0400, Tom Lane wrote: > Justin Pryzby writes: > > On Thu, Mar 23, 2023 at 04:35:46PM -0400, Tom Lane wrote: > >> Furthermore, as things stand it's not hard > >> for PARTITIONS_TOTAL to be zero --- there's at least one such case > >> in the regression tests ---

Re: Infinite Interval

2023-03-25 Thread Joseph Koshakow
In terms of adding/subtracting infinities, the IEEE standard is pay walled and I don't have a copy. I tried finding information online but I also wasn't able to find anything useful. I additionally checked to see the results of C++, C, and Java, and they all match which increases my confidence

Re: running logical replication as the subscription owner

2023-03-25 Thread Noah Misch
On Fri, Mar 24, 2023 at 10:00:36AM -0400, Robert Haas wrote: > On Fri, Mar 24, 2023 at 3:59 AM Jeff Davis wrote: > > That's a little confusing, why not just always use the > > SECURITY_RESTRICTED_OPERATION? Is there a use case I'm missing? > > Some concern was expressed -- not sure exactly where

Re: Progress report of CREATE INDEX for nested partitioned tables

2023-03-25 Thread Tom Lane
Justin Pryzby writes: > On Thu, Mar 23, 2023 at 04:35:46PM -0400, Tom Lane wrote: >> Furthermore, as things stand it's not hard >> for PARTITIONS_TOTAL to be zero --- there's at least one such case >> in the regression tests --- and that seems just weird to me. > I don't know why it'd seem

Re: Infinite Interval

2023-03-25 Thread Joseph Koshakow
On Fri, Mar 24, 2023 at 9:43 AM Ashutosh Bapat wrote: > >You don't need to do this, but looks like we can add DAYS_PER_WEEK macro and >use it here. I've attached a patch with this new macro. There's probably tons of places it can be used instead of hardcoding the number 7, but I'll save

Re: About the constant-TRUE clause in reconsider_outer_join_clauses

2023-03-25 Thread Tom Lane
Richard Guo writes: > Should we instead mark the constant-TRUE clause with required_relids > plus the OJ relid? I do not think it matters. > Even if the join does become clauseless, it will end up being an > unqualified nestloop. I think the join ordering algorithm will force > this join to be

Re: hio.c does visibilitymap_pin()/IO while holding buffer lock

2023-03-25 Thread Tomas Vondra
On 3/25/23 03:57, Andres Freund wrote: > Hi, > > Starting with > > commit 7db0cd2145f2bce84cac92402e205e4d2b045bf2 > Author: Tomas Vondra > Date: 2021-01-17 22:11:39 +0100 > > Set PD_ALL_VISIBLE and visibility map bits in COPY FREEZE > That's a bummer :-( > RelationGetBufferForTuple

meson/msys2 fails with plperl/Strawberry

2023-03-25 Thread Andrew Dunstan
Hi, config/perl.m4 contains this: AC_MSG_CHECKING(for flags to link embedded Perl) if test "$PORTNAME" = "win32" ; then perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib` if test -e "$perl_archlibexp/CORE/$perl_lib.lib"; then

Re: [PATCH] Add XMLText function (SQL/XML X038)

2023-03-25 Thread Jim Jones
On 25.03.23 12:53, Pavel Stehule wrote: so 25. 3. 2023 v 12:49 odesílatel Jim Jones napsal: Hi, This small patch proposes the implementation of the standard SQL/XML function XMLText (X038). It basically converts a text parameter into an xml text node. It uses the

Re: [PATCH] Add XMLText function (SQL/XML X038)

2023-03-25 Thread Pavel Stehule
so 25. 3. 2023 v 12:49 odesílatel Jim Jones napsal: > Hi, > > This small patch proposes the implementation of the standard SQL/XML > function XMLText (X038). It basically converts a text parameter into an > xml text node. It uses the libxml2 function xmlEncodeSpecialChars[1] to > escape possible

[PATCH] Add XMLText function (SQL/XML X038)

2023-03-25 Thread Jim Jones
Hi, This small patch proposes the implementation of the standard SQL/XML function XMLText (X038). It basically converts a text parameter into an xml text node. It uses the libxml2 function xmlEncodeSpecialChars[1] to escape possible predefined entities. This patch also contains

Re: Disable vacuuming to provide data history

2023-03-25 Thread marekmosiewicz
W dniu sob, 25.02.2023 o godzinie 03∶11 +0100, użytkownik Vik Fearing napisał: > On 2/24/23 22:06, Corey Huinker wrote: > > The main design blocker for me is how to handle dump/restore.  The > standard does not bother thinking about that. That would be a little difficult. Most probably you

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

2023-03-25 Thread Amit Kapila
On Fri, Mar 24, 2023 at 2:36 PM wangw.f...@fujitsu.com wrote: > > On Fri, Mar 24, 2023 at 14:17 PM Amit Kapila wrote: > > And I found there is a problem in the three back-branch patches > (HEAD_v21_0002*, > REL15_* and REL14_*): > In the function fetch_table_list, we use pg_partition_ancestors

Re: Commitfest 2023-03 starting tomorrow!

2023-03-25 Thread Etsuro Fujita
On Fri, Mar 24, 2023 at 5:42 AM Greg Stark wrote: > > * asynchronous execution support for Custom Scan > - This is a pretty small isolated feature. I was planning to review this patch, but unfortunately, I did not have time for that, and I do not think I will for v16. So if anyone wants to

Re: running logical replication as the subscription owner

2023-03-25 Thread Jelte Fennema
> As things stand today, if you think somebody's going to send you > changes to tables other than the ones you intend to replicate, you > could handle that by making sure that the user that owns the > subscription only has permission to write to the tables that are > expected to receive replicated

About the constant-TRUE clause in reconsider_outer_join_clauses

2023-03-25 Thread Richard Guo
I happened to notice a constant-TRUE clause with is_pushed_down being true while its required_relids not including the OJ being formed, which seems abnormal to me. It turns out that this clause comes from reconsider_outer_join_clauses(), as a dummy replacement if we've generated a derived clause.