Re: AIX support - alignment issues

2022-07-10 Thread Tom Lane
Thomas Munro writes: > Yeah. I wasn't too sure if that was mostly about "recent" or mostly > about "all distributions" but it wasn't doing much. Thanks, pushed. While we're here ... + Code support exists for M68K, M88K, M32R, and SuperH, but these architectures are not known to have been

Re: Fix gcc warning in sync.c (usr/src/backend/storage/sync/sync.c)

2022-07-10 Thread Tom Lane
[ cc'ing Thomas, whose code this seems to be ] Kyotaro Horiguchi writes: > At Sat, 9 Jul 2022 21:53:31 -0300, Ranier Vilela wrote > in >> sync.c: In function ¡RememberSyncRequest¢: >> sync.c:528:10: warning: assignment to ¡PendingFsyncEntry *¢ {aka ¡struct >> *¢} from incompatible pointer typ

Re: Fix gcc warning in sync.c (usr/src/backend/storage/sync/sync.c)

2022-07-10 Thread Kyotaro Horiguchi
At Sat, 9 Jul 2022 21:53:31 -0300, Ranier Vilela wrote in > sync.c: In function ‘RememberSyncRequest’: > sync.c:528:10: warning: assignment to ‘PendingFsyncEntry *’ {aka ‘struct > *’} from incompatible pointer type ‘PendingUnlinkEntry *’ {aka > ‘struct *’} [-Wincompatible-pointer-types] > 528

Re: pgsql: dshash: Add sequential scan support.

2022-07-10 Thread Thomas Munro
On Tue, Jul 5, 2022 at 3:21 PM Thomas Munro wrote: > On Tue, Jul 5, 2022 at 11:25 AM Andres Freund wrote: > > On 2022-07-05 11:20:54 +1200, Thomas Munro wrote: > > > Since there were 6 places with I-hold-no-lock assertions, I shoved the > > > loop into a function so I could do: > > > > > > -

Re: proposal: Allocate work_mem From Pool

2022-07-10 Thread Justin Pryzby
On Sun, Jul 10, 2022 at 08:45:38PM -0700, Joseph D Wagner wrote: > However, that's risky because it's 3GB per operation, not per > query/connection; it could easily spiral out of control. This is a well-known deficiency. I suggest to dig up the old threads to look into. It's also useful to includ

Re: [PATCH] Optimize json_lex_string by batching character copying

2022-07-10 Thread John Naylor
On Fri, Jul 8, 2022 at 3:06 PM John Naylor wrote: > > I've pushed 0001 (although the email seems to have been swallowed > again), and pending additional comments on 0002 and 0003 I'll squash > and push those next week. This is done. > 0004 needs some thought on integrating with > symbols we disc

wal write of large object

2022-07-10 Thread merryok
Hi, hackers I'm eager to dive into how to write wal for large object. In the code path: heap_insert -> heap_prepare_insert -> heap_toast_insert_or_update -> toast_save_datum -> heap_insert I find heap_insert is called back. 1. At heaptup = heap_prepare_insert(relation, tup, xid, cid, option

Re: Fast COPY FROM based on batch insert

2022-07-10 Thread Andrey Lepikhov
On 11/7/2022 04:12, Ian Barwick wrote: On 09/07/2022 00:09, Andrey Lepikhov wrote: On 8/7/2022 05:12, Ian Barwick wrote: ERROR:  bind message supplies 0 parameters, but prepared statement "pgsql_fdw_prep_178" requires 6 CONTEXT:  remote SQL command: INSERT INTO public.foo_part_1(t, v

proposal: Allocate work_mem From Pool

2022-07-10 Thread Joseph D Wagner
I'm new here, so forgive me if this is a bad idea or my lack of knowledge on how to optimize PostgreSQL. I find PostgreSQL to be great with a large number of small transactions, which covers most use cases. However, my experience has not been so great on the opposite end -- a small number of larg

Re: Handle infinite recursion in logical replication setup

2022-07-10 Thread Peter Smith
Here are my review comments for the v30* patches: v30-0001 1.1 I was wondering if it is better to implement a new defGetOrigin method now instead of just using the defGetString to process the 'origin', since you may need to do that in future anyway if the 'origin' name is plan

Re: Add function to return backup_label and tablespace_map

2022-07-10 Thread Kyotaro Horiguchi
At Fri, 8 Jul 2022 01:43:49 +0900, Fujii Masao wrote in > finishes. For example, this function allows us to take a backup using > the following psql script file. > > -- > SELECT * FROM pg_backup_start('test'); > \! cp -a $PGDATA /backup > SELECT * FROM pg_backup_stop

Re: defGetBoolean - Fix comment

2022-07-10 Thread Peter Smith
On Mon, Jul 11, 2022 at 12:09 PM Michael Paquier wrote: > > On Thu, Jul 07, 2022 at 09:54:24AM +0900, Michael Paquier wrote: > > Still, I think that your adjustment is right, as the check is, indeed, > > on the DefElem's value*. Or you could just say "If no value given". > > Peter, I have applied

Re: defGetBoolean - Fix comment

2022-07-10 Thread Michael Paquier
On Thu, Jul 07, 2022 at 09:54:24AM +0900, Michael Paquier wrote: > Still, I think that your adjustment is right, as the check is, indeed, > on the DefElem's value*. Or you could just say "If no value given". Peter, I have applied something using your original wording. This is a minor issue, but

Re: Extending outfuncs support to utility statements

2022-07-10 Thread Tatsuo Ishii
Hi, Now we are ready to have debug_print_raw_parse (or something like that)? Pgpool-II has been importing and using PostgreSQL's raw parser for years. I think it would be great for PostgreSQL and Pgpool-II developers to have such a feature. Best reagards, -- Tatsuo Ishii SRA OSS, Inc. Japan Engl

Re: pg15b2: large objects lost on upgrade

2022-07-10 Thread Michael Paquier
On Fri, Jul 08, 2022 at 10:44:07AM -0400, Robert Haas wrote: > Thanks for checking over the reasoning, and the kind words in general. Thanks for fixing the main issue. > I just committed Justin's fix for the bug, without fixing the fact > that the new cluster's original pg_largeobject files will

Re: Bump MIN_WINNT to 0x0600 (Vista) as minimal runtime in 16~

2022-07-10 Thread Michael Paquier
On Thu, Jul 07, 2022 at 01:56:39PM +0900, Michael Paquier wrote: > And I have applied that, after noticing that the MinGW was complaining > because _WIN32_WINNT was not getting set like previously and removing > _WIN32_WINNT as there is no need for it anymore. The CI has reported > green for all m

Re: Allow file inclusion in pg_hba and pg_ident files

2022-07-10 Thread Michael Paquier
On Fri, Jul 08, 2022 at 02:57:21PM +0800, Julien Rouhaud wrote: My apologies for the late reply. > I don't have an extensive knowledge of all the user facing error messages, but > after a quick grep I see multiple usage of OID, PID, GIN and other defined > acronyms. I also see multiple occurrenc

Re: Fast COPY FROM based on batch insert

2022-07-10 Thread Ian Barwick
On 09/07/2022 00:09, Andrey Lepikhov wrote: On 8/7/2022 05:12, Ian Barwick wrote: ERROR:  bind message supplies 0 parameters, but prepared statement "pgsql_fdw_prep_178" requires 6 CONTEXT:  remote SQL command: INSERT INTO public.foo_part_1(t, v1, v2, v3, v4, v5) VALUES ($1, $2, $3,

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

2022-07-10 Thread Andres Freund
Hi, On 2022-07-08 17:05:49 -0400, Andrew Dunstan wrote: > Actually, it's not the same name: JsonCoercionsState vs > JsonCoercionState. But I agree that it's a subtle enough difference that > we should use something more obvious. Maybe JsonCoercionStates instead > of JsonCoercionsState? The plural

Re: Extending outfuncs support to utility statements

2022-07-10 Thread Tom Lane
Andres Freund writes: > On 2022-07-10 19:12:52 -0400, Tom Lane wrote: >> They're not so much "cold" as "dead", so I don't see the point >> of having them at all. If we ever start allowing utility commands >> (besides NOTIFY) in stored rules, we'd need readfuncs support then >> ... but at least in

Re: Extending outfuncs support to utility statements

2022-07-10 Thread Andres Freund
Hi, On 2022-07-10 19:12:52 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2022-07-09 18:20:26 -0400, Tom Lane wrote: > >> For my taste, the circa 20K growth in outfuncs.o is an okay > >> price for being able to inspect utility statements more easily. > >> However, I'm less thrilled with th

Re: AIX support - alignment issues

2022-07-10 Thread Thomas Munro
On Mon, Jul 11, 2022 at 11:38 AM Tom Lane wrote: > WFM. I also wonder if in > > + PostgreSQL can be expected to work on current > + versions of these operating systems: Linux (all recent distributions), > Windows, > + FreeBSD, OpenBSD, NetBSD, DragonFlyBSD, macOS, AIX, Solaris, and illumos

Re: Making Vars outer-join aware

2022-07-10 Thread Tom Lane
Zhihong Yu writes: > In remove_unneeded_nulling_relids(): > + if (removable_relids == NULL) > Why is bms_is_empty() not used in the above check ? We initialized that to NULL just a few lines above, and then did nothing to it other than perhaps bms_add_member, so it's impossible for it to be e

Re: AIX support - alignment issues

2022-07-10 Thread Tom Lane
Thomas Munro writes: > OK, I word-smothe thusly: > + and PA-RISC, including > + big-endian, little-endian, 32-bit, and 64-bit variants where applicable. WFM. I also wonder if in + PostgreSQL can be expected to work on current + versions of these operating systems: Linux (all recent dis

Re: AIX support - alignment issues

2022-07-10 Thread Thomas Munro
On Fri, Jul 8, 2022 at 4:24 PM Tom Lane wrote: > Thomas Munro writes: > > * The documented list mentions some in different endiannesses and word > > sizes explicitly but not others; I think it'd be tidier to list the > > main architecture names and then tack on a "big and little endian, 32 > > an

Re: Extending outfuncs support to utility statements

2022-07-10 Thread Tom Lane
Andres Freund writes: > On 2022-07-09 18:20:26 -0400, Tom Lane wrote: >> For my taste, the circa 20K growth in outfuncs.o is an okay >> price for being able to inspect utility statements more easily. >> However, I'm less thrilled with the 30K growth in readfuncs.o, >> because I can't see that we'd

Re: automatically generating node support functions

2022-07-10 Thread Tom Lane
Andres Freund writes: > I was just rebasing meson ontop of this and was wondering whether the input > filenames were in a particular order: That annoyed me too. I think it's sensible to list the "main" input files first, but I'd put them in our traditional pipeline order: > nodes/nodes.h

Re: System catalog documentation chapter

2022-07-10 Thread Peter Smith
On Sat, Jul 9, 2022 at 5:32 AM Bruce Momjian wrote: > ... > Attached is a patch to accomplish this. Its output can be seen here: > > https://momjian.us/tmp/pgsql/internals.html > That output looks good to me. -- Kind Regards, Peter Smith. Fujitsu Australia

Re: pg_waldump got an error with waldump file generated by initdb

2022-07-10 Thread Justin Pryzby
On Sun, Jul 10, 2022 at 02:39:00PM -0700, Andres Freund wrote: > On 2022-07-10 21:51:04 +0900, Dong Wook Lee wrote: > > I don't know if this is an error. > > when I do ./initdb -D ../data and execute pg_waldump like this, In the last > > part I got an error. > > > > ``` > > ./pg_waldump ../data/p

Re: automatically generating node support functions

2022-07-10 Thread Andres Freund
Hi, On 2022-07-09 16:37:22 +0200, Peter Eisentraut wrote: > On 08.07.22 22:03, Tom Lane wrote: > > I think this is ready to go (don't forget the catversion bump). > > This is done now, after a brief vpath-shaped scare from the buildfarm > earlier today. I was just rebasing meson ontop of this an

Re: Extending outfuncs support to utility statements

2022-07-10 Thread Andres Freund
Hi, On 2022-07-09 18:20:26 -0400, Tom Lane wrote: > We've long avoided building I/O support for utility-statement node > types, mainly because it didn't seem worth the trouble to write and > maintain such code by hand. Now that the automatic node-support-code > generation patch is in, that argume

Re: pg_waldump got an error with waldump file generated by initdb

2022-07-10 Thread Andres Freund
Hi, On 2022-07-10 21:51:04 +0900, Dong Wook Lee wrote: > I don't know if this is an error. > when I do ./initdb -D ../data and execute pg_waldump like this, In the last > part I got an error. > > ``` > ./pg_waldump ../data/pg_wal/00010001 > ``` > > pg_waldump: error: error in

Re: Making Vars outer-join aware

2022-07-10 Thread Zhihong Yu
On Sun, Jul 10, 2022 at 12:39 PM Tom Lane wrote: > Here's v2 of this patch series. It's functionally identical to v1, > but I've rebased it over the recent auto-node-support-generation > changes, and also extracted a few separable bits in hopes of making > the main planner patch smaller. (It's

Re: Cleaning up historical portability baggage

2022-07-10 Thread Greg Stark
(Reading the patch it seems both those points are already addressed)

Re: Two successive tabs in test case are causing syntax error in psql

2022-07-10 Thread Alvaro Herrera
On 2022-Jul-08, Tom Lane wrote: > The usual recommendation for pasting text into psql when it contains > tabs is to start psql with the -n switch to disable tab completion. "Bracketed paste" also solves this problem. To enable this feature, just edit your $HOME/.inputrc file to have the line s

Re: Cleaning up historical portability baggage

2022-07-10 Thread Greg Stark
On Sat, 9 Jul 2022 at 21:46, Thomas Munro wrote: > > Hello, > > I wonder how much dead code for ancient operating systems we could now > drop. > 0002-Remove-dead-getrusage-replacement-code.patch I thought the getrusage replacement code was for Windows. Does getrusage on Windows actually do anyth

Re: Cleaning up historical portability baggage

2022-07-10 Thread Tom Lane
I wrote: > Having said that, I'll be happy to try out this patch series on > that platform and see if it burps. HEAD + patches 0001-0006 seems fine on prairiedog's host. Builds clean (or as clean as HEAD does anyway), passes make check. I did not trouble with check-world. (I haven't actually read

Re: Compilation issue on Solaris.

2022-07-10 Thread Tom Lane
Thomas Munro writes: > Something bothers me about adding yet more clutter to every compile > line for the rest of time to solve a problem that exists only for > unpatched systems, and also that it's not even really a Solaris thing, > it's a C11 thing. I tend to agree with this standpoint: if it's

pg_waldump got an error with waldump file generated by initdb

2022-07-10 Thread Dong Wook Lee
Hi, hackers I don't know if this is an error. when I do ./initdb -D ../data and execute pg_waldump like this, In the last part I got an error. ``` ./pg_waldump ../data/pg_wal/00010001 ``` pg_waldump: error: error in WAL record at 0/140: invalid record length at 0/1499A08: w