public inbox for [email protected]
help / color / mirror / Atom feed[PATCH 1/4] TAP test for copy-truncation optimization.
25+ messages / 7 participants
[nested] [flat]
* [PATCH 1/4] TAP test for copy-truncation optimization.
@ 2018-10-11 01:03 Kyotaro Horiguchi <[email protected]>
0 siblings, 0 replies; 25+ messages in thread
From: Kyotaro Horiguchi @ 2018-10-11 01:03 UTC (permalink / raw)
---
src/test/recovery/t/016_wal_optimize.pl | 192 ++++++++++++++++++++++++++++++++
1 file changed, 192 insertions(+)
create mode 100644 src/test/recovery/t/016_wal_optimize.pl
diff --git a/src/test/recovery/t/016_wal_optimize.pl b/src/test/recovery/t/016_wal_optimize.pl
new file mode 100644
index 0000000000..310772a2b3
--- /dev/null
+++ b/src/test/recovery/t/016_wal_optimize.pl
@@ -0,0 +1,192 @@
+# Test WAL replay for optimized TRUNCATE and COPY records
+#
+# WAL truncation is optimized in some cases with TRUNCATE and COPY queries
+# which sometimes interact badly with the other optimizations in line with
+# several setting values of wal_level, particularly when using "minimal" or
+# "replica". The optimization may be enabled or disabled depending on the
+# scenarios dealt here, and should never result in any type of failures or
+# data loss.
+use strict;
+use warnings;
+
+use PostgresNode;
+use TestLib;
+use Test::More tests => 14;
+
+# Wrapper routine tunable for wal_level.
+sub run_wal_optimize
+{
+ my $wal_level = shift;
+
+ # Primary needs to have wal_level = minimal here
+ my $node = get_new_node("node_$wal_level");
+ $node->init;
+ $node->append_conf('postgresql.conf', qq(
+wal_level = $wal_level
+));
+ $node->start;
+
+ # Test direct truncation optimization. No tuples
+ $node->safe_psql('postgres', "
+ BEGIN;
+ CREATE TABLE test1 (id serial PRIMARY KEY);
+ TRUNCATE test1;
+ COMMIT;");
+
+ $node->stop('immediate');
+ $node->start;
+
+ my $result = $node->safe_psql('postgres', "SELECT count(*) FROM test1;");
+ is($result, qq(0),
+ "wal_level = $wal_level, optimized truncation with empty table");
+
+ # Test truncation with inserted tuples within the same transaction.
+ # Tuples inserted after the truncation should be seen.
+ $node->safe_psql('postgres', "
+ BEGIN;
+ CREATE TABLE test2 (id serial PRIMARY KEY);
+ INSERT INTO test2 VALUES (DEFAULT);
+ TRUNCATE test2;
+ INSERT INTO test2 VALUES (DEFAULT);
+ COMMIT;");
+
+ $node->stop('immediate');
+ $node->start;
+
+ $result = $node->safe_psql('postgres', "SELECT count(*) FROM test2;");
+ is($result, qq(1),
+ "wal_level = $wal_level, optimized truncation with inserted table");
+
+ # Data file for COPY query in follow-up tests.
+ my $basedir = $node->basedir;
+ my $copy_file = "$basedir/copy_data.txt";
+ TestLib::append_to_file($copy_file, qq(20000,30000
+20001,30001
+20002,30002));
+
+ # Test truncation with inserted tuples using COPY. Tuples copied after the
+ # truncation should be seen.
+ $node->safe_psql('postgres', "
+ BEGIN;
+ CREATE TABLE test3 (id serial PRIMARY KEY, id2 int);
+ INSERT INTO test3 (id, id2) VALUES (DEFAULT, generate_series(1,10000));
+ TRUNCATE test3;
+ COPY test3 FROM '$copy_file' DELIMITER ',';
+ COMMIT;");
+ $node->stop('immediate');
+ $node->start;
+ $result = $node->safe_psql('postgres', "SELECT count(*) FROM test3;");
+ is($result, qq(3),
+ "wal_level = $wal_level, optimized truncation with copied table");
+
+ # Test truncation with inserted tuples using both INSERT and COPY. Tuples
+ # inserted after the truncation should be seen.
+ $node->safe_psql('postgres', "
+ BEGIN;
+ CREATE TABLE test4 (id serial PRIMARY KEY, id2 int);
+ INSERT INTO test4 (id, id2) VALUES (DEFAULT, generate_series(1,10000));
+ TRUNCATE test4;
+ INSERT INTO test4 (id, id2) VALUES (DEFAULT, 10000);
+ COPY test4 FROM '$copy_file' DELIMITER ',';
+ INSERT INTO test4 (id, id2) VALUES (DEFAULT, 10000);
+ COMMIT;");
+
+ $node->stop('immediate');
+ $node->start;
+ $result = $node->safe_psql('postgres', "SELECT count(*) FROM test4;");
+ is($result, qq(5),
+ "wal_level = $wal_level, optimized truncation with inserted/copied table");
+
+ # Test consistency of COPY with INSERT for table created in the same
+ # transaction.
+ $node->safe_psql('postgres', "
+ BEGIN;
+ CREATE TABLE test5 (id serial PRIMARY KEY, id2 int);
+ INSERT INTO test5 VALUES (DEFAULT, 1);
+ COPY test5 FROM '$copy_file' DELIMITER ',';
+ COMMIT;");
+ $node->stop('immediate');
+ $node->start;
+ $result = $node->safe_psql('postgres', "SELECT count(*) FROM test5;");
+ is($result, qq(4),
+ "wal_level = $wal_level, replay of optimized copy with inserted table");
+
+ # Test consistency of COPY that inserts more to the same table using
+ # triggers. If the INSERTS from the trigger go to the same block data
+ # is copied to, and the INSERTs are WAL-logged, WAL replay will fail when
+ # it tries to replay the WAL record but the "before" image doesn't match,
+ # because not all changes were WAL-logged.
+ $node->safe_psql('postgres', "
+ BEGIN;
+ CREATE TABLE test6 (id serial PRIMARY KEY, id2 text);
+ CREATE FUNCTION test6_before_row_trig() RETURNS trigger
+ LANGUAGE plpgsql as \$\$
+ BEGIN
+ IF new.id2 NOT LIKE 'triggered%' THEN
+ INSERT INTO test6 VALUES (DEFAULT, 'triggered row before' || NEW.id2);
+ END IF;
+ RETURN NEW;
+ END; \$\$;
+ CREATE FUNCTION test6_after_row_trig() RETURNS trigger
+ LANGUAGE plpgsql as \$\$
+ BEGIN
+ IF new.id2 NOT LIKE 'triggered%' THEN
+ INSERT INTO test6 VALUES (DEFAULT, 'triggered row after' || OLD.id2);
+ END IF;
+ RETURN NEW;
+ END; \$\$;
+ CREATE TRIGGER test6_before_row_insert
+ BEFORE INSERT ON test6
+ FOR EACH ROW EXECUTE PROCEDURE test6_before_row_trig();
+ CREATE TRIGGER test6_after_row_insert
+ AFTER INSERT ON test6
+ FOR EACH ROW EXECUTE PROCEDURE test6_after_row_trig();
+ COPY test6 FROM '$copy_file' DELIMITER ',';
+ COMMIT;");
+ $node->stop('immediate');
+ $node->start;
+ $result = $node->safe_psql('postgres', "SELECT count(*) FROM test6;");
+ is($result, qq(9),
+ "wal_level = $wal_level, replay of optimized copy with before trigger");
+
+ # Test consistency of INSERT, COPY and TRUNCATE in same transaction block
+ # with TRUNCATE triggers.
+ $node->safe_psql('postgres', "
+ BEGIN;
+ CREATE TABLE test7 (id serial PRIMARY KEY, id2 text);
+ CREATE FUNCTION test7_before_stat_trig() RETURNS trigger
+ LANGUAGE plpgsql as \$\$
+ BEGIN
+ INSERT INTO test7 VALUES (DEFAULT, 'triggered stat before');
+ RETURN NULL;
+ END; \$\$;
+ CREATE FUNCTION test7_after_stat_trig() RETURNS trigger
+ LANGUAGE plpgsql as \$\$
+ BEGIN
+ INSERT INTO test7 VALUES (DEFAULT, 'triggered stat before');
+ RETURN NULL;
+ END; \$\$;
+ CREATE TRIGGER test7_before_stat_truncate
+ BEFORE TRUNCATE ON test7
+ FOR EACH STATEMENT EXECUTE PROCEDURE test7_before_stat_trig();
+ CREATE TRIGGER test7_after_stat_truncate
+ AFTER TRUNCATE ON test7
+ FOR EACH STATEMENT EXECUTE PROCEDURE test7_after_stat_trig();
+ INSERT INTO test7 VALUES (DEFAULT, 1);
+ TRUNCATE test7;
+ COPY test7 FROM '$copy_file' DELIMITER ',';
+ COMMIT;");
+ $node->stop('immediate');
+ $node->start;
+ $result = $node->safe_psql('postgres', "SELECT count(*) FROM test7;");
+ is($result, qq(4),
+ "wal_level = $wal_level, replay of optimized copy with before trigger");
+
+ $node->teardown_node;
+ $node->clean_node;
+ return;
+}
+
+# Run same test suite for multiple wal_level values.
+run_wal_optimize("minimal");
+run_wal_optimize("replica");
--
2.16.3
----Next_Part(Mon_Mar_04_12_24_48_2019_788)--
Content-Type: Text/X-Patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="v7-0002-Write-WAL-for-empty-nbtree-index-build.patch"
^ permalink raw reply [nested|flat] 25+ messages in thread
* PSA: Autoconf has risen from the dead
@ 2022-01-23 16:29 Tom Lane <[email protected]>
2022-01-23 18:13 ` Re: PSA: Autoconf has risen from the dead Joel Jacobson <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-01-24 08:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
0 siblings, 3 replies; 25+ messages in thread
From: Tom Lane @ 2022-01-23 16:29 UTC (permalink / raw)
To: [email protected]
While chasing something else, I was surprised to learn that the
Autoconf project has started to make releases again. There are
2.70 (2020-12-08) and 2.71 (2021-01-28) versions available at
https://ftp.gnu.org/gnu/autoconf/
Right now, I'm not sure we care; there seems to be more
enthusiasm for switching to meson. But if that idea falls
through, we should update to a newer autoconf release.
regards, tom lane
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-01-23 18:13 ` Joel Jacobson <[email protected]>
2022-01-23 18:35 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2 siblings, 1 reply; 25+ messages in thread
From: Joel Jacobson @ 2022-01-23 18:13 UTC (permalink / raw)
To: [email protected]
On Sun, Jan 23, 2022, at 17:29, Tom Lane wrote:
>While chasing something else, I was surprised to learn that the
>Autoconf project has started to make releases again. There are
>2.70 (2020-12-08) and 2.71 (2021-01-28) versions available at
>https://ftp.gnu.org/gnu/autoconf/
>
>Right now, I'm not sure we care; there seems to be more
>enthusiasm for switching to meson. But if that idea falls
>through, we should update to a newer autoconf release.
Speaking of autoconf,
I don't have much experience in this area, but I noted there is
an AC_CACHE_SAVE feature to speed up rerunning ./configure,
necessary when it stops with an error due to some missing dependency.
Is there a good reason why AC_CACHE_SAVE is not used?
/Joel
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-23 18:13 ` Re: PSA: Autoconf has risen from the dead Joel Jacobson <[email protected]>
@ 2022-01-23 18:35 ` Tom Lane <[email protected]>
0 siblings, 0 replies; 25+ messages in thread
From: Tom Lane @ 2022-01-23 18:35 UTC (permalink / raw)
To: Joel Jacobson <[email protected]>; +Cc: [email protected]
"Joel Jacobson" <[email protected]> writes:
> I don't have much experience in this area, but I noted there is
> an AC_CACHE_SAVE feature to speed up rerunning ./configure,
> necessary when it stops with an error due to some missing dependency.
> Is there a good reason why AC_CACHE_SAVE is not used?
Dunno ... it looks like that adds cycles to non-error cases,
which seems like optimizing for the wrong thing.
In any case, right at the moment is probably a bad time to be
working on improvements for configure per se. We can come
back to this if the meson idea crashes and burns.
regards, tom lane
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-01-24 08:11 ` Peter Eisentraut <[email protected]>
2022-01-24 14:14 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2 siblings, 2 replies; 25+ messages in thread
From: Peter Eisentraut @ 2022-01-24 08:11 UTC (permalink / raw)
To: Tom Lane <[email protected]>; [email protected]
On 23.01.22 17:29, Tom Lane wrote:
> While chasing something else, I was surprised to learn that the
> Autoconf project has started to make releases again. There are
> 2.70 (2020-12-08) and 2.71 (2021-01-28) versions available at
> https://ftp.gnu.org/gnu/autoconf/
I have patches ready for this at
https://github.com/petere/postgresql/tree/autoconf-updates.
My thinking was to wait until Autoconf 2.71 has trickled down into the
OS versions that developers are likely to use. To survey that, I'm tracking
https://packages.debian.org/sid/autoconf [in testing]
https://packages.ubuntu.com/search?keywords=autoconf [in jammy, will be
22.04 LTS]
https://src.fedoraproject.org/rpms/autoconf [in Fedora 36, planned
2022-04-19]
https://formulae.brew.sh/formula/autoconf [done]
Currently, I think early PG16 might be good time to do this update.
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
@ 2022-01-24 14:14 ` Tom Lane <[email protected]>
2022-01-24 15:58 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
1 sibling, 1 reply; 25+ messages in thread
From: Tom Lane @ 2022-01-24 14:14 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: [email protected]
Peter Eisentraut <[email protected]> writes:
> I have patches ready for this at
> https://github.com/petere/postgresql/tree/autoconf-updates.
> My thinking was to wait until Autoconf 2.71 has trickled down into the
> OS versions that developers are likely to use.
I find that kind of irrelevant, because we expect people to install
autoconf from source anyway to avoid distro-specific behavior.
I suppose that waiting for it to get out into the wild might be good
from the standpoint of being sure it's bug-free, though.
Do these versions fix any bugs that affect us (i.e., that we've
not already created workarounds for)?
regards, tom lane
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-01-24 14:14 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-01-24 15:58 ` Peter Eisentraut <[email protected]>
0 siblings, 0 replies; 25+ messages in thread
From: Peter Eisentraut @ 2022-01-24 15:58 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: [email protected]
On 24.01.22 15:14, Tom Lane wrote:
> Do these versions fix any bugs that affect us (i.e., that we've
> not already created workarounds for)?
The only thing that could be of interest is that the workaround we are
carrying in config/check_decls.m4 was originally upstreamed by Noah, but
was then later partially reverted and replaced by a different solution.
Further explanation is here:
https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=ec90049dfcf4538750e61d675d885157fa5ca7f8
I don't think it has affected us in practice, though.
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
@ 2022-06-30 17:52 ` Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
1 sibling, 1 reply; 25+ messages in thread
From: Peter Eisentraut @ 2022-06-30 17:52 UTC (permalink / raw)
To: Tom Lane <[email protected]>; [email protected]
On 24.01.22 09:11, Peter Eisentraut wrote:
> On 23.01.22 17:29, Tom Lane wrote:
>> While chasing something else, I was surprised to learn that the
>> Autoconf project has started to make releases again. There are
>> 2.70 (2020-12-08) and 2.71 (2021-01-28) versions available at
>> https://ftp.gnu.org/gnu/autoconf/
>
> I have patches ready for this at
> https://github.com/petere/postgresql/tree/autoconf-updates.
I have updated this for 16devel and registered it in the commit fest.
To summarize:
- Autoconf 2.71 has been out for 1.5 years.
- It is available in many recently updated OSs.
- It allows us to throw away several workarounds.
Also:
- The created configure appears to be a bit faster, especially in the
cached case.
- It supports checks for C11 features, which is something we might want
to consider in the fullness of time.
Hence:
> Currently, I think early PG16 might be good time to do this update.
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
@ 2022-07-02 16:11 ` Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
0 siblings, 1 reply; 25+ messages in thread
From: Tom Lane @ 2022-07-02 16:11 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: [email protected]
Peter Eisentraut <[email protected]> writes:
> To summarize:
> - Autoconf 2.71 has been out for 1.5 years.
> - It is available in many recently updated OSs.
> - It allows us to throw away several workarounds.
> Hence:
>> Currently, I think early PG16 might be good time to do this update.
In preparation for reviewing this, I tried to install autoconf 2.71
from source locally. All went well on my RHEL8 workstation, but
autoconf's testsuite falls over rather badly on my macOS laptop [1].
It fails differently on another Mac where I have a MacPorts
installation at the head of the search path [2].
After sending the requested reports, I tried scanning the bug-autoconf
archives, and found a similar report that was answered thus [3]:
> I *think* this is the same problem as https://savannah.gnu.org/support/?110492
> : current Autoconf doesn't work correctly with the (rather old) version of GNU
> M4 that ships with MacOS. Please try installing a current version of GNU M4 in
> your PATH and then retry the build and testsuite.
So that explains part of it: most of the failures are down to using
Apple's hoary m4 instead of the one from MacPorts. We could usefully
warn about that in our own docs, perhaps. But there's still these
scary failures:
509: AC_CHECK_HEADER_STDBOOL FAILED (acheaders.at:9)
514: AC_HEADER_STDBOOL FAILED (acheaders.at:14)
The generated autoconf program builds the same output files as you have
in your patch, and running the configure script gives the correct answer
from AC_HEADER_STDBOOL, so I'm not sure what these test failures are
unhappy about. Still, this is not a good look for a mainstream
development platform. I wonder if we ought to wait for a fix.
regards, tom lane
[1] https://lists.gnu.org/archive/html/bug-autoconf/2022-07/msg00000.html
[2] https://lists.gnu.org/archive/html/bug-autoconf/2022-07/msg00001.html
[3] https://lists.gnu.org/archive/html/bug-autoconf/2022-04/msg00002.html
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-07-02 17:42 ` Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
0 siblings, 1 reply; 25+ messages in thread
From: Tom Lane @ 2022-07-02 17:42 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: [email protected]
I wrote:
> So that explains part of it: most of the failures are down to using
> Apple's hoary m4 instead of the one from MacPorts. We could usefully
> warn about that in our own docs, perhaps.
Hmm. I have just spent a very frustrating hour trying, and failing,
to build any version of GNU m4 from source on either RHEL8 or current
macOS. I don't quite understand why: neither the RPM specfile nor
the MacPorts recipe for their respective m4 packages seem to contain
any special hacks, so that it looks like the usual "configure; make;
make check; make install" procedure ought to work fine. But it doesn't.
I hit build failures (apparently because the source code is far too much
in bed with nonstandard aspects of libc), or get an executable that
SIGABRT's instantly, or if it doesn't do that it still fails some
self-tests. With the latest 1.4.19 on macOS, the configure script
hangs up, for crissakes.
I am now feeling *very* hesitant about doing anything where we might
be effectively asking people to build m4 for themselves.
On the whole, I'm questioning the value of messing with our autoconf
infrastructure at this stage. We did agree at PGCon that we'd keep
it going for a couple years more, but it's not real clear to me why
we can't limp along with 2.69 until we decide to drop it.
regards, tom lane
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-07-03 14:41 ` Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
0 siblings, 1 reply; 25+ messages in thread
From: Robert Haas @ 2022-07-03 14:41 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
On Sat, Jul 2, 2022 at 1:42 PM Tom Lane <[email protected]> wrote:
> On the whole, I'm questioning the value of messing with our autoconf
> infrastructure at this stage. We did agree at PGCon that we'd keep
> it going for a couple years more, but it's not real clear to me why
> we can't limp along with 2.69 until we decide to drop it.
If building it on macOS is going to be annoying, then -1 from me for
upgrading to a new version until that's resolved.
Hmm, I also don't know how annoying it's going to be to get the new
ninja/meson stuff working on macOS ... I really hope someone puts a
good set of directions on the wiki or in the documentation or
someplace.
--
Robert Haas
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
@ 2022-07-03 14:50 ` Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
0 siblings, 1 reply; 25+ messages in thread
From: Tom Lane @ 2022-07-03 14:50 UTC (permalink / raw)
To: Robert Haas <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
Robert Haas <[email protected]> writes:
> Hmm, I also don't know how annoying it's going to be to get the new
> ninja/meson stuff working on macOS ... I really hope someone puts a
> good set of directions on the wiki or in the documentation or
> someplace.
If you use MacPorts it's just "install those packages", and I imagine
the same for Homebrew. I've not tried build-from-source on modern
platforms.
One thing I think we lack data on is whether we're going to need a
policy similar to everyone-must-use-exactly-this-autoconf-version.
If we do, that will greatly raise the importance of building from
source.
regards, tom lane
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-07-03 17:17 ` Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
0 siblings, 1 reply; 25+ messages in thread
From: Andres Freund @ 2022-07-03 17:17 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Robert Haas <[email protected]>; Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
Hi,
On 2022-07-03 10:50:49 -0400, Tom Lane wrote:
> Robert Haas <[email protected]> writes:
> > Hmm, I also don't know how annoying it's going to be to get the new
> > ninja/meson stuff working on macOS ... I really hope someone puts a
> > good set of directions on the wiki or in the documentation or
> > someplace.
Yea, I guess I should start a documentation section...
I've only used homebrew on mac, but with that it should be something along the
lines of
brew install meson
meson setup --buildtype debug -Dcassert=true build-directory
cd build-directory
ninja
of course if you want to build against some dependencies and / or run tap
tests, you need to do something similar to what you have to do for
configure. I.e.
- install perl modules [1]
- tell the build about location of homebrew [2]
> If you use MacPorts it's just "install those packages", and I imagine
> the same for Homebrew. I've not tried build-from-source on modern
> platforms.
I've done some semi automated testing (to be turned fully automatic) across
meson versions that didn't so far show any need for that. We do require a
certain minimum version of meson (indicated in the top-level meson.build,
raises an error if not met), which in turn requires a minimum version of ninja
(also errors).
The windows build with msbuild is slower on older versions of meson that are
unproblematic on other platforms. But given you're not going to install an
outdated meson from $package-manager there, I don't think it's worth worrying
about.
Greetings,
Andres Freund
[1] https://github.com/anarazel/postgres/blob/meson/.cirrus.yml#L638
[2] https://github.com/anarazel/postgres/blob/meson/.cirrus.yml#L742
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
@ 2022-07-05 18:42 ` Robert Haas <[email protected]>
2022-07-05 18:47 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
0 siblings, 1 reply; 25+ messages in thread
From: Robert Haas @ 2022-07-05 18:42 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: Tom Lane <[email protected]>; Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
On Sun, Jul 3, 2022 at 1:17 PM Andres Freund <[email protected]> wrote:
> Yea, I guess I should start a documentation section...
>
> I've only used homebrew on mac, but with that it should be something along the
> lines of
>
> brew install meson
> meson setup --buildtype debug -Dcassert=true build-directory
> cd build-directory
> ninja
>
> of course if you want to build against some dependencies and / or run tap
> tests, you need to do something similar to what you have to do for
> configure. I.e.
> - install perl modules [1]
> - tell the build about location of homebrew [2]
Since I'm a macports user I hope at some point we'll have directions
for that as well as for homebrew.
--
Robert Haas
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
@ 2022-07-05 18:47 ` Andres Freund <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
0 siblings, 1 reply; 25+ messages in thread
From: Andres Freund @ 2022-07-05 18:47 UTC (permalink / raw)
To: Robert Haas <[email protected]>; +Cc: Tom Lane <[email protected]>; Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
Hi,
On 2022-07-05 14:42:03 -0400, Robert Haas wrote:
> On Sun, Jul 3, 2022 at 1:17 PM Andres Freund <[email protected]> wrote:
> > Yea, I guess I should start a documentation section...
> >
> > I've only used homebrew on mac, but with that it should be something along the
> > lines of
> >
> > brew install meson
> > meson setup --buildtype debug -Dcassert=true build-directory
> > cd build-directory
> > ninja
> >
> > of course if you want to build against some dependencies and / or run tap
> > tests, you need to do something similar to what you have to do for
> > configure. I.e.
> > - install perl modules [1]
> > - tell the build about location of homebrew [2]
>
> Since I'm a macports user I hope at some point we'll have directions
> for that as well as for homebrew.
I am not a normal mac user, it looks hard to run macos in a VM, and I'm not
sure it's wise to mix macports and homebrew on my test box. So I don't want to
test it myself.
But it looks like it's just
sudo port install meson
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 18:47 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
@ 2022-07-05 18:52 ` Tom Lane <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 19:02 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
0 siblings, 2 replies; 25+ messages in thread
From: Tom Lane @ 2022-07-05 18:52 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: Robert Haas <[email protected]>; Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
Andres Freund <[email protected]> writes:
> On 2022-07-05 14:42:03 -0400, Robert Haas wrote:
>> Since I'm a macports user I hope at some point we'll have directions
>> for that as well as for homebrew.
> But it looks like it's just
> sudo port install meson
Yeah, that's what I did to install it locally. The ninja package
has some weird name (ninja-build or some such), but you don't have
to remember that because installing meson is enough to pull it in.
I dunno anything about the other steps Andres mentioned, but
presumably they're independent of where you got meson from.
regards, tom lane
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 18:47 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-07-05 18:52 ` Robert Haas <[email protected]>
1 sibling, 0 replies; 25+ messages in thread
From: Robert Haas @ 2022-07-05 18:52 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Andres Freund <[email protected]>; Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
On Tue, Jul 5, 2022 at 2:52 PM Tom Lane <[email protected]> wrote:
> Andres Freund <[email protected]> writes:
> > On 2022-07-05 14:42:03 -0400, Robert Haas wrote:
> >> Since I'm a macports user I hope at some point we'll have directions
> >> for that as well as for homebrew.
>
> > But it looks like it's just
> > sudo port install meson
>
> Yeah, that's what I did to install it locally. The ninja package
> has some weird name (ninja-build or some such), but you don't have
> to remember that because installing meson is enough to pull it in.
>
> I dunno anything about the other steps Andres mentioned, but
> presumably they're independent of where you got meson from.
That seems simple enough that even I can handle it!
--
Robert Haas
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 18:47 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-07-05 19:02 ` Andres Freund <[email protected]>
2022-07-05 19:06 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-05 21:04 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
1 sibling, 2 replies; 25+ messages in thread
From: Andres Freund @ 2022-07-05 19:02 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Robert Haas <[email protected]>; Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
Hi,
On 2022-07-05 14:52:05 -0400, Tom Lane wrote:
> I dunno anything about the other steps Andres mentioned, but
> presumably they're independent of where you got meson from.
Yea. They might not be independent of where you get other dependencies from
though. Does macports install headers / libraries into a path that's found by
default? Or does one have to pass --with-includes / --with-libs to configure
and set PKG_CONFIG_PATH, like with homebrew?
Except that with meson doing PKG_CONFIG_PATH should suffice for most (all?)
dependencies on macos, and that the syntax for with-includes/libs is a bit
different (-Dextra_include_dirs=... and -Dextra_lib_dirs=...) and that
optionally one can use a parameter (--pkg-config-path) instead of
PKG_CONFIG_PATH, that part shouldn't really differ from what's neccesary
for configure.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 18:47 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-05 19:02 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
@ 2022-07-05 19:06 ` Tom Lane <[email protected]>
2022-07-05 19:14 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
1 sibling, 1 reply; 25+ messages in thread
From: Tom Lane @ 2022-07-05 19:06 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: Robert Haas <[email protected]>; Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
Andres Freund <[email protected]> writes:
> Yea. They might not be independent of where you get other dependencies from
> though. Does macports install headers / libraries into a path that's found by
> default? Or does one have to pass --with-includes / --with-libs to configure
> and set PKG_CONFIG_PATH, like with homebrew?
What are you expecting to need PKG_CONFIG_PATH for? Or more precisely,
why would meson/ninja create any new need for that that doesn't exist
in the autoconf case?
regards, tom lane
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 18:47 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-05 19:02 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 19:06 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-07-05 19:14 ` Andres Freund <[email protected]>
0 siblings, 0 replies; 25+ messages in thread
From: Andres Freund @ 2022-07-05 19:14 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Robert Haas <[email protected]>; Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
Hi,
On 2022-07-05 15:06:31 -0400, Tom Lane wrote:
> Andres Freund <[email protected]> writes:
> > Yea. They might not be independent of where you get other dependencies from
> > though. Does macports install headers / libraries into a path that's found by
> > default? Or does one have to pass --with-includes / --with-libs to configure
> > and set PKG_CONFIG_PATH, like with homebrew?
>
> What are you expecting to need PKG_CONFIG_PATH for? Or more precisely,
> why would meson/ninja create any new need for that that doesn't exist
> in the autoconf case?
It's just used in more cases than before, with fallback to non-pkg-config in
most cases. I think all dependencies besides perl can use pkg-config. So all
that changes compared to AC is that you might not need to pass extra
include/lib paths for some dependencies that needed it before, if you set/pass
PKG_CONFIG_PATH.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 18:47 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-05 19:02 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
@ 2022-07-05 21:04 ` Robert Haas <[email protected]>
2022-07-16 15:26 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
1 sibling, 1 reply; 25+ messages in thread
From: Robert Haas @ 2022-07-05 21:04 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: Tom Lane <[email protected]>; Peter Eisentraut <[email protected]>; PostgreSQL Hackers <[email protected]>
On Tue, Jul 5, 2022 at 3:02 PM Andres Freund <[email protected]> wrote:
> Yea. They might not be independent of where you get other dependencies from
> though. Does macports install headers / libraries into a path that's found by
> default? Or does one have to pass --with-includes / --with-libs to configure
> and set PKG_CONFIG_PATH, like with homebrew?
My configure switches include: --with-libraries=/opt/local/lib
--with-includes=/opt/local/include
I don't do anything with PKG_CONFIG_PATH.
--
Robert Haas
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 18:47 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-05 19:02 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 21:04 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
@ 2022-07-16 15:26 ` Tom Lane <[email protected]>
2022-07-18 09:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 25+ messages in thread
From: Tom Lane @ 2022-07-16 15:26 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: Andres Freund <[email protected]>; Robert Haas <[email protected]>; PostgreSQL Hackers <[email protected]>
... anyway, to get back to the main point of this thread:
The Autoconf developers were pretty responsive to my bug reports,
and after some back-and-forth we determined that:
1. The minimum GNU m4 version for modern autoconf is 1.4.8; this
is directly traceable to intentional behavioral changes in that
version, so it's a pretty hard requirement. They've updated their
own configure script to enforce that minimum.
2. The macOS-specific problems I saw with the STDBOOL tests are
resolved by the attached patch, which should also appear in 2.72.
Since AC_HEADER_STDBOOL appears to work correctly in our usage
anyway, this is only important if you're the kind of person who
likes to see 100% pass from a tool's own self-tests before you
install it.
So as far as autoconf itself is concerned, we could probably move
forward, perhaps after waiting for 2.72. The difficulty here is the
prospect that some people might find themselves having to install a
newer GNU m4, because GNU m4 is a hot mess. Many post-1.4.8 versions
flat out don't compile on $your-favorite-platform [1], and many
others contain a showstopper bug (that's rejected by a runtime test in
autoconf's configure, independently of the min-version test) [2].
If you don't have a pretty recent m4 available from a package manager,
you might be in for a lot of hair-pulling.
The flip side of that is that probably nobody really needs to
update the configure script on non-mainstream platforms, so
maybe this wouldn't matter to us too much in practice.
On the whole though, my feeling is that autoconf 2.71 doesn't
offer enough to us to justify possibly causing substantial pain
for a few developers. I recommend setting this project aside
for now. We can always reconsider if the situation changes.
regards, tom lane
[1] https://lists.gnu.org/archive/html/bug-autoconf/2022-07/msg00004.html
[2] https://lists.gnu.org/archive/html/bug-autoconf/2022-07/msg00006.html
Attachments:
[text/x-diff] autoconf-bool.patch (1.3K, ../../[email protected]/2-autoconf-bool.patch)
download | inline diff:
diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
index 8944da41..5cd1f4d5 100644
--- a/lib/autoconf/headers.m4
+++ b/lib/autoconf/headers.m4
@@ -633,8 +633,10 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
bool *pp = &p;
/* C 1999 specifies that bool, true, and false are to be
- macros, but C++ 2011 and later overrule this. */
- #if __cplusplus < 201103
+ macros, but C++ 2011 overrules this. The C++ committee
+ was codifying existing practice, so we allow them to
+ not be macros whenever __cplusplus is defined. */
+ #ifndef __cplusplus
#ifndef bool
#error "bool is not defined"
#endif
diff --git a/tests/local.at b/tests/local.at
index 3f348929..f79f57ff 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -593,9 +593,9 @@ AT_CMP([at_defines-$1], [at_defines-$2])[]dnl
m4_define([_AT_DEFINES_CMP_PRUNE],
[m4_bmatch([$1],
[^vary:],
-[ /@%:@define ]m4_bpatsubsts([$1], [\<vary:], [])dnl
+[ /@%:@define ]m4_bpatsubsts([$1], [\<vary:], [])[]dnl
[@<:@ @{:@@:>@/ d ;@%:@@:}@
- /@%:@undef ]m4_bpatsubsts([$1], [\<vary:], [])dnl
+ /@%:@undef ]m4_bpatsubsts([$1], [\<vary:], [])[]dnl
[@<:@ @{:@@:>@/ d ;@%:@@:}@
],
[m4_fatal([unrecognized AT_DEFINES_CMP variance token: "$1"])])])
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 18:47 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-05 19:02 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 21:04 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-16 15:26 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-07-18 09:11 ` Peter Eisentraut <[email protected]>
0 siblings, 0 replies; 25+ messages in thread
From: Peter Eisentraut @ 2022-07-18 09:11 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Andres Freund <[email protected]>; Robert Haas <[email protected]>; PostgreSQL Hackers <[email protected]>
On 16.07.22 17:26, Tom Lane wrote:
> On the whole though, my feeling is that autoconf 2.71 doesn't
> offer enough to us to justify possibly causing substantial pain
> for a few developers. I recommend setting this project aside
> for now. We can always reconsider if the situation changes.
Ok, let's do that.
^ permalink raw reply [nested|flat] 25+ messages in thread
* Re: PSA: Autoconf has risen from the dead
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
@ 2022-01-24 08:17 ` Andres Freund <[email protected]>
2 siblings, 0 replies; 25+ messages in thread
From: Andres Freund @ 2022-01-24 08:17 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: [email protected]
Hi,
On 2022-01-23 11:29:17 -0500, Tom Lane wrote:
> Right now, I'm not sure we care; there seems to be more
> enthusiasm for switching to meson. But if that idea falls
> through, we should update to a newer autoconf release.
Depending on the number of portability fixes in those releases the
backbranches could be reason enough to move to a newer autoconf, even if we
get to meson in HEAD? Of course only if there's more things fixed than
broken...
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 25+ messages in thread
* [PATCH v11 1/7] Row pattern recognition patch for raw parser.
@ 2023-11-08 06:57 Tatsuo Ishii <[email protected]>
0 siblings, 0 replies; 25+ messages in thread
From: Tatsuo Ishii @ 2023-11-08 06:57 UTC (permalink / raw)
---
src/backend/parser/gram.y | 222 ++++++++++++++++++++++++++++++--
src/include/nodes/parsenodes.h | 56 ++++++++
src/include/parser/kwlist.h | 8 ++
src/include/parser/parse_node.h | 1 +
4 files changed, 273 insertions(+), 14 deletions(-)
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index c224df4ecc..e09eb061f8 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -251,6 +251,8 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
DefElem *defelt;
SortBy *sortby;
WindowDef *windef;
+ RPCommonSyntax *rpcom;
+ RPSubsetItem *rpsubset;
JoinExpr *jexpr;
IndexElem *ielem;
StatsElem *selem;
@@ -278,6 +280,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
MergeWhenClause *mergewhen;
struct KeyActions *keyactions;
struct KeyAction *keyaction;
+ RPSkipTo skipto;
}
%type <node> stmt toplevel_stmt schema_stmt routine_body_stmt
@@ -453,8 +456,12 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
TriggerTransitions TriggerReferencing
vacuum_relation_list opt_vacuum_relation_list
drop_option_list pub_obj_list
-
-%type <node> opt_routine_body
+ row_pattern_measure_list row_pattern_definition_list
+ opt_row_pattern_subset_clause
+ row_pattern_subset_list row_pattern_subset_rhs
+ row_pattern
+%type <rpsubset> row_pattern_subset_item
+%type <node> opt_routine_body row_pattern_term
%type <groupclause> group_clause
%type <list> group_by_list
%type <node> group_by_item empty_grouping_set rollup_clause cube_clause
@@ -551,6 +558,8 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
%type <range> relation_expr_opt_alias
%type <node> tablesample_clause opt_repeatable_clause
%type <target> target_el set_target insert_column_item
+ row_pattern_measure_item row_pattern_definition
+%type <skipto> first_or_last
%type <str> generic_option_name
%type <node> generic_option_arg
@@ -633,6 +642,9 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
%type <list> window_clause window_definition_list opt_partition_clause
%type <windef> window_definition over_clause window_specification
opt_frame_clause frame_extent frame_bound
+%type <rpcom> opt_row_pattern_common_syntax opt_row_pattern_skip_to
+%type <boolean> opt_row_pattern_initial_or_seek
+%type <list> opt_row_pattern_measures
%type <ival> opt_window_exclusion_clause
%type <str> opt_existing_window_name
%type <boolean> opt_if_not_exists
@@ -659,7 +671,6 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
json_object_constructor_null_clause_opt
json_array_constructor_null_clause_opt
-
/*
* Non-keyword token types. These are hard-wired into the "flex" lexer.
* They must be listed first so that their numeric codes do not depend on
@@ -702,7 +713,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE
DATA_P DATABASE DAY_P DEALLOCATE DEC DECIMAL_P DECLARE DEFAULT DEFAULTS
- DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS DEPENDS DEPTH DESC
+ DEFERRABLE DEFERRED DEFINE DEFINER DELETE_P DELIMITER DELIMITERS DEPENDS DEPTH DESC
DETACH DICTIONARY DISABLE_P DISCARD DISTINCT DO DOCUMENT_P DOMAIN_P
DOUBLE_P DROP
@@ -718,7 +729,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
HANDLER HAVING HEADER_P HOLD HOUR_P
IDENTITY_P IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IMPORT_P IN_P INCLUDE
- INCLUDING INCREMENT INDENT INDEX INDEXES INHERIT INHERITS INITIALLY INLINE_P
+ INCLUDING INCREMENT INDENT INDEX INDEXES INHERIT INHERITS INITIAL INITIALLY INLINE_P
INNER_P INOUT INPUT_P INSENSITIVE INSERT INSTEAD INT_P INTEGER
INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION
@@ -731,7 +742,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
LEADING LEAKPROOF LEAST LEFT LEVEL LIKE LIMIT LISTEN LOAD LOCAL
LOCALTIME LOCALTIMESTAMP LOCATION LOCK_P LOCKED LOGGED
- MAPPING MATCH MATCHED MATERIALIZED MAXVALUE MERGE METHOD
+ MAPPING MATCH MATCHED MATERIALIZED MAXVALUE MEASURES MERGE METHOD
MINUTE_P MINVALUE MODE MONTH_P MOVE
NAME_P NAMES NATIONAL NATURAL NCHAR NEW NEXT NFC NFD NFKC NFKD NO NONE
@@ -743,8 +754,8 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
ORDER ORDINALITY OTHERS OUT_P OUTER_P
OVER OVERLAPS OVERLAY OVERRIDING OWNED OWNER
- PARALLEL PARAMETER PARSER PARTIAL PARTITION PASSING PASSWORD
- PLACING PLANS POLICY
+ PARALLEL PARAMETER PARSER PARTIAL PARTITION PASSING PASSWORD PAST
+ PATTERN_P PERMUTE PLACING PLANS POLICY
POSITION PRECEDING PRECISION PRESERVE PREPARE PREPARED PRIMARY
PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROCEDURES PROGRAM PUBLICATION
@@ -755,12 +766,13 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
RESET RESTART RESTRICT RETURN RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK ROLLUP
ROUTINE ROUTINES ROW ROWS RULE
- SAVEPOINT SCALAR SCHEMA SCHEMAS SCROLL SEARCH SECOND_P SECURITY SELECT
+ SAVEPOINT SCALAR SCHEMA SCHEMAS SCROLL SEARCH SECOND_P SECURITY SEEK SELECT
SEQUENCE SEQUENCES
+
SERIALIZABLE SERVER SESSION SESSION_USER SET SETS SETOF SHARE SHOW
SIMILAR SIMPLE SKIP SMALLINT SNAPSHOT SOME SQL_P STABLE STANDALONE_P
START STATEMENT STATISTICS STDIN STDOUT STORAGE STORED STRICT_P STRIP_P
- SUBSCRIPTION SUBSTRING SUPPORT SYMMETRIC SYSID SYSTEM_P SYSTEM_USER
+ SUBSCRIPTION SUBSET SUBSTRING SUPPORT SYMMETRIC SYSID SYSTEM_P SYSTEM_USER
TABLE TABLES TABLESAMPLE TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN
TIES TIME TIMESTAMP TO TRAILING TRANSACTION TRANSFORM
@@ -853,6 +865,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
*/
%nonassoc UNBOUNDED /* ideally would have same precedence as IDENT */
%nonassoc IDENT PARTITION RANGE ROWS GROUPS PRECEDING FOLLOWING CUBE ROLLUP
+%nonassoc MEASURES AFTER INITIAL SEEK PATTERN_P
%left Op OPERATOR /* multi-character ops and user-defined operators */
%left '+' '-'
%left '*' '/' '%'
@@ -15901,7 +15914,8 @@ over_clause: OVER window_specification
;
window_specification: '(' opt_existing_window_name opt_partition_clause
- opt_sort_clause opt_frame_clause ')'
+ opt_sort_clause opt_row_pattern_measures opt_frame_clause
+ opt_row_pattern_common_syntax ')'
{
WindowDef *n = makeNode(WindowDef);
@@ -15909,10 +15923,12 @@ window_specification: '(' opt_existing_window_name opt_partition_clause
n->refname = $2;
n->partitionClause = $3;
n->orderClause = $4;
+ n->rowPatternMeasures = $5;
/* copy relevant fields of opt_frame_clause */
- n->frameOptions = $5->frameOptions;
- n->startOffset = $5->startOffset;
- n->endOffset = $5->endOffset;
+ n->frameOptions = $6->frameOptions;
+ n->startOffset = $6->startOffset;
+ n->endOffset = $6->endOffset;
+ n->rpCommonSyntax = $7;
n->location = @1;
$$ = n;
}
@@ -15936,6 +15952,31 @@ opt_partition_clause: PARTITION BY expr_list { $$ = $3; }
| /*EMPTY*/ { $$ = NIL; }
;
+/*
+ * ROW PATTERN_P MEASURES
+ */
+opt_row_pattern_measures: MEASURES row_pattern_measure_list { $$ = $2; }
+ | /*EMPTY*/ { $$ = NIL; }
+ ;
+
+row_pattern_measure_list:
+ row_pattern_measure_item
+ { $$ = list_make1($1); }
+ | row_pattern_measure_list ',' row_pattern_measure_item
+ { $$ = lappend($1, $3); }
+ ;
+
+row_pattern_measure_item:
+ a_expr AS ColLabel
+ {
+ $$ = makeNode(ResTarget);
+ $$->name = $3;
+ $$->indirection = NIL;
+ $$->val = (Node *) $1;
+ $$->location = @1;
+ }
+ ;
+
/*
* For frame clauses, we return a WindowDef, but only some fields are used:
* frameOptions, startOffset, and endOffset.
@@ -16095,6 +16136,143 @@ opt_window_exclusion_clause:
| /*EMPTY*/ { $$ = 0; }
;
+opt_row_pattern_common_syntax:
+opt_row_pattern_skip_to opt_row_pattern_initial_or_seek
+ PATTERN_P '(' row_pattern ')'
+ opt_row_pattern_subset_clause
+ DEFINE row_pattern_definition_list
+ {
+ RPCommonSyntax *n = makeNode(RPCommonSyntax);
+ n->rpSkipTo = $1->rpSkipTo;
+ n->rpSkipVariable = $1->rpSkipVariable;
+ n->initial = $2;
+ n->rpPatterns = $5;
+ n->rpSubsetClause = $7;
+ n->rpDefs = $9;
+ $$ = n;
+ }
+ | /*EMPTY*/ { $$ = NULL; }
+ ;
+
+opt_row_pattern_skip_to:
+ AFTER MATCH SKIP TO NEXT ROW
+ {
+ RPCommonSyntax *n = makeNode(RPCommonSyntax);
+ n->rpSkipTo = ST_NEXT_ROW;
+ n->rpSkipVariable = NULL;
+ $$ = n;
+ }
+ | AFTER MATCH SKIP PAST LAST_P ROW
+ {
+ RPCommonSyntax *n = makeNode(RPCommonSyntax);
+ n->rpSkipTo = ST_PAST_LAST_ROW;
+ n->rpSkipVariable = NULL;
+ $$ = n;
+ }
+ | AFTER MATCH SKIP TO first_or_last ColId
+ {
+ RPCommonSyntax *n = makeNode(RPCommonSyntax);
+ n->rpSkipTo = $5;
+ n->rpSkipVariable = $6;
+ $$ = n;
+ }
+/*
+ | AFTER MATCH SKIP TO LAST_P ColId %prec LAST_P
+ {
+ RPCommonSyntax *n = makeNode(RPCommonSyntax);
+ n->rpSkipTo = ST_LAST_VARIABLE;
+ n->rpSkipVariable = $6;
+ $$ = n;
+ }
+ | AFTER MATCH SKIP TO ColId
+ {
+ RPCommonSyntax *n = makeNode(RPCommonSyntax);
+ n->rpSkipTo = ST_VARIABLE;
+ n->rpSkipVariable = $5;
+ $$ = n;
+ }
+*/
+ | /*EMPTY*/
+ {
+ RPCommonSyntax *n = makeNode(RPCommonSyntax);
+ /* temporary set default to ST_NEXT_ROW */
+ n->rpSkipTo = ST_PAST_LAST_ROW;
+ n->rpSkipVariable = NULL;
+ $$ = n;
+ }
+ ;
+
+first_or_last:
+ FIRST_P { $$ = ST_FIRST_VARIABLE; }
+ | LAST_P { $$ = ST_LAST_VARIABLE; }
+ ;
+
+opt_row_pattern_initial_or_seek:
+ INITIAL { $$ = true; }
+ | SEEK
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("SEEK is not supported"),
+ errhint("Use INITIAL."),
+ parser_errposition(@1)));
+ }
+ | /*EMPTY*/ { $$ = true; }
+ ;
+
+row_pattern:
+ row_pattern_term { $$ = list_make1($1); }
+ | row_pattern row_pattern_term { $$ = lappend($1, $2); }
+ ;
+
+row_pattern_term:
+ ColId { $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "", (Node *)makeString($1), NULL, @1); }
+ | ColId '*' { $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (Node *)makeString($1), NULL, @1); }
+ | ColId '+' { $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (Node *)makeString($1), NULL, @1); }
+ | ColId '?' { $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "?", (Node *)makeString($1), NULL, @1); }
+ ;
+
+opt_row_pattern_subset_clause:
+ SUBSET row_pattern_subset_list { $$ = $2; }
+ | /*EMPTY*/ { $$ = NIL; }
+ ;
+
+row_pattern_subset_list:
+ row_pattern_subset_item { $$ = list_make1($1); }
+ | row_pattern_subset_list ',' row_pattern_subset_item { $$ = lappend($1, $3); }
+ | /*EMPTY*/ { $$ = NIL; }
+ ;
+
+row_pattern_subset_item: ColId '=' '(' row_pattern_subset_rhs ')'
+ {
+ RPSubsetItem *n = makeNode(RPSubsetItem);
+ n->name = $1;
+ n->rhsVariable = $4;
+ $$ = n;
+ }
+ ;
+
+row_pattern_subset_rhs:
+ ColId { $$ = list_make1(makeStringConst($1, @1)); }
+ | row_pattern_subset_rhs ',' ColId { $$ = lappend($1, makeStringConst($3, @1)); }
+ | /*EMPTY*/ { $$ = NIL; }
+ ;
+
+row_pattern_definition_list:
+ row_pattern_definition { $$ = list_make1($1); }
+ | row_pattern_definition_list ',' row_pattern_definition { $$ = lappend($1, $3); }
+ ;
+
+row_pattern_definition:
+ ColId AS a_expr
+ {
+ $$ = makeNode(ResTarget);
+ $$->name = $1;
+ $$->indirection = NIL;
+ $$->val = (Node *) $3;
+ $$->location = @1;
+ }
+ ;
/*
* Supporting nonterminals for expressions.
@@ -17190,6 +17368,7 @@ unreserved_keyword:
| INDEXES
| INHERIT
| INHERITS
+ | INITIAL
| INLINE_P
| INPUT_P
| INSENSITIVE
@@ -17217,6 +17396,7 @@ unreserved_keyword:
| MATCHED
| MATERIALIZED
| MAXVALUE
+ | MEASURES
| MERGE
| METHOD
| MINUTE_P
@@ -17259,6 +17439,9 @@ unreserved_keyword:
| PARTITION
| PASSING
| PASSWORD
+ | PAST
+ | PATTERN_P
+ | PERMUTE
| PLANS
| POLICY
| PRECEDING
@@ -17309,6 +17492,7 @@ unreserved_keyword:
| SEARCH
| SECOND_P
| SECURITY
+ | SEEK
| SEQUENCE
| SEQUENCES
| SERIALIZABLE
@@ -17334,6 +17518,7 @@ unreserved_keyword:
| STRICT_P
| STRIP_P
| SUBSCRIPTION
+ | SUBSET
| SUPPORT
| SYSID
| SYSTEM_P
@@ -17521,6 +17706,7 @@ reserved_keyword:
| CURRENT_USER
| DEFAULT
| DEFERRABLE
+ | DEFINE
| DESC
| DISTINCT
| DO
@@ -17683,6 +17869,7 @@ bare_label_keyword:
| DEFAULTS
| DEFERRABLE
| DEFERRED
+ | DEFINE
| DEFINER
| DELETE_P
| DELIMITER
@@ -17758,6 +17945,7 @@ bare_label_keyword:
| INDEXES
| INHERIT
| INHERITS
+ | INITIAL
| INITIALLY
| INLINE_P
| INNER_P
@@ -17807,6 +17995,7 @@ bare_label_keyword:
| MATCHED
| MATERIALIZED
| MAXVALUE
+ | MEASURES
| MERGE
| METHOD
| MINVALUE
@@ -17860,6 +18049,9 @@ bare_label_keyword:
| PARTITION
| PASSING
| PASSWORD
+ | PAST
+ | PATTERN_P
+ | PERMUTE
| PLACING
| PLANS
| POLICY
@@ -17916,6 +18108,7 @@ bare_label_keyword:
| SCROLL
| SEARCH
| SECURITY
+ | SEEK
| SELECT
| SEQUENCE
| SEQUENCES
@@ -17947,6 +18140,7 @@ bare_label_keyword:
| STRICT_P
| STRIP_P
| SUBSCRIPTION
+ | SUBSET
| SUBSTRING
| SUPPORT
| SYMMETRIC
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index e494309da8..094c603887 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -540,6 +540,44 @@ typedef struct SortBy
int location; /* operator location, or -1 if none/unknown */
} SortBy;
+/*
+ * AFTER MATCH row pattern skip to types in row pattern common syntax
+ */
+typedef enum RPSkipTo
+{
+ ST_NONE, /* AFTER MATCH omitted */
+ ST_NEXT_ROW, /* SKIP TO NEXT ROW */
+ ST_PAST_LAST_ROW, /* SKIP TO PAST LAST ROW */
+ ST_FIRST_VARIABLE, /* SKIP TO FIRST variable name */
+ ST_LAST_VARIABLE, /* SKIP TO LAST variable name */
+ ST_VARIABLE /* SKIP TO variable name */
+} RPSkipTo;
+
+/*
+ * Row Pattern SUBSET clause item
+ */
+typedef struct RPSubsetItem
+{
+ NodeTag type;
+ char *name; /* Row Pattern SUBSET clause variable name */
+ List *rhsVariable; /* Row Pattern SUBSET rhs variables (list of char *string) */
+} RPSubsetItem;
+
+/*
+ * RowPatternCommonSyntax - raw representation of row pattern common syntax
+ *
+ */
+typedef struct RPCommonSyntax
+{
+ NodeTag type;
+ RPSkipTo rpSkipTo; /* Row Pattern AFTER MATCH SKIP type */
+ char *rpSkipVariable; /* Row Pattern Skip To variable name, if any */
+ bool initial; /* true if <row pattern initial or seek> is initial */
+ List *rpPatterns; /* PATTERN variables (list of A_Expr) */
+ List *rpSubsetClause; /* row pattern subset clause (list of RPSubsetItem), if any */
+ List *rpDefs; /* row pattern definitions clause (list of ResTarget) */
+} RPCommonSyntax;
+
/*
* WindowDef - raw representation of WINDOW and OVER clauses
*
@@ -555,6 +593,8 @@ typedef struct WindowDef
char *refname; /* referenced window name, if any */
List *partitionClause; /* PARTITION BY expression list */
List *orderClause; /* ORDER BY (list of SortBy) */
+ List *rowPatternMeasures; /* row pattern measures (list of ResTarget) */
+ RPCommonSyntax *rpCommonSyntax; /* row pattern common syntax */
int frameOptions; /* frame_clause options, see below */
Node *startOffset; /* expression for starting bound, if any */
Node *endOffset; /* expression for ending bound, if any */
@@ -1476,6 +1516,11 @@ typedef struct GroupingSet
* the orderClause might or might not be copied (see copiedOrder); the framing
* options are never copied, per spec.
*
+ * "defineClause" is Row Pattern Recognition DEFINE clause (list of
+ * TargetEntry). TargetEntry.resname represents row pattern definition
+ * variable name. "patternVariable" and "patternRegexp" represents PATTERN
+ * clause.
+ *
* The information relevant for the query jumbling is the partition clause
* type and its bounds.
*/
@@ -1507,6 +1552,17 @@ typedef struct WindowClause
Index winref; /* ID referenced by window functions */
/* did we copy orderClause from refname? */
bool copiedOrder pg_node_attr(query_jumble_ignore);
+ /* Row Pattern AFTER MACH SKIP clause */
+ RPSkipTo rpSkipTo; /* Row Pattern Skip To type */
+ bool initial; /* true if <row pattern initial or seek> is initial */
+ /* Row Pattern DEFINE clause (list of TargetEntry) */
+ List *defineClause;
+ /* Row Pattern DEFINE variable initial names (list of String) */
+ List *defineInitial;
+ /* Row Pattern PATTERN variable name (list of String) */
+ List *patternVariable;
+ /* Row Pattern PATTERN regular expression quantifier ('+' or ''. list of String) */
+ List *patternRegexp;
} WindowClause;
/*
diff --git a/src/include/parser/kwlist.h b/src/include/parser/kwlist.h
index 5984dcfa4b..2804333b53 100644
--- a/src/include/parser/kwlist.h
+++ b/src/include/parser/kwlist.h
@@ -128,6 +128,7 @@ PG_KEYWORD("default", DEFAULT, RESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("defaults", DEFAULTS, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("deferrable", DEFERRABLE, RESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("deferred", DEFERRED, UNRESERVED_KEYWORD, BARE_LABEL)
+PG_KEYWORD("define", DEFINE, RESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("definer", DEFINER, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("delete", DELETE_P, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("delimiter", DELIMITER, UNRESERVED_KEYWORD, BARE_LABEL)
@@ -212,6 +213,7 @@ PG_KEYWORD("index", INDEX, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("indexes", INDEXES, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("inherit", INHERIT, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("inherits", INHERITS, UNRESERVED_KEYWORD, BARE_LABEL)
+PG_KEYWORD("initial", INITIAL, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("initially", INITIALLY, RESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("inline", INLINE_P, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("inner", INNER_P, TYPE_FUNC_NAME_KEYWORD, BARE_LABEL)
@@ -265,6 +267,7 @@ PG_KEYWORD("match", MATCH, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("matched", MATCHED, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("materialized", MATERIALIZED, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("maxvalue", MAXVALUE, UNRESERVED_KEYWORD, BARE_LABEL)
+PG_KEYWORD("measures", MEASURES, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("merge", MERGE, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("method", METHOD, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("minute", MINUTE_P, UNRESERVED_KEYWORD, AS_LABEL)
@@ -326,6 +329,9 @@ PG_KEYWORD("partial", PARTIAL, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("partition", PARTITION, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("passing", PASSING, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("password", PASSWORD, UNRESERVED_KEYWORD, BARE_LABEL)
+PG_KEYWORD("past", PAST, UNRESERVED_KEYWORD, BARE_LABEL)
+PG_KEYWORD("pattern", PATTERN_P, UNRESERVED_KEYWORD, BARE_LABEL)
+PG_KEYWORD("permute", PERMUTE, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("placing", PLACING, RESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("plans", PLANS, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("policy", POLICY, UNRESERVED_KEYWORD, BARE_LABEL)
@@ -385,6 +391,7 @@ PG_KEYWORD("scroll", SCROLL, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("search", SEARCH, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("second", SECOND_P, UNRESERVED_KEYWORD, AS_LABEL)
PG_KEYWORD("security", SECURITY, UNRESERVED_KEYWORD, BARE_LABEL)
+PG_KEYWORD("seek", SEEK, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("select", SELECT, RESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("sequence", SEQUENCE, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("sequences", SEQUENCES, UNRESERVED_KEYWORD, BARE_LABEL)
@@ -416,6 +423,7 @@ PG_KEYWORD("stored", STORED, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("strict", STRICT_P, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("strip", STRIP_P, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("subscription", SUBSCRIPTION, UNRESERVED_KEYWORD, BARE_LABEL)
+PG_KEYWORD("subset", SUBSET, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("substring", SUBSTRING, COL_NAME_KEYWORD, BARE_LABEL)
PG_KEYWORD("support", SUPPORT, UNRESERVED_KEYWORD, BARE_LABEL)
PG_KEYWORD("symmetric", SYMMETRIC, RESERVED_KEYWORD, BARE_LABEL)
diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h
index f589112d5e..6640090910 100644
--- a/src/include/parser/parse_node.h
+++ b/src/include/parser/parse_node.h
@@ -51,6 +51,7 @@ typedef enum ParseExprKind
EXPR_KIND_WINDOW_FRAME_RANGE, /* window frame clause with RANGE */
EXPR_KIND_WINDOW_FRAME_ROWS, /* window frame clause with ROWS */
EXPR_KIND_WINDOW_FRAME_GROUPS, /* window frame clause with GROUPS */
+ EXPR_KIND_RPR_DEFINE, /* DEFINE */
EXPR_KIND_SELECT_TARGET, /* SELECT target list item */
EXPR_KIND_INSERT_TARGET, /* INSERT target list item */
EXPR_KIND_UPDATE_SOURCE, /* UPDATE assignment source item */
--
2.25.1
----Next_Part(Wed_Nov__8_16_37_05_2023_872)--
Content-Type: Text/X-Patch; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="v11-0002-Row-pattern-recognition-patch-parse-analysis.patch"
^ permalink raw reply [nested|flat] 25+ messages in thread
end of thread, other threads:[~2023-11-08 06:57 UTC | newest]
Thread overview: 25+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11 01:03 [PATCH 1/4] TAP test for copy-truncation optimization. Kyotaro Horiguchi <[email protected]>
2022-01-23 16:29 PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-23 18:13 ` Re: PSA: Autoconf has risen from the dead Joel Jacobson <[email protected]>
2022-01-23 18:35 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 08:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-01-24 14:14 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-01-24 15:58 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-06-30 17:52 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-07-02 16:11 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-02 17:42 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 14:41 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-03 14:50 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-03 17:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:42 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 18:47 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-05 18:52 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-05 19:02 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 19:06 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-05 19:14 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2022-07-05 21:04 ` Re: PSA: Autoconf has risen from the dead Robert Haas <[email protected]>
2022-07-16 15:26 ` Re: PSA: Autoconf has risen from the dead Tom Lane <[email protected]>
2022-07-18 09:11 ` Re: PSA: Autoconf has risen from the dead Peter Eisentraut <[email protected]>
2022-01-24 08:17 ` Re: PSA: Autoconf has risen from the dead Andres Freund <[email protected]>
2023-11-08 06:57 [PATCH v11 1/7] Row pattern recognition patch for raw parser. Tatsuo Ishii <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox