diff options
author | Pavan Deolasee | 2017-06-14 05:42:18 +0000 |
---|---|---|
committer | Pavan Deolasee | 2017-06-14 05:42:18 +0000 |
commit | 15dd5274c323fb93e4e3ea9ad2185aaaec10f79c (patch) | |
tree | 9dafb4c7f735d9429ea461dc792933af87493c33 /src/tools | |
parent | dfbb88e3bbb526dcb204b456b9e5cfd9d10d0d0a (diff) | |
parent | d5cb3bab564e0927ffac7c8729eacf181a12dd40 (diff) |
Merge from PG master upto d5cb3bab564e0927ffac7c8729eacf181a12dd40
This is the result of the "git merge remotes/PGSQL/master" upto the said commit
point. We have done some basic analysis, fixed compilation problems etc, but
bulk of the logical problems in conflict resolution etc will be handled by
subsequent commits.
Diffstat (limited to 'src/tools')
34 files changed, 1072 insertions, 487 deletions
diff --git a/src/tools/RELEASE_CHANGES b/src/tools/RELEASE_CHANGES index ad49220592..dc1b300a35 100644 --- a/src/tools/RELEASE_CHANGES +++ b/src/tools/RELEASE_CHANGES @@ -11,7 +11,7 @@ For All Releases (major, minor, beta, RC) o run spellchecker on result o add SGML markup -* Update timezone data to match latest zic database and new +* Update timezone data to match latest IANA timezone database and new Windows releases, if any (see src/timezone/README) * Translation updates @@ -31,19 +31,21 @@ For Major Releases (in addition to the above) * Release notes - o use git log or src/tools/git_changelog to find the relevant commits + o use src/tools/git_changelog + o retain the relevant commits o new features and options o major performance improvements o bug fixes for serious or common bugs o incompatibilities and significant user-visible changes o major source code changes - o check completion of items that have been marked as completed at - http://wiki.postgresql.org/wiki/Todo - o remove completed TODO items + o update TODO list, http://wiki.postgresql.org/wiki/Todo + o verify items marked as completed are completed + o mark additional items as completed + o remove completed items o group items into categories - o select major features o select incompatibilities - o add documentation for items + o add documentation links for items + o select major features * Documentation o document all new features @@ -73,21 +75,12 @@ Starting a New Development Cycle for example, git push origin master:refs/heads/REL9_2_STABLE +* Add new branch's name to list in src/tools/git_changelog + * Increment the major version number in src/tools/version_stamp.pl * Run "src/tools/version_stamp.pl devel", then run autoconf -* Add version tag to src/tools/git_changelog - -* Bump minor library versions, major if appropriate (see below) - o Look for SO_MINOR_VERSION and MINOR_VERSION macros in - src/interfaces/ecpg/compatlib/Makefile - src/interfaces/ecpg/ecpglib/Makefile - src/interfaces/ecpg/pgtypeslib/Makefile - src/interfaces/ecpg/preproc/Makefile - src/interfaces/libpq/Makefile - src/tools/msvc/Mkvcbuild.pm - Creating Back-Branch Release Notes ================================== @@ -141,8 +134,7 @@ function which would give the new field a suitable default value. Adding a new function should NOT force an increase in the major version number. (Packagers will see the standard minor number update and install the new library.) When the major version is increased all applications -which link to the library MUST be recompiled - this is not desirable. When -the major version is updated the minor version gets reset. +which link to the library MUST be recompiled - this is not desirable. Minor Version ============= @@ -152,9 +144,19 @@ the library has changed, typically a change in source code between releases would mean an increase in the minor version number so long as it does not require a major version increase. -Given that we make at least minor changes to our libraries in every major -PostgreSQL version, we always bump all minor library version numbers at the -start of each development cycle as a matter of policy. +Given that we make at least some changes to our libraries in every major +PostgreSQL version, we always bump all minor library version numbers in +each development cycle as a matter of policy. This is currently mechanized +by referencing the MAJORVERSION make macro in the value of SO_MINOR_VERSION +for each shared library. As of v10, SO_MINOR_VERSION is simply equal to +MAJORVERSION in all cases. If we ever make an incompatible break in a +library's API, forcing a major version bump, we could continue to increase +SO_MINOR_VERSION (thus, perhaps, going from libpq.so.5.12 to libpq.so.6.13), +or we could reset SO_MINOR_VERSION to zero, using makefile code along the +lines of + SO_MINOR_VERSION= $(shell expr $(MAJORVERSION) - 13) +so that the number continues to increase automatically in later branches. +For now, that complication is not necessary. Minimizing Changes ================== diff --git a/src/tools/check_bison_recursion.pl b/src/tools/check_bison_recursion.pl index dd220d6b98..14590663c6 100755 --- a/src/tools/check_bison_recursion.pl +++ b/src/tools/check_bison_recursion.pl @@ -16,7 +16,7 @@ # To use: run bison with the -v switch, then feed the produced y.output # file to this script. # -# Copyright (c) 2011-2016, PostgreSQL Global Development Group +# Copyright (c) 2011-2017, PostgreSQL Global Development Group # # src/tools/check_bison_recursion.pl ################################################################# diff --git a/src/tools/copyright.pl b/src/tools/copyright.pl index aab162ed75..53942f12f0 100755 --- a/src/tools/copyright.pl +++ b/src/tools/copyright.pl @@ -2,7 +2,7 @@ ################################################################# # copyright.pl -- update copyright notices throughout the source tree, idempotently. # -# Copyright (c) 2011-2016, PostgreSQL Global Development Group +# Copyright (c) 2011-2017, PostgreSQL Global Development Group # # src/tools/copyright.pl # diff --git a/src/tools/find_typedef b/src/tools/find_typedef index fee0fb5152..24e9b76651 100755 --- a/src/tools/find_typedef +++ b/src/tools/find_typedef @@ -13,7 +13,7 @@ # find both .o files and executables. Therefore, ignore error messages about # unsuitable files being fed to objdump. # -# This is known to work on Linux and on some BSDen, including Mac OS X. +# This is known to work on Linux and on some BSDen, including macOS. # # Caution: on the platforms we use, this only prints typedefs that are used # to declare at least one variable or struct field. If you have say diff --git a/src/tools/findoidjoins/Makefile b/src/tools/findoidjoins/Makefile index b1785ced6b..e37b027dbd 100644 --- a/src/tools/findoidjoins/Makefile +++ b/src/tools/findoidjoins/Makefile @@ -2,7 +2,7 @@ # # Makefile for src/tools/findoidjoins # -# Copyright (c) 2003-2016, PostgreSQL Global Development Group +# Copyright (c) 2003-2017, PostgreSQL Global Development Group # # src/tools/findoidjoins/Makefile # diff --git a/src/tools/findoidjoins/README b/src/tools/findoidjoins/README index af8c99eb6a..7c5a5cf4b9 100644 --- a/src/tools/findoidjoins/README +++ b/src/tools/findoidjoins/README @@ -5,7 +5,7 @@ findoidjoins This program scans a database and prints oid fields (also reg* fields) and the tables they join to. It is normally used to check the system -catalog join relationships (shown below for 9.6devel as of 2016-01-16). +catalog join relationships (shown below for 10devel as of 2017-05-15). Historically this has been run against an empty database such as template1, but there's a problem with that approach: some of the catalogs are empty @@ -16,7 +16,7 @@ catalogs in interesting ways. Note that unexpected matches may indicate bogus entries in system tables; don't accept a peculiar match without question. In particular, a field shown as joining to more than one target table is probably messed up. -In 9.6, the *only* fields that should join to more than one target +In v10, the *only* fields that should join to more than one target table are: pg_description.objoid, pg_depend.objid, pg_depend.refobjid, pg_shdescription.objoid, pg_shdepend.objid, pg_shdepend.refobjid, @@ -35,13 +35,29 @@ regression test. The oidjoins test should be updated after any revision in the patterns of cross-links between system tables. (Typically we update it at the end of each development cycle.) -NOTE: as of 9.6, make_oidjoins_check produces two bogus join checks: +NOTE: as of v10, make_oidjoins_check produces two bogus join checks: Join pg_catalog.pg_class.relfilenode => pg_catalog.pg_class.oid Join pg_catalog.pg_database.datlastsysoid => pg_catalog.pg_database.oid These are artifacts and should not be added to the oidjoins regression test. You might also get output for pg_shdepend.refobjid and pg_shdescription.objoid, neither of which should be added to the regression test. +In short, the procedure is: + +1. make installcheck in src/test/regress +2. cd here, make +3. ./findoidjoins regression >foj.out +4. ./make_oidjoins_check foj.out >oidjoins.sql +5. paste foj.out below, removing the entries reported as duplicative + by make_oidjoins_check or described as bogus above +6. remove bogus tests in oidjoins.sql as per above +7. copy oidjoins.sql to src/test/regress/sql/, + and update oidjoins.out to match. +8. Review diffs to ensure they correspond to new catalog relationships, + then commit. (Sometimes, a pre-existing catalog relationship might + become newly visible here as a result of the regression tests populating + a catalog they didn't before. That's OK too.) + --------------------------------------------------------------------------- Join pg_catalog.pg_aggregate.aggfnoid => pg_catalog.pg_proc.oid @@ -71,6 +87,9 @@ Join pg_catalog.pg_attrdef.adrelid => pg_catalog.pg_class.oid Join pg_catalog.pg_attribute.attrelid => pg_catalog.pg_class.oid Join pg_catalog.pg_attribute.atttypid => pg_catalog.pg_type.oid Join pg_catalog.pg_attribute.attcollation => pg_catalog.pg_collation.oid +Join pg_catalog.pg_auth_members.roleid => pg_catalog.pg_authid.oid +Join pg_catalog.pg_auth_members.member => pg_catalog.pg_authid.oid +Join pg_catalog.pg_auth_members.grantor => pg_catalog.pg_authid.oid Join pg_catalog.pg_cast.castsource => pg_catalog.pg_type.oid Join pg_catalog.pg_cast.casttarget => pg_catalog.pg_type.oid Join pg_catalog.pg_cast.castfunc => pg_catalog.pg_proc.oid @@ -134,6 +153,7 @@ Join pg_catalog.pg_operator.oprjoin => pg_catalog.pg_proc.oid Join pg_catalog.pg_opfamily.opfmethod => pg_catalog.pg_am.oid Join pg_catalog.pg_opfamily.opfnamespace => pg_catalog.pg_namespace.oid Join pg_catalog.pg_opfamily.opfowner => pg_catalog.pg_authid.oid +Join pg_catalog.pg_partitioned_table.partrelid => pg_catalog.pg_class.oid Join pg_catalog.pg_policy.polrelid => pg_catalog.pg_class.oid Join pg_catalog.pg_proc.pronamespace => pg_catalog.pg_namespace.oid Join pg_catalog.pg_proc.proowner => pg_catalog.pg_authid.oid @@ -148,6 +168,8 @@ Join pg_catalog.pg_range.rngsubopc => pg_catalog.pg_opclass.oid Join pg_catalog.pg_range.rngcanonical => pg_catalog.pg_proc.oid Join pg_catalog.pg_range.rngsubdiff => pg_catalog.pg_proc.oid Join pg_catalog.pg_rewrite.ev_class => pg_catalog.pg_class.oid +Join pg_catalog.pg_sequence.seqrelid => pg_catalog.pg_class.oid +Join pg_catalog.pg_sequence.seqtypid => pg_catalog.pg_type.oid Join pg_catalog.pg_shdepend.refclassid => pg_catalog.pg_class.oid Join pg_catalog.pg_shdescription.classoid => pg_catalog.pg_class.oid Join pg_catalog.pg_statistic.starelid => pg_catalog.pg_class.oid @@ -156,6 +178,9 @@ Join pg_catalog.pg_statistic.staop2 => pg_catalog.pg_operator.oid Join pg_catalog.pg_statistic.staop3 => pg_catalog.pg_operator.oid Join pg_catalog.pg_statistic.staop4 => pg_catalog.pg_operator.oid Join pg_catalog.pg_statistic.staop5 => pg_catalog.pg_operator.oid +Join pg_catalog.pg_statistic_ext.stxrelid => pg_catalog.pg_class.oid +Join pg_catalog.pg_statistic_ext.stxnamespace => pg_catalog.pg_namespace.oid +Join pg_catalog.pg_statistic_ext.stxowner => pg_catalog.pg_authid.oid Join pg_catalog.pg_tablespace.spcowner => pg_catalog.pg_authid.oid Join pg_catalog.pg_transform.trftype => pg_catalog.pg_type.oid Join pg_catalog.pg_transform.trflang => pg_catalog.pg_language.oid diff --git a/src/tools/findoidjoins/findoidjoins.c b/src/tools/findoidjoins/findoidjoins.c index 1e59772b1a..267107ddae 100644 --- a/src/tools/findoidjoins/findoidjoins.c +++ b/src/tools/findoidjoins/findoidjoins.c @@ -1,12 +1,14 @@ /* * findoidjoins.c * - * Copyright (c) 2002-2016, PostgreSQL Global Development Group + * Copyright (c) 2002-2017, PostgreSQL Global Development Group * * src/tools/findoidjoins/findoidjoins.c */ #include "postgres_fe.h" +#include "catalog/pg_class.h" + #include "libpq-fe.h" #include "pqexpbuffer.h" @@ -51,8 +53,8 @@ main(int argc, char **argv) "SELECT c.relname, (SELECT nspname FROM " "pg_catalog.pg_namespace n WHERE n.oid = c.relnamespace) AS nspname " "FROM pg_catalog.pg_class c " - "WHERE c.relkind = 'r' " - "AND c.relhasoids " + "WHERE c.relkind = " CppAsString2(RELKIND_RELATION) + " AND c.relhasoids " "ORDER BY nspname, c.relname" ); @@ -71,9 +73,10 @@ main(int argc, char **argv) "(SELECT nspname FROM pg_catalog.pg_namespace n WHERE n.oid = c.relnamespace) AS nspname, " "a.attname " "FROM pg_catalog.pg_class c, pg_catalog.pg_attribute a " - "WHERE a.attnum > 0 AND c.relkind = 'r' " - "AND a.attrelid = c.oid " - "AND a.atttypid IN ('pg_catalog.oid'::regtype, " + "WHERE a.attnum > 0" + " AND c.relkind = " CppAsString2(RELKIND_RELATION) + " AND a.attrelid = c.oid" + " AND a.atttypid IN ('pg_catalog.oid'::regtype, " " 'pg_catalog.regclass'::regtype, " " 'pg_catalog.regoper'::regtype, " " 'pg_catalog.regoperator'::regtype, " @@ -146,9 +149,10 @@ main(int argc, char **argv) "(SELECT nspname FROM pg_catalog.pg_namespace n WHERE n.oid = c.relnamespace) AS nspname, " "a.attname " "FROM pg_catalog.pg_class c, pg_catalog.pg_attribute a " - "WHERE a.attnum > 0 AND c.relkind = 'r' " - "AND a.attrelid = c.oid " - "AND a.atttypid IN ('pg_catalog.oid[]'::regtype, " + "WHERE a.attnum > 0" + " AND c.relkind = " CppAsString2(RELKIND_RELATION) + " AND a.attrelid = c.oid" + " AND a.atttypid IN ('pg_catalog.oid[]'::regtype, " " 'pg_catalog.regclass[]'::regtype, " " 'pg_catalog.regoper[]'::regtype, " " 'pg_catalog.regoperator[]'::regtype, " diff --git a/src/tools/fix-old-flex-code.pl b/src/tools/fix-old-flex-code.pl new file mode 100644 index 0000000000..da99875599 --- /dev/null +++ b/src/tools/fix-old-flex-code.pl @@ -0,0 +1,66 @@ +#!/usr/bin/perl -w +#---------------------------------------------------------------------- +# +# fix-old-flex-code.pl +# +# flex versions before 2.5.36, with certain option combinations, produce +# code that causes an "unused variable" warning. That's annoying, so +# let's suppress it by inserting a dummy reference to the variable. +# (That's exactly what 2.5.36 and later do ...) +# +# Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/tools/fix-old-flex-code.pl +# +#---------------------------------------------------------------------- + +use strict; +use warnings; + +# Get command line argument. +usage() if $#ARGV != 0; +my $filename = shift; + +# Suck in the whole file. +local $/ = undef; +my $cfile; +open($cfile, '<', $filename) || die "opening $filename for reading: $!"; +my $ccode = <$cfile>; +close($cfile); + +# No need to do anything if it's not flex 2.5.x for x < 36. +exit 0 if $ccode !~ m/^#define YY_FLEX_MAJOR_VERSION 2$/m; +exit 0 if $ccode !~ m/^#define YY_FLEX_MINOR_VERSION 5$/m; +exit 0 if $ccode !~ m/^#define YY_FLEX_SUBMINOR_VERSION (\d+)$/m; +exit 0 if $1 >= 36; + +# Apply the desired patch. +$ccode =~ +s|(struct yyguts_t \* yyg = \(struct yyguts_t\*\)yyscanner; /\* This var may be unused depending upon options. \*/ +.*?) + return yy_is_jam \? 0 : yy_current_state; +|$1 + (void) yyg; + return yy_is_jam ? 0 : yy_current_state; +|s; + +# Write the modified file back out. +open($cfile, '>', $filename) || die "opening $filename for writing: $!"; +print $cfile $ccode; +close($cfile); + +exit 0; + + +sub usage +{ + die <<EOM; +Usage: fix-old-flex-code.pl c-file-name + +fix-old-flex-code.pl modifies a flex output file to suppress +an unused-variable warning that occurs with older flex versions. + +Report bugs to <pgsql-bugs\@postgresql.org>. +EOM +} diff --git a/src/tools/git_changelog b/src/tools/git_changelog index c9a503f3fe..d4c7b5bf14 100755 --- a/src/tools/git_changelog +++ b/src/tools/git_changelog @@ -31,10 +31,10 @@ # The default output of this script is meant for generating minor release # notes, where we need to know which branches a merged commit affects. # -# To generate major release notes, intended usage is +# To generate major release notes, use: # git_changelog --master-only --brief --oldest-first --since='start-date' # To find the appropriate start date, use: -# git show $(git merge-base REL9_5_STABLE master) +# git show --summary $(git merge-base REL9_5_STABLE master) # where the branch to mention is the previously forked-off branch. This # shows the last commit before that branch was made. # @@ -57,7 +57,7 @@ require IPC::Open2; # (We could get this from "git branches", but not worth the trouble.) # NB: master must be first! my @BRANCHES = qw(master - REL9_5_STABLE + REL9_6_STABLE REL9_5_STABLE REL9_4_STABLE REL9_3_STABLE REL9_2_STABLE REL9_1_STABLE REL9_0_STABLE REL8_4_STABLE REL8_3_STABLE REL8_2_STABLE REL8_1_STABLE REL8_0_STABLE REL7_4_STABLE REL7_3_STABLE REL7_2_STABLE REL7_1_STABLE REL7_0_PATCHES diff --git a/src/tools/ifaddrs/.gitignore b/src/tools/ifaddrs/.gitignore new file mode 100644 index 0000000000..2e900325e9 --- /dev/null +++ b/src/tools/ifaddrs/.gitignore @@ -0,0 +1 @@ +/test_ifaddrs diff --git a/src/tools/ifaddrs/Makefile b/src/tools/ifaddrs/Makefile index 231f388901..a5153207fe 100644 --- a/src/tools/ifaddrs/Makefile +++ b/src/tools/ifaddrs/Makefile @@ -2,7 +2,7 @@ # # Makefile for src/tools/ifaddrs # -# Copyright (c) 2003-2016, PostgreSQL Global Development Group +# Copyright (c) 2003-2017, PostgreSQL Global Development Group # # src/tools/ifaddrs/Makefile # @@ -20,8 +20,8 @@ OBJS = test_ifaddrs.o all: test_ifaddrs -test_ifaddrs: test_ifaddrs.o $(libpq_backend_dir)/ip.o - $(CC) $(CFLAGS) test_ifaddrs.o $(libpq_backend_dir)/ip.o $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) +test_ifaddrs: test_ifaddrs.o $(libpq_backend_dir)/ifaddr.o + $(CC) $(CFLAGS) test_ifaddrs.o $(libpq_backend_dir)/ifaddr.o $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) clean distclean maintainer-clean: rm -f test_ifaddrs$(X) $(OBJS) diff --git a/src/tools/ifaddrs/test_ifaddrs.c b/src/tools/ifaddrs/test_ifaddrs.c index 48d184c84a..100359ade1 100644 --- a/src/tools/ifaddrs/test_ifaddrs.c +++ b/src/tools/ifaddrs/test_ifaddrs.c @@ -8,11 +8,10 @@ #include "postgres.h" -#include <arpa/inet.h> #include <netinet/in.h> -#include <sys/socket.h> +#include <arpa/inet.h> -#include "libpq/ip.h" +#include "libpq/ifaddr.h" static void diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index 52dde65a0e..18bded431f 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -20,12 +20,12 @@ our (@ISA, @EXPORT_OK); my $insttype; my @client_contribs = ('oid2name', 'pgbench', 'vacuumlo'); my @client_program_files = ( - 'clusterdb', 'createdb', 'createlang', 'createuser', - 'dropdb', 'droplang', 'dropuser', 'ecpg', - 'libecpg', 'libecpg_compat', 'libpgtypes', 'libpq', - 'pg_basebackup', 'pg_config', 'pg_dump', 'pg_dumpall', - 'pg_isready', 'pg_receivexlog', 'pg_restore', 'psql', - 'reindexdb', 'vacuumdb', @client_contribs); + 'clusterdb', 'createdb', 'createuser', 'dropdb', + 'dropuser', 'ecpg', 'libecpg', 'libecpg_compat', + 'libpgtypes', 'libpq', 'pg_basebackup', 'pg_config', + 'pg_dump', 'pg_dumpall', 'pg_isready', 'pg_receivewal', + 'pg_recvlogical', 'pg_restore', 'psql', 'reindexdb', + 'vacuumdb', @client_contribs); sub lcopy { @@ -58,8 +58,8 @@ sub Install # suppress warning about harmless redeclaration of $config no warnings 'misc'; - require "config_default.pl"; - require "config.pl" if (-f "config.pl"); + do "config_default.pl"; + do "config.pl" if (-f "config.pl"); } chdir("../../..") if (-f "../../../configure"); @@ -367,7 +367,7 @@ sub GenerateConversionScript $sql .= "COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n"; } - open($F, ">$target/share/conversion_create.sql") + open($F, '>', "$target/share/conversion_create.sql") || die "Could not write to conversion_create.sql\n"; print $F $sql; close($F); @@ -380,13 +380,20 @@ sub GenerateTimezoneFiles my $conf = shift; my $mf = read_file("src/timezone/Makefile"); $mf =~ s{\\\r?\n}{}g; + $mf =~ /^TZDATA\s*:?=\s*(.*)$/m || die "Could not find TZDATA line in timezone makefile\n"; my @tzfiles = split /\s+/, $1; + $mf =~ /^POSIXRULES\s*:?=\s*(.*)$/m + || die "Could not find POSIXRULES line in timezone makefile\n"; + my $posixrules = $1; + $posixrules =~ s/\s+//g; + print "Generating timezone files..."; - my @args = ("$conf/zic/zic", '-d', "$target/share/timezone"); + my @args = + ("$conf/zic/zic", '-d', "$target/share/timezone", '-p', "$posixrules"); foreach (@tzfiles) { my $tzfile = $_; @@ -409,7 +416,7 @@ sub GenerateTsearchFiles $mf =~ /^LANGUAGES\s*=\s*(.*)$/m || die "Could not find LANGUAGES line in snowball Makefile\n"; my @pieces = split /\s+/, $1; - open($F, ">$target/share/snowball_create.sql") + open($F, '>', "$target/share/snowball_create.sql") || die "Could not write snowball_create.sql"; print $F read_file('src/backend/snowball/snowball_func.sql.in'); @@ -735,7 +742,7 @@ sub read_file my $t = $/; undef $/; - open($F, $filename) || die "Could not open file $filename\n"; + open($F, '<', $filename) || die "Could not open file $filename\n"; my $txt = <$F>; close($F); $/ = $t; diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index fe905d3c9d..621238417d 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -35,8 +35,7 @@ my @contrib_uselibpq = ('dblink', 'oid2name', 'postgres_fdw', 'vacuumlo'); my @contrib_uselibpgport = ('oid2name', 'pg_standby', 'vacuumlo'); my @contrib_uselibpgcommon = ('oid2name', 'pg_standby', 'vacuumlo'); my $contrib_extralibs = undef; -my $contrib_extraincludes = - { 'tsearch2' => ['contrib/tsearch2'], 'dblink' => ['src/backend'] }; +my $contrib_extraincludes = { 'dblink' => ['src/backend'] }; my $contrib_extrasource = { 'cube' => [ 'contrib/cube/cubescan.l', 'contrib/cube/cubeparse.y' ], 'seg' => [ 'contrib/seg/segscan.l', 'contrib/seg/segparse.y' ], }; @@ -50,15 +49,15 @@ my @contrib_excludes = ( # Set of variables for frontend modules my $frontend_defines = { 'initdb' => 'FRONTEND' }; -my @frontend_uselibpq = ('pg_ctl', 'pg_upgrade', 'pgbench', 'psql'); +my @frontend_uselibpq = ('pg_ctl', 'pg_upgrade', 'pgbench', 'psql', 'initdb'); my @frontend_uselibpgport = ( 'pg_archivecleanup', 'pg_test_fsync', 'pg_test_timing', 'pg_upgrade', - 'pg_xlogdump', 'pgbench'); + 'pg_waldump', 'pgbench'); my @frontend_uselibpgcommon = ( 'pg_archivecleanup', 'pg_test_fsync', 'pg_test_timing', 'pg_upgrade', - 'pg_xlogdump', 'pgbench'); + 'pg_waldump', 'pgbench'); my $frontend_extralibs = { 'initdb' => ['ws2_32.lib'], 'pg_restore' => ['ws2_32.lib'], @@ -72,8 +71,8 @@ my $frontend_extrasource = { 'pgbench' => [ 'src/bin/pgbench/exprscan.l', 'src/bin/pgbench/exprparse.y' ] }; my @frontend_excludes = ( - 'pgevent', 'pg_basebackup', 'pg_rewind', 'pg_dump', - 'pg_xlogdump', 'scripts'); + 'pgevent', 'pg_basebackup', 'pg_rewind', 'pg_dump', + 'pg_waldump', 'scripts'); sub mkvcbuild { @@ -91,8 +90,8 @@ sub mkvcbuild chklocale.c crypt.c fls.c fseeko.c getrusage.c inet_aton.c random.c srandom.c getaddrinfo.c gettimeofday.c inet_net_ntop.c kill.c open.c erand48.c snprintf.c strlcat.c strlcpy.c dirmod.c noblock.c path.c - pgcheckdir.c pgmkdirp.c pgsleep.c pgstrcasecmp.c pqsignal.c - mkdtemp.c qsort.c qsort_arg.c quotes.c system.c + pg_strong_random.c pgcheckdir.c pgmkdirp.c pgsleep.c pgstrcasecmp.c + pqsignal.c mkdtemp.c qsort.c qsort_arg.c quotes.c system.c sprompt.c tar.c thread.c getopt.c getopt_long.c dirent.c win32env.c win32error.c win32security.c win32setlocale.c); @@ -110,12 +109,22 @@ sub mkvcbuild } our @pgcommonallfiles = qw( - config_info.c controldata_utils.c exec.c keywords.c - pg_lzcompress.c pgfnames.c psprintf.c relpath.c rmtree.c - string.c username.c wait_error.c); + base64.c config_info.c controldata_utils.c exec.c ip.c keywords.c + md5.c pg_lzcompress.c pgfnames.c psprintf.c relpath.c rmtree.c + saslprep.c scram-common.c string.c unicode_norm.c username.c + wait_error.c); + + if ($solution->{options}->{openssl}) + { + push(@pgcommonallfiles, 'sha2_openssl.c'); + } + else + { + push(@pgcommonallfiles, 'sha2.c'); + } our @pgcommonfrontendfiles = ( - @pgcommonallfiles, qw(fe_memutils.c + @pgcommonallfiles, qw(fe_memutils.c file_utils.c restricted_token.c)); our @pgcommonbkndfiles = @pgcommonallfiles; @@ -194,20 +203,24 @@ sub mkvcbuild if ($solution->{options}->{tcl}) { + my $found = 0; my $pltcl = $solution->AddProject('pltcl', 'dll', 'PLs', 'src/pl/tcl'); $pltcl->AddIncludeDir($solution->{options}->{tcl} . '/include'); $pltcl->AddReference($postgres); - if (-e $solution->{options}->{tcl} . '/lib/tcl85.lib') - { - $pltcl->AddLibrary( - $solution->{options}->{tcl} . '/lib/tcl85.lib'); - } - else + + for my $tclver (qw(86t 85 84)) { - $pltcl->AddLibrary( - $solution->{options}->{tcl} . '/lib/tcl84.lib'); + my $tcllib = $solution->{options}->{tcl} . "/lib/tcl$tclver.lib"; + if (-e $tcllib) + { + $pltcl->AddLibrary($tcllib); + $found = 1; + last; + } } + die "Unable to find $solution->{options}->{tcl}/lib/tcl<version>.lib" + unless $found; } $libpq = $solution->AddProject('libpq', 'dll', 'interfaces', @@ -224,10 +237,16 @@ sub mkvcbuild $libpq->AddReference($libpgport); # The OBJS scraper doesn't know about ifdefs, so remove fe-secure-openssl.c - # if building without OpenSSL + # and sha2_openssl.c if building without OpenSSL, and remove sha2.c if + # building with OpenSSL. if (!$solution->{options}->{openssl}) { $libpq->RemoveFile('src/interfaces/libpq/fe-secure-openssl.c'); + $libpq->RemoveFile('src/common/sha2_openssl.c'); + } + else + { + $libpq->RemoveFile('src/common/sha2.c'); } my $libpqwalreceiver = @@ -236,6 +255,10 @@ sub mkvcbuild $libpqwalreceiver->AddIncludeDir('src/interfaces/libpq'); $libpqwalreceiver->AddReference($postgres, $libpq); + my $pgoutput = $solution->AddProject('pgoutput', 'dll', '', + 'src/backend/replication/pgoutput'); + $pgoutput->AddReference($postgres); + my $pgtypes = $solution->AddProject( 'libpgtypes', 'dll', 'interfaces', 'src/interfaces/ecpg/pgtypeslib'); @@ -269,9 +292,6 @@ sub mkvcbuild $ecpg->AddIncludeDir('src/interfaces/libpq'); $ecpg->AddPrefixInclude('src/interfaces/ecpg/preproc'); $ecpg->AddFiles('src/interfaces/ecpg/preproc', 'pgc.l', 'preproc.y'); - $ecpg->AddDefine('MAJOR_VERSION=4'); - $ecpg->AddDefine('MINOR_VERSION=12'); - $ecpg->AddDefine('PATCHLEVEL=0'); $ecpg->AddDefine('ECPG_COMPILE'); $ecpg->AddReference($libpgcommon, $libpgport); @@ -327,10 +347,10 @@ sub mkvcbuild $pgbasebackup->AddFile('src/bin/pg_basebackup/pg_basebackup.c'); $pgbasebackup->AddLibrary('ws2_32.lib'); - my $pgreceivexlog = AddSimpleFrontend('pg_basebackup', 1); - $pgreceivexlog->{name} = 'pg_receivexlog'; - $pgreceivexlog->AddFile('src/bin/pg_basebackup/pg_receivexlog.c'); - $pgreceivexlog->AddLibrary('ws2_32.lib'); + my $pgreceivewal = AddSimpleFrontend('pg_basebackup', 1); + $pgreceivewal->{name} = 'pg_receivewal'; + $pgreceivewal->AddFile('src/bin/pg_basebackup/pg_receivewal.c'); + $pgreceivewal->AddLibrary('ws2_32.lib'); my $pgrecvlogical = AddSimpleFrontend('pg_basebackup', 1); $pgrecvlogical->{name} = 'pg_recvlogical'; @@ -384,18 +404,7 @@ sub mkvcbuild $zic->AddDirResourceFile('src/timezone'); $zic->AddReference($libpgcommon, $libpgport); - if ($solution->{options}->{xml}) - { - $contrib_extraincludes->{'pgxml'} = [ - $solution->{options}->{xml} . '/include', - $solution->{options}->{xslt} . '/include', - $solution->{options}->{iconv} . '/include' ]; - - $contrib_extralibs->{'pgxml'} = [ - $solution->{options}->{xml} . '/lib/libxml2.lib', - $solution->{options}->{xslt} . '/lib/libxslt.lib' ]; - } - else + if (!$solution->{options}->{xml}) { push @contrib_excludes, 'xml2'; } @@ -405,14 +414,7 @@ sub mkvcbuild push @contrib_excludes, 'sslinfo'; } - if ($solution->{options}->{uuid}) - { - $contrib_extraincludes->{'uuid-ossp'} = - [ $solution->{options}->{uuid} . '/include' ]; - $contrib_extralibs->{'uuid-ossp'} = - [ $solution->{options}->{uuid} . '/lib/uuid.lib' ]; - } - else + if (!$solution->{options}->{uuid}) { push @contrib_excludes, 'uuid-ossp'; } @@ -442,14 +444,14 @@ sub mkvcbuild else { $pgcrypto->AddFiles( - 'contrib/pgcrypto', 'md5.c', - 'sha1.c', 'sha2.c', - 'internal.c', 'internal-sha2.c', - 'blf.c', 'rijndael.c', - 'fortuna.c', 'random.c', - 'pgp-mpi-internal.c', 'imath.c'); + 'contrib/pgcrypto', 'md5.c', + 'sha1.c', 'internal.c', + 'internal-sha2.c', 'blf.c', + 'rijndael.c', 'pgp-mpi-internal.c', + 'imath.c'); } $pgcrypto->AddReference($postgres); + $pgcrypto->AddReference($libpgcommon); $pgcrypto->AddLibrary('ws2_32.lib'); my $mf = Project::read_file('contrib/pgcrypto/Makefile'); GenerateContribSqlFiles('pgcrypto', $mf); @@ -496,14 +498,18 @@ sub mkvcbuild $plpython->AddReference($postgres); # Add transform modules dependent on plpython - AddTransformModule( + my $hstore_plpython = AddTransformModule( 'hstore_plpython' . $pymajorver, 'contrib/hstore_plpython', 'plpython' . $pymajorver, 'src/pl/plpython', 'hstore', 'contrib/hstore'); - AddTransformModule( + $hstore_plpython->AddDefine( + 'PLPYTHON_LIBNAME="plpython' . $pymajorver . '"'); + my $ltree_plpython = AddTransformModule( 'ltree_plpython' . $pymajorver, 'contrib/ltree_plpython', 'plpython' . $pymajorver, 'src/pl/plpython', 'ltree', 'contrib/ltree'); + $ltree_plpython->AddDefine( + 'PLPYTHON_LIBNAME="plpython' . $pymajorver . '"'); } if ($solution->{options}->{perl}) @@ -578,16 +584,17 @@ sub mkvcbuild } } $plperl->AddReference($postgres); + my $perl_path = $solution->{options}->{perl} . '\lib\CORE\perl*.lib'; my @perl_libs = - grep { /perl\d+.lib$/ } - glob($solution->{options}->{perl} . '\lib\CORE\perl*.lib'); + grep { /perl\d+.lib$/ } glob($perl_path); if (@perl_libs == 1) { $plperl->AddLibrary($perl_libs[0]); } else { - die "could not identify perl library version"; + die +"could not identify perl library version matching pattern $perl_path\n"; } # Add transform module dependent on plperl @@ -650,15 +657,15 @@ sub mkvcbuild $pgregress->AddDirResourceFile('src/test/regress'); $pgregress->AddReference($libpgcommon, $libpgport); - # fix up pg_xlogdump once it's been set up + # fix up pg_waldump once it's been set up # files symlinked on Unix are copied on windows - my $pg_xlogdump = AddSimpleFrontend('pg_xlogdump'); - $pg_xlogdump->AddDefine('FRONTEND'); + my $pg_waldump = AddSimpleFrontend('pg_waldump'); + $pg_waldump->AddDefine('FRONTEND'); foreach my $xf (glob('src/backend/access/rmgrdesc/*desc.c')) { - $pg_xlogdump->AddFile($xf); + $pg_waldump->AddFile($xf); } - $pg_xlogdump->AddFile('src/backend/access/transam/xlogreader.c'); + $pg_waldump->AddFile('src/backend/access/transam/xlogreader.c'); $solution->Save(); return $solution->{vcver}; @@ -828,7 +835,7 @@ sub GenerateContribSqlFiles $dn =~ s/\.sql$//; $cont =~ s/MODULE_PATHNAME/\$libdir\/$dn/g; my $o; - open($o, ">contrib/$n/$out") + open($o, '>', "contrib/$n/$out") || croak "Could not write to contrib/$n/$d"; print $o $cont; close($o); diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm index a4eb653c26..9817b9439a 100644 --- a/src/tools/msvc/Project.pm +++ b/src/tools/msvc/Project.pm @@ -256,7 +256,7 @@ sub AddDir # Match rules that pull in source files from different directories, eg # pgstrcasecmp.c rint.c snprintf.c: % : $(top_srcdir)/src/port/% my $replace_re = - qr{^([^:\n\$]+\.c)\s*:\s*(?:%\s*: )?\$(\([^\)]+\))\/(.*)\/[^\/]+$}m; + qr{^([^:\n\$]+\.c)\s*:\s*(?:%\s*: )?\$(\([^\)]+\))\/(.*)\/[^\/]+\n}m; while ($mf =~ m{$replace_re}m) { my $match = $1; @@ -310,12 +310,12 @@ sub AddResourceFile if (Solution::IsNewer("$dir/win32ver.rc", 'src/port/win32ver.rc')) { print "Generating win32ver.rc for $dir\n"; - open(I, 'src/port/win32ver.rc') + open(my $i, '<', 'src/port/win32ver.rc') || confess "Could not open win32ver.rc"; - open(O, ">$dir/win32ver.rc") + open(my $o, '>', "$dir/win32ver.rc") || confess "Could not write win32ver.rc"; my $icostr = $ico ? "IDI_ICON ICON \"src/port/$ico.ico\"" : ""; - while (<I>) + while (<$i>) { s/FILEDESC/"$desc"/gm; s/_ICO_/$icostr/gm; @@ -324,11 +324,11 @@ sub AddResourceFile { s/VFT_APP/VFT_DLL/gm; } - print O; + print $o $_; } + close($o); + close($i); } - close(O); - close(I); $self->AddFile("$dir/win32ver.rc"); } @@ -357,13 +357,13 @@ sub Save $self->DisableLinkerWarnings('4197') if ($self->{platform} eq 'x64'); # Dump the project - open(F, ">$self->{name}$self->{filenameExtension}") + open(my $f, '>', "$self->{name}$self->{filenameExtension}") || croak( "Could not write to $self->{name}$self->{filenameExtension}\n"); - $self->WriteHeader(*F); - $self->WriteFiles(*F); - $self->Footer(*F); - close(F); + $self->WriteHeader($f); + $self->WriteFiles($f); + $self->Footer($f); + close($f); } sub GetAdditionalLinkerDependencies @@ -397,7 +397,7 @@ sub read_file my $t = $/; undef $/; - open($F, $filename) || croak "Could not open file $filename\n"; + open($F, '<', $filename) || croak "Could not open file $filename\n"; my $txt = <$F>; close($F); $/ = $t; @@ -412,8 +412,8 @@ sub read_makefile my $t = $/; undef $/; - open($F, "$reldir/GNUmakefile") - || open($F, "$reldir/Makefile") + open($F, '<', "$reldir/GNUmakefile") + || open($F, '<', "$reldir/Makefile") || confess "Could not open $reldir/Makefile\n"; my $txt = <$F>; close($F); diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index f07029bce1..70cd23b888 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -28,21 +28,15 @@ sub _new $self->DeterminePlatform(); my $bits = $self->{platform} eq 'Win32' ? 32 : 64; - # integer_datetimes is now the default - $options->{integer_datetimes} = 1 - unless exists $options->{integer_datetimes}; $options->{float4byval} = 1 unless exists $options->{float4byval}; $options->{float8byval} = ($bits == 64) unless exists $options->{float8byval}; die "float8byval not permitted on 32 bit platforms" if $options->{float8byval} && $bits == 32; - if ($options->{xml}) + if ($options->{xslt} && !$options->{xml}) { - if (!($options->{xslt} && $options->{iconv})) - { - die "XML requires both XSLT and ICONV\n"; - } + die "XSLT requires XML\n"; } $options->{blocksize} = 8 unless $options->{blocksize}; # undef or 0 means default @@ -108,14 +102,14 @@ sub IsNewer sub copyFile { my ($src, $dest) = @_; - open(I, $src) || croak "Could not open $src"; - open(O, ">$dest") || croak "Could not open $dest"; - while (<I>) + open(my $i, '<', $src) || croak "Could not open $src"; + open(my $o, '>', $dest) || croak "Could not open $dest"; + while (<$i>) { - print O; + print $o $_; } - close(I); - close(O); + close($i); + close($o); } sub GenerateFiles @@ -124,22 +118,22 @@ sub GenerateFiles my $bits = $self->{platform} eq 'Win32' ? 32 : 64; # Parse configure.in to get version numbers - open(C, "configure.in") + open(my $c, '<', "configure.in") || confess("Could not open configure.in for reading\n"); - while (<C>) + while (<$c>) { if (/^AC_INIT\(\[PostgreSQL\], \[([^\]]+)\]/) { $self->{strver} = $1; - if ($self->{strver} !~ /^(\d+)\.(\d+)(?:\.(\d+))?/) + if ($self->{strver} !~ /^(\d+)(?:\.(\d+))?/) { confess "Bad format of version: $self->{strver}\n"; } - $self->{numver} = sprintf("%d%02d%02d", $1, $2, $3 ? $3 : 0); - $self->{majorver} = sprintf("%d.%d", $1, $2); + $self->{numver} = sprintf("%d%04d", $1, $2 ? $2 : 0); + $self->{majorver} = sprintf("%d", $1); } } - close(C); + close($c); confess "Unable to parse configure.in for all variables!" if ($self->{strver} eq '' || $self->{numver} eq ''); @@ -152,93 +146,92 @@ sub GenerateFiles if (IsNewer("src/include/pg_config.h", "src/include/pg_config.h.win32")) { print "Generating pg_config.h...\n"; - open(I, "src/include/pg_config.h.win32") + open(my $i, '<', "src/include/pg_config.h.win32") || confess "Could not open pg_config.h.win32\n"; - open(O, ">src/include/pg_config.h") + open(my $o, '>', "src/include/pg_config.h") || confess "Could not write to pg_config.h\n"; my $extraver = $self->{options}->{extraver}; $extraver = '' unless defined $extraver; - while (<I>) + while (<$i>) { s{PG_VERSION "[^"]+"}{PG_VERSION "$self->{strver}$extraver"}; s{PG_VERSION_NUM \d+}{PG_VERSION_NUM $self->{numver}}; -s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY(z)\n#define PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, compiled by Visual C++ build " __STRINGIFY2(_MSC_VER) ", $bits-bit"}; - print O; +s{PG_VERSION_STR "[^"]+"}{PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, compiled by Visual C++ build " CppAsString2(_MSC_VER) ", $bits-bit"}; + print $o $_; } - print O "#define PG_MAJORVERSION \"$self->{majorver}\"\n"; - print O "#define LOCALEDIR \"/share/locale\"\n" + print $o "#define PG_MAJORVERSION \"$self->{majorver}\"\n"; + print $o "#define LOCALEDIR \"/share/locale\"\n" if ($self->{options}->{nls}); - print O "/* defines added by config steps */\n"; - print O "#ifndef IGNORE_CONFIGURED_SETTINGS\n"; - print O "#define USE_ASSERT_CHECKING 1\n" + print $o "/* defines added by config steps */\n"; + print $o "#ifndef IGNORE_CONFIGURED_SETTINGS\n"; + print $o "#define USE_ASSERT_CHECKING 1\n" if ($self->{options}->{asserts}); - print O "#define USE_INTEGER_DATETIMES 1\n" - if ($self->{options}->{integer_datetimes}); - print O "#define USE_LDAP 1\n" if ($self->{options}->{ldap}); - print O "#define HAVE_LIBZ 1\n" if ($self->{options}->{zlib}); - print O "#define USE_OPENSSL 1\n" if ($self->{options}->{openssl}); - print O "#define ENABLE_NLS 1\n" if ($self->{options}->{nls}); - - print O "#define BLCKSZ ", 1024 * $self->{options}->{blocksize}, "\n"; - print O "#define RELSEG_SIZE ", + print $o "#define USE_LDAP 1\n" if ($self->{options}->{ldap}); + print $o "#define HAVE_LIBZ 1\n" if ($self->{options}->{zlib}); + print $o "#define USE_OPENSSL 1\n" if ($self->{options}->{openssl}); + print $o "#define ENABLE_NLS 1\n" if ($self->{options}->{nls}); + + print $o "#define BLCKSZ ", 1024 * $self->{options}->{blocksize}, + "\n"; + print $o "#define RELSEG_SIZE ", (1024 / $self->{options}->{blocksize}) * $self->{options}->{segsize} * 1024, "\n"; - print O "#define XLOG_BLCKSZ ", + print $o "#define XLOG_BLCKSZ ", 1024 * $self->{options}->{wal_blocksize}, "\n"; - print O "#define XLOG_SEG_SIZE (", $self->{options}->{wal_segsize}, + print $o "#define XLOG_SEG_SIZE (", $self->{options}->{wal_segsize}, " * 1024 * 1024)\n"; if ($self->{options}->{float4byval}) { - print O "#define USE_FLOAT4_BYVAL 1\n"; - print O "#define FLOAT4PASSBYVAL true\n"; + print $o "#define USE_FLOAT4_BYVAL 1\n"; + print $o "#define FLOAT4PASSBYVAL true\n"; } else { - print O "#define FLOAT4PASSBYVAL false\n"; + print $o "#define FLOAT4PASSBYVAL false\n"; } if ($self->{options}->{float8byval}) { - print O "#define USE_FLOAT8_BYVAL 1\n"; - print O "#define FLOAT8PASSBYVAL true\n"; + print $o "#define USE_FLOAT8_BYVAL 1\n"; + print $o "#define FLOAT8PASSBYVAL true\n"; } else { - print O "#define FLOAT8PASSBYVAL false\n"; + print $o "#define FLOAT8PASSBYVAL false\n"; } if ($self->{options}->{uuid}) { - print O "#define HAVE_UUID_OSSP\n"; - print O "#define HAVE_UUID_H\n"; + print $o "#define HAVE_UUID_OSSP\n"; + print $o "#define HAVE_UUID_H\n"; } if ($self->{options}->{xml}) { - print O "#define HAVE_LIBXML2\n"; - print O "#define USE_LIBXML\n"; + print $o "#define HAVE_LIBXML2\n"; + print $o "#define USE_LIBXML\n"; } if ($self->{options}->{xslt}) { - print O "#define HAVE_LIBXSLT\n"; - print O "#define USE_LIBXSLT\n"; + print $o "#define HAVE_LIBXSLT\n"; + print $o "#define USE_LIBXSLT\n"; } if ($self->{options}->{gss}) { - print O "#define ENABLE_GSS 1\n"; + print $o "#define ENABLE_GSS 1\n"; } if (my $port = $self->{options}->{"--with-pgport"}) { - print O "#undef DEF_PGPORT\n"; - print O "#undef DEF_PGPORT_STR\n"; - print O "#define DEF_PGPORT $port\n"; - print O "#define DEF_PGPORT_STR \"$port\"\n"; + print $o "#undef DEF_PGPORT\n"; + print $o "#undef DEF_PGPORT_STR\n"; + print $o "#define DEF_PGPORT $port\n"; + print $o "#define DEF_PGPORT_STR \"$port\"\n"; } - print O "#define VAL_CONFIGURE \"" + print $o "#define VAL_CONFIGURE \"" . $self->GetFakeConfigure() . "\"\n"; - print O "#endif /* IGNORE_CONFIGURED_SETTINGS */\n"; - close(O); - close(I); + print $o "#endif /* IGNORE_CONFIGURED_SETTINGS */\n"; + close($o); + close($i); } if (IsNewer( @@ -271,7 +264,7 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY if (IsNewer( 'src/backend/utils/fmgrtab.c', 'src/include/catalog/pg_proc.h')) { - print "Generating fmgrtab.c and fmgroids.h...\n"; + print "Generating fmgrtab.c, fmgroids.h, fmgrprotos.h...\n"; chdir('src/backend/utils'); system( "perl -I ../catalog Gen_fmgrtab.pl ../../../src/include/catalog/pg_proc.h"); @@ -286,6 +279,15 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY } if (IsNewer( + 'src/include/utils/fmgrprotos.h', + 'src/backend/utils/fmgrprotos.h')) + { + copyFile( + 'src/backend/utils/fmgrprotos.h', + 'src/include/utils/fmgrprotos.h'); + } + + if (IsNewer( 'src/include/storage/lwlocknames.h', 'src/backend/storage/lmgr/lwlocknames.txt')) { @@ -379,17 +381,17 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); my $d = ($year - 100) . "$yday"; - open(I, '<', 'src/interfaces/libpq/libpq.rc.in') + open(my $i, '<', 'src/interfaces/libpq/libpq.rc.in') || confess "Could not open libpq.rc.in"; - open(O, '>', 'src/interfaces/libpq/libpq.rc') + open(my $o, '>', 'src/interfaces/libpq/libpq.rc') || confess "Could not open libpq.rc"; - while (<I>) + while (<$i>) { s/(VERSION.*),0/$1,$d/; - print O; + print $o; } - close(I); - close(O); + close($i); + close($o); } if (IsNewer('src/bin/psql/sql_help.h', 'src/bin/psql/create_help.pl')) @@ -415,25 +417,23 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY 'src/interfaces/ecpg/include/ecpg_config.h.in')) { print "Generating ecpg_config.h...\n"; - open(O, '>', 'src/interfaces/ecpg/include/ecpg_config.h') + open(my $o, '>', 'src/interfaces/ecpg/include/ecpg_config.h') || confess "Could not open ecpg_config.h"; - print O <<EOF; + print $o <<EOF; #if (_MSC_VER > 1200) #define HAVE_LONG_LONG_INT_64 #define ENABLE_THREAD_SAFETY 1 EOF - print O "#define USE_INTEGER_DATETIMES 1\n" - if ($self->{options}->{integer_datetimes}); - print O "#endif\n"; - close(O); + print $o "#endif\n"; + close($o); } unless (-f "src/port/pg_config_paths.h") { print "Generating pg_config_paths.h...\n"; - open(O, '>', 'src/port/pg_config_paths.h') + open(my $o, '>', 'src/port/pg_config_paths.h') || confess "Could not open pg_config_paths.h"; - print O <<EOF; + print $o <<EOF; #define PGBINDIR "/bin" #define PGSHAREDIR "/share" #define SYSCONFDIR "/etc" @@ -447,7 +447,7 @@ EOF #define HTMLDIR "/doc" #define MANDIR "/man" EOF - close(O); + close($o); } my $mf = Project::read_file('src/backend/catalog/Makefile'); @@ -476,13 +476,13 @@ EOF } } - open(O, ">doc/src/sgml/version.sgml") + open(my $o, '>', "doc/src/sgml/version.sgml") || croak "Could not write to version.sgml\n"; - print O <<EOF; + print $o <<EOF; <!ENTITY version "$self->{strver}"> <!ENTITY majorversion "$self->{majorver}"> EOF - close(O); + close($o); } sub GenerateDefFile @@ -492,18 +492,18 @@ sub GenerateDefFile if (IsNewer($deffile, $txtfile)) { print "Generating $deffile...\n"; - open(I, $txtfile) || confess("Could not open $txtfile\n"); - open(O, ">$deffile") || confess("Could not open $deffile\n"); - print O "LIBRARY $libname\nEXPORTS\n"; - while (<I>) + open(my $if, '<', $txtfile) || confess("Could not open $txtfile\n"); + open(my $of, '>', $deffile) || confess("Could not open $deffile\n"); + print $of "LIBRARY $libname\nEXPORTS\n"; + while (<$if>) { next if (/^#/); next if (/^\s*$/); my ($f, $o) = split; - print O " $f @ $o\n"; + print $of " $f @ $o\n"; } - close(O); - close(I); + close($of); + close($if); } } @@ -548,6 +548,7 @@ sub AddProject if ($self->{options}->{xml}) { $proj->AddIncludeDir($self->{options}->{xml} . '\include'); + $proj->AddIncludeDir($self->{options}->{xml} . '\include\libxml2'); $proj->AddLibrary($self->{options}->{xml} . '\lib\libxml2.lib'); } if ($self->{options}->{xslt}) @@ -555,6 +556,11 @@ sub AddProject $proj->AddIncludeDir($self->{options}->{xslt} . '\include'); $proj->AddLibrary($self->{options}->{xslt} . '\lib\libxslt.lib'); } + if ($self->{options}->{uuid}) + { + $proj->AddIncludeDir($self->{options}->{uuid} . '\include'); + $proj->AddLibrary($self->{options}->{uuid} . '\lib\uuid.lib'); + } return $proj; } @@ -572,19 +578,19 @@ sub Save } } - open(SLN, ">pgsql.sln") || croak "Could not write to pgsql.sln\n"; - print SLN <<EOF; + open(my $sln, '>', "pgsql.sln") || croak "Could not write to pgsql.sln\n"; + print $sln <<EOF; Microsoft Visual Studio Solution File, Format Version $self->{solutionFileVersion} # $self->{visualStudioName} EOF - print SLN $self->GetAdditionalHeaders(); + print $sln $self->GetAdditionalHeaders(); foreach my $fld (keys %{ $self->{projects} }) { foreach my $proj (@{ $self->{projects}->{$fld} }) { - print SLN <<EOF; + print $sln <<EOF; Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "$proj->{name}", "$proj->{name}$proj->{filenameExtension}", "$proj->{guid}" EndProject EOF @@ -592,14 +598,14 @@ EOF if ($fld ne "") { $flduid{$fld} = Win32::GuidGen(); - print SLN <<EOF; + print $sln <<EOF; Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "$fld", "$fld", "$flduid{$fld}" EndProject EOF } } - print SLN <<EOF; + print $sln <<EOF; Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|$self->{platform}= Debug|$self->{platform} @@ -612,7 +618,7 @@ EOF { foreach my $proj (@{ $self->{projects}->{$fld} }) { - print SLN <<EOF; + print $sln <<EOF; $proj->{guid}.Debug|$self->{platform}.ActiveCfg = Debug|$self->{platform} $proj->{guid}.Debug|$self->{platform}.Build.0 = Debug|$self->{platform} $proj->{guid}.Release|$self->{platform}.ActiveCfg = Release|$self->{platform} @@ -621,7 +627,7 @@ EOF } } - print SLN <<EOF; + print $sln <<EOF; EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -634,15 +640,15 @@ EOF next if ($fld eq ""); foreach my $proj (@{ $self->{projects}->{$fld} }) { - print SLN "\t\t$proj->{guid} = $flduid{$fld}\n"; + print $sln "\t\t$proj->{guid} = $flduid{$fld}\n"; } } - print SLN <<EOF; + print $sln <<EOF; EndGlobalSection EndGlobal EOF - close(SLN); + close($sln); } sub GetFakeConfigure @@ -650,9 +656,7 @@ sub GetFakeConfigure my $self = shift; my $cfg = '--enable-thread-safety'; - $cfg .= ' --enable-cassert' if ($self->{options}->{asserts}); - $cfg .= ' --enable-integer-datetimes' - if ($self->{options}->{integer_datetimes}); + $cfg .= ' --enable-cassert' if ($self->{options}->{asserts}); $cfg .= ' --enable-nls' if ($self->{options}->{nls}); $cfg .= ' --enable-tap-tests' if ($self->{options}->{tap_tests}); $cfg .= ' --with-ldap' if ($self->{options}->{ldap}); diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl index 007e3c73b2..744c1f7d6e 100644 --- a/src/tools/msvc/build.pl +++ b/src/tools/msvc/build.pl @@ -2,6 +2,8 @@ # src/tools/msvc/build.pl +use strict; + BEGIN { @@ -21,24 +23,25 @@ use Mkvcbuild; if (-e "src/tools/msvc/buildenv.pl") { - require "src/tools/msvc/buildenv.pl"; + do "src/tools/msvc/buildenv.pl"; } elsif (-e "./buildenv.pl") { - require "./buildenv.pl"; + do "./buildenv.pl"; } # set up the project our $config; -require "config_default.pl"; -require "config.pl" if (-f "src/tools/msvc/config.pl"); +do "config_default.pl"; +do "config.pl" if (-f "src/tools/msvc/config.pl"); my $vcver = Mkvcbuild::mkvcbuild($config); # check what sort of build we are doing -my $bconf = $ENV{CONFIG} || "Release"; -my $buildwhat = $ARGV[1] || ""; +my $bconf = $ENV{CONFIG} || "Release"; +my $msbflags = $ENV{MSBFLAGS} || ""; +my $buildwhat = $ARGV[1] || ""; if (uc($ARGV[0]) eq 'DEBUG') { $bconf = "Debug"; @@ -53,20 +56,21 @@ elsif (uc($ARGV[0]) ne "RELEASE") if ($buildwhat and $vcver >= 10.00) { system( - "msbuild $buildwhat.vcxproj /verbosity:normal /p:Configuration=$bconf" +"msbuild $buildwhat.vcxproj /verbosity:normal $msbflags /p:Configuration=$bconf" ); } elsif ($buildwhat) { - system("vcbuild $buildwhat.vcproj $bconf"); + system("vcbuild $msbflags $buildwhat.vcproj $bconf"); } else { - system("msbuild pgsql.sln /verbosity:normal /p:Configuration=$bconf"); + system( +"msbuild pgsql.sln /verbosity:normal $msbflags /p:Configuration=$bconf"); } # report status -$status = $? >> 8; +my $status = $? >> 8; exit $status; diff --git a/src/tools/msvc/builddoc.pl b/src/tools/msvc/builddoc.pl index 2b56ced43c..e0b5c50b34 100644 --- a/src/tools/msvc/builddoc.pl +++ b/src/tools/msvc/builddoc.pl @@ -18,7 +18,7 @@ chdir '../../..' if (-d '../msvc' && -d '../../../src'); noversion() unless -e 'doc/src/sgml/version.sgml'; -require 'src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; +do 'src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; my $docroot = $ENV{DOCROOT}; die "bad DOCROOT '$docroot'" unless ($docroot && -d $docroot); diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat index 469b8a24b2..e50f228d9e 100755 --- a/src/tools/msvc/clean.bat +++ b/src/tools/msvc/clean.bat @@ -20,6 +20,7 @@ del /s /q src\bin\win32ver.rc 2> NUL del /s /q src\interfaces\win32ver.rc 2> NUL if exist src\backend\win32ver.rc del /q src\backend\win32ver.rc if exist src\backend\replication\libpqwalreceiver\win32ver.rc del /q src\backend\replication\libpqwalreceiver\win32ver.rc +if exist src\backend\replication\pgoutput\win32ver.rc del /q src\backend\replication\pgoutput\win32ver.rc if exist src\backend\snowball\win32ver.rc del /q src\backend\snowball\win32ver.rc if exist src\interfaces\ecpg\test\win32ver.rc del /q src\interfaces\ecpg\test\win32ver.rc if exist src\pl\plperl\win32ver.rc del /q src\pl\plperl\win32ver.rc @@ -42,9 +43,11 @@ if exist src\include\dynloader.h del /q src\include\dynloader.h if %DIST%==1 if exist src\backend\parser\gram.h del /q src\backend\parser\gram.h if exist src\include\utils\errcodes.h del /q src\include\utils\errcodes.h if exist src\include\utils\fmgroids.h del /q src\include\utils\fmgroids.h +if exist src\include\utils\fmgrprotos.h del /q src\include\utils\fmgrprotos.h if exist src\include\utils\probes.h del /q src\include\utils\probes.h if %DIST%==1 if exist src\backend\utils\fmgroids.h del /q src\backend\utils\fmgroids.h +if %DIST%==1 if exist src\backend\utils\fmgrprotos.h del /q src\backend\utils\fmgrprotos.h if %DIST%==1 if exist src\backend\utils\fmgrtab.c del /q src\backend\utils\fmgrtab.c if %DIST%==1 if exist src\backend\catalog\postgres.bki del /q src\backend\catalog\postgres.bki if %DIST%==1 if exist src\backend\catalog\postgres.description del /q src\backend\catalog\postgres.description @@ -107,6 +110,6 @@ REM for /r %%f in (*.sql) do if exist %%f.in del %%f cd %D% REM Clean up ecpg regression test files -msbuild /NoLogo ecpg_regression.proj /t:clean /v:q +msbuild ecpg_regression.proj /NoLogo /v:q %MSBFLAGS% /t:clean goto :eof diff --git a/src/tools/msvc/config_default.pl b/src/tools/msvc/config_default.pl index f046687bd0..93f7887075 100644 --- a/src/tools/msvc/config_default.pl +++ b/src/tools/msvc/config_default.pl @@ -4,8 +4,7 @@ use warnings; our $config = { asserts => 0, # --enable-cassert - # integer_datetimes=>1, # --enable-integer-datetimes - on is now default - # float4byval=>1, # --disable-float4-byval, on by default + # float4byval=>1, # --disable-float4-byval, on by default # float8byval=> $platformbits == 64, # --disable-float8-byval, # off by default on 32 bit platforms, on by default on 64 bit platforms diff --git a/src/tools/msvc/ecpg_regression.proj b/src/tools/msvc/ecpg_regression.proj index 58ea18c8fb..745aa19e1b 100644 --- a/src/tools/msvc/ecpg_regression.proj +++ b/src/tools/msvc/ecpg_regression.proj @@ -51,7 +51,7 @@ <!-- Run ECPG and the Visual C++ compiler on the files. Don't bother with dependency check between the steps --> <Exec WorkingDirectory="%(Pgc.RelativeDir)" Command="$(OUTDIR)ecpg\ecpg -I ../../include --regression $(ECPGPARAM) -o %(Pgc.Filename).c %(Pgc.Filename).pgc" /> - <Exec WorkingDirectorY="%(Pgc.RelativeDir)" Command="cl /nologo %(Pgc.FileName).c /TC /MD$(DEBUGLIB) /DENABLE_THREAD_SAFETY /DWIN32 /DWIN32_ONLY_COMPILER /I. /I..\..\include /I..\..\..\libpq /I..\..\..\..\include /link /defaultlib:$(OUTDIR)libecpg\libecpg.lib /defaultlib:$(OUTDIR)libecpg_compat\libecpg_compat.lib /defaultlib:$(OUTDIR)libpgtypes\libpgtypes.lib" /> + <Exec WorkingDirectorY="%(Pgc.RelativeDir)" Command="cl /nologo %(Pgc.FileName).c /TC /MD$(DEBUGLIB) /DENABLE_THREAD_SAFETY /DWIN32 /I. /I..\..\include /I..\..\..\libpq /I..\..\..\..\include /link /defaultlib:$(OUTDIR)libecpg\libecpg.lib /defaultlib:$(OUTDIR)libecpg_compat\libecpg_compat.lib /defaultlib:$(OUTDIR)libpgtypes\libpgtypes.lib" /> </Target> <!-- Clean up all output files --> diff --git a/src/tools/msvc/gendef.pl b/src/tools/msvc/gendef.pl index 8ccaab3551..96122750f1 100644 --- a/src/tools/msvc/gendef.pl +++ b/src/tools/msvc/gendef.pl @@ -1,10 +1,11 @@ -my @def; - -use warnings; use strict; +use warnings; use 5.8.0; +use File::Spec::Functions qw(splitpath catpath); use List::Util qw(max); +my @def; + # # Script that generates a .DEF file for all objects in a directory # @@ -14,9 +15,11 @@ use List::Util qw(max); sub dumpsyms { my ($objfile, $symfile) = @_; - system("dumpbin /symbols /out:symbols.out $_ >NUL") + my ($symvol, $symdirs, $symbase) = splitpath($symfile); + my $tmpfile = catpath($symvol, $symdirs, "symbols.out"); + system("dumpbin /symbols /out:$tmpfile $_ >NUL") && die "Could not call dumpbin"; - rename("symbols.out", $symfile); + rename($tmpfile, $symfile); } # Given a symbol file path, loops over its contents @@ -29,8 +32,8 @@ sub dumpsyms sub extract_syms { my ($symfile, $def) = @_; - open(F, "<$symfile") || die "Could not open $symfile for $_\n"; - while (<F>) + open(my $f, '<', $symfile) || die "Could not open $symfile for $_\n"; + while (<$f>) { # Expected symbol lines look like: @@ -112,14 +115,14 @@ sub extract_syms # whatever came last. $def->{ $pieces[6] } = $pieces[3]; } - close(F); + close($f); } sub writedef { my ($deffile, $platform, $def) = @_; - open(DEF, ">$deffile") || die "Could not write to $deffile\n"; - print DEF "EXPORTS\n"; + open(my $fh, '>', $deffile) || die "Could not write to $deffile\n"; + print $fh "EXPORTS\n"; foreach my $f (sort keys %{$def}) { my $isdata = $def->{$f} eq 'data'; @@ -132,14 +135,14 @@ sub writedef # decorated with the DATA option for variables. if ($isdata) { - print DEF " $f DATA\n"; + print $fh " $f DATA\n"; } else { - print DEF " $f\n"; + print $fh " $f\n"; } } - close(DEF); + close($fh); } @@ -171,7 +174,7 @@ print "Generating $defname.DEF from directory $ARGV[0], platform $platform\n"; my %def = (); -while (<$ARGV[0]/*.obj>) +while (<$ARGV[0]/*.obj>) ## no critic (RequireGlobFunction); { my $objfile = $_; my $symfile = $objfile; diff --git a/src/tools/msvc/install.pl b/src/tools/msvc/install.pl index bde5b7c793..b2d7f9e040 100755 --- a/src/tools/msvc/install.pl +++ b/src/tools/msvc/install.pl @@ -14,11 +14,11 @@ use Install qw(Install); if (-e "src/tools/msvc/buildenv.pl") { - require "src/tools/msvc/buildenv.pl"; + do "src/tools/msvc/buildenv.pl"; } elsif (-e "./buildenv.pl") { - require "./buildenv.pl"; + do "./buildenv.pl"; } my $target = shift || Usage(); diff --git a/src/tools/msvc/mkvcbuild.pl b/src/tools/msvc/mkvcbuild.pl index 6f1c42e504..9255dff022 100644 --- a/src/tools/msvc/mkvcbuild.pl +++ b/src/tools/msvc/mkvcbuild.pl @@ -19,7 +19,7 @@ print "Warning: no config.pl found, using default.\n" unless (-f 'src/tools/msvc/config.pl'); our $config; -require 'src/tools/msvc/config_default.pl'; -require 'src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); +do 'src/tools/msvc/config_default.pl'; +do 'src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); Mkvcbuild::mkvcbuild($config); diff --git a/src/tools/msvc/pgbison.pl b/src/tools/msvc/pgbison.pl index 31e75403f5..e799d900fe 100644 --- a/src/tools/msvc/pgbison.pl +++ b/src/tools/msvc/pgbison.pl @@ -7,7 +7,7 @@ use File::Basename; # assume we are in the postgres source root -require 'src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; +do 'src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; my ($bisonver) = `bison -V`; # grab first line $bisonver = (split(/\s+/, $bisonver))[3]; # grab version number @@ -38,7 +38,7 @@ $output =~ s/gram\.c$/pl_gram.c/ if $input =~ /src.pl.plpgsql.src.gram\.y$/; my $makefile = dirname($input) . "/Makefile"; my ($mf, $make); -open($mf, $makefile); +open($mf, '<', $makefile); local $/ = undef; $make = <$mf>; close($mf); diff --git a/src/tools/msvc/pgflex.pl b/src/tools/msvc/pgflex.pl index 474ce63e5c..eba06f2824 100644 --- a/src/tools/msvc/pgflex.pl +++ b/src/tools/msvc/pgflex.pl @@ -2,15 +2,15 @@ # src/tools/msvc/pgflex.pl -# silence flex bleatings about file path style -$ENV{CYGWIN} = 'nodosfilewarning'; - use strict; use File::Basename; +# silence flex bleatings about file path style +$ENV{CYGWIN} = 'nodosfilewarning'; + # assume we are in the postgres source root -require 'src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; +do 'src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; my ($flexver) = `flex -V`; # grab first line $flexver = (split(/\s+/, $flexver))[1]; @@ -41,7 +41,7 @@ elsif (!-e $input) # get flex flags from make file my $makefile = dirname($input) . "/Makefile"; my ($mf, $make); -open($mf, $makefile); +open($mf, '<', $makefile); local $/ = undef; $make = <$mf>; close($mf); @@ -52,29 +52,38 @@ system("flex $flexflags -o$output $input"); if ($? == 0) { - # For non-reentrant scanners we need to fix up the yywrap macro definition - # to keep the MS compiler happy. - # For reentrant scanners (like the core scanner) we do not - # need to (and must not) change the yywrap definition. + # Check for "%option reentrant" in .l file. my $lfile; - open($lfile, $input) || die "opening $input for reading: $!"; + open($lfile, '<', $input) || die "opening $input for reading: $!"; my $lcode = <$lfile>; close($lfile); - if ($lcode !~ /\%option\sreentrant/) + if ($lcode =~ /\%option\sreentrant/) { + + # Reentrant scanners usually need a fix to prevent + # "unused variable" warnings with older flex versions. + system("perl src\\tools\\fix-old-flex-code.pl $output"); + } + else + { + + # For non-reentrant scanners we need to fix up the yywrap + # macro definition to keep the MS compiler happy. + # For reentrant scanners (like the core scanner) we do not + # need to (and must not) change the yywrap definition. my $cfile; - open($cfile, $output) || die "opening $output for reading: $!"; + open($cfile, '<', $output) || die "opening $output for reading: $!"; my $ccode = <$cfile>; close($cfile); $ccode =~ s/yywrap\(n\)/yywrap()/; - open($cfile, ">$output") || die "opening $output for reading: $!"; + open($cfile, '>', $output) || die "opening $output for writing: $!"; print $cfile $ccode; close($cfile); } if ($flexflags =~ /\s-b\s/) { my $lexback = "lex.backup"; - open($lfile, $lexback) || die "opening $lexback for reading: $!"; + open($lfile, '<', $lexback) || die "opening $lexback for reading: $!"; my $lexbacklines = <$lfile>; close($lfile); my $linecount = $lexbacklines =~ tr /\n/\n/; diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index b4f946474f..468a62d8aa 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -20,8 +20,8 @@ chdir "../../.." if (-d "../../../src/tools/msvc"); my $topdir = getcwd(); my $tmp_installdir = "$topdir/tmp_install"; -require 'src/tools/msvc/config_default.pl'; -require 'src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); +do 'src/tools/msvc/config_default.pl'; +do 'src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); # buildenv.pl is for specifying the build environment settings # it should contain lines like: @@ -29,12 +29,12 @@ require 'src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); if (-e "src/tools/msvc/buildenv.pl") { - require "src/tools/msvc/buildenv.pl"; + do "src/tools/msvc/buildenv.pl"; } my $what = shift || ""; if ($what =~ -/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|bincheck|recoverycheck)$/i +/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|bincheck|recoverycheck|taptest)$/i ) { $what = uc $what; @@ -54,13 +54,6 @@ copy("$Config/dummy_seclabel/dummy_seclabel.dll", "src/test/regress"); $ENV{PATH} = "$topdir/$Config/libpq;$ENV{PATH}"; -my $schedule = shift; -unless ($schedule) -{ - $schedule = "serial"; - $schedule = "parallel" if ($what eq 'CHECK' || $what =~ /PARALLEL/); -} - if ($ENV{PERL5LIB}) { $ENV{PERL5LIB} = "$topdir/src/tools/msvc;$ENV{PERL5LIB}"; @@ -90,13 +83,14 @@ my %command = ( ISOLATIONCHECK => \&isolationcheck, BINCHECK => \&bincheck, RECOVERYCHECK => \&recoverycheck, - UPGRADECHECK => \&upgradecheck,); + UPGRADECHECK => \&upgradecheck, + TAPTEST => \&taptest,); my $proc = $command{$what}; exit 3 unless $proc; -&$proc(); +&$proc(@ARGV); exit 0; @@ -104,6 +98,7 @@ exit 0; sub installcheck { + my $schedule = shift || 'serial'; my @args = ( "../../../$Config/pg_regress/pg_regress", "--dlpath=.", @@ -119,6 +114,7 @@ sub installcheck sub check { + my $schedule = shift || 'parallel'; InstallTemp(); chdir "${topdir}/src/test/regress"; my @args = ( @@ -138,14 +134,15 @@ sub check sub ecpgcheck { + my $msbflags = $ENV{MSBFLAGS} || ""; chdir $startdir; - system("msbuild ecpg_regression.proj /p:config=$Config"); + system("msbuild ecpg_regression.proj $msbflags /p:config=$Config"); my $status = $? >> 8; exit $status if $status; InstallTemp(); chdir "$topdir/src/interfaces/ecpg/test"; - $schedule = "ecpg"; - my @args = ( + my $schedule = "ecpg"; + my @args = ( "../../../../$Config/pg_regress_ecpg/pg_regress_ecpg", "--bindir=", "--dbname=ecpg1_regression,ecpg2_regression", @@ -184,7 +181,10 @@ sub tap_check my $dir = shift; chdir $dir; - my @args = ("prove", "--verbose", "t/*.pl"); + my @flags; + @flags = split(/\s+/, $ENV{PROVE_FLAGS}) if exists $ENV{PROVE_FLAGS}; + + my @args = ("prove", @flags, "t/*.pl"); # adjust the environment for just this test local %ENV = %ENV; @@ -218,6 +218,17 @@ sub bincheck exit $mstat if $mstat; } +sub taptest +{ + my $dir = shift; + + die "no tests found!" unless -d "$topdir/$dir/t"; + + InstallTemp(); + my $status = tap_check("$topdir/$dir"); + exit $status if $status; +} + sub plcheck { chdir "../../pl"; @@ -447,7 +458,7 @@ sub upgradecheck print "\nRunning initdb on old cluster\n\n"; standard_initdb() or exit 1; print "\nStarting old cluster\n\n"; - my @args = ('pg_ctl', 'start', '-l', "$logdir/postmaster1.log", '-w'); + my @args = ('pg_ctl', 'start', '-l', "$logdir/postmaster1.log"); system(@args) == 0 or exit 1; print "\nCreating databases with names covering most ASCII bytes\n\n"; @@ -464,7 +475,7 @@ sub upgradecheck @args = ('pg_dumpall', '-f', "$tmp_root/dump1.sql"); system(@args) == 0 or exit 1; print "\nStopping old cluster\n\n"; - system("pg_ctl -m fast stop") == 0 or exit 1; + system("pg_ctl stop") == 0 or exit 1; $ENV{PGDATA} = "$data"; print "\nSetting up new cluster\n\n"; standard_initdb() or exit 1; @@ -474,7 +485,7 @@ sub upgradecheck $bindir, '-B', $bindir); system(@args) == 0 or exit 1; print "\nStarting new cluster\n\n"; - @args = ('pg_ctl', '-l', "$logdir/postmaster2.log", '-w', 'start'); + @args = ('pg_ctl', '-l', "$logdir/postmaster2.log", 'start'); system(@args) == 0 or exit 1; print "\nSetting up stats on new cluster\n\n"; system(".\\analyze_new_cluster.bat") == 0 or exit 1; @@ -482,7 +493,7 @@ sub upgradecheck @args = ('pg_dumpall', '-f', "$tmp_root/dump2.sql"); system(@args) == 0 or exit 1; print "\nStopping new cluster\n\n"; - system("pg_ctl -m fast stop") == 0 or exit 1; + system("pg_ctl stop") == 0 or exit 1; print "\nDeleting old cluster\n\n"; system(".\\delete_old_cluster.bat") == 0 or exit 1; print "\nComparing old and new cluster dumps\n\n"; @@ -504,8 +515,8 @@ sub upgradecheck sub fetchRegressOpts { my $handle; - open($handle, "<GNUmakefile") - || open($handle, "<Makefile") + open($handle, '<', "GNUmakefile") + || open($handle, '<', "Makefile") || die "Could not open Makefile"; local ($/) = undef; my $m = <$handle>; @@ -519,10 +530,9 @@ sub fetchRegressOpts # Substitute known Makefile variables, then ignore options that retain # an unhandled variable reference. Ignore anything that isn't an # option starting with "--". - @opts = grep { - s/\Q$(top_builddir)\E/\"$topdir\"/; - $_ !~ /\$\(/ && $_ =~ /^--/ - } split(/\s+/, $1); + @opts = grep { !/\$\(/ && /^--/ } + map { (my $x = $_) =~ s/\Q$(top_builddir)\E/\"$topdir\"/; $x; } + split(/\s+/, $1); } if ($m =~ /^\s*ENCODING\s*=\s*(\S+)/m) { @@ -539,8 +549,8 @@ sub fetchTests { my $handle; - open($handle, "<GNUmakefile") - || open($handle, "<Makefile") + open($handle, '<', "GNUmakefile") + || open($handle, '<', "Makefile") || die "Could not open Makefile"; local ($/) = undef; my $m = <$handle>; @@ -588,15 +598,18 @@ sub GetTests sub InstallTemp { - print "Setting up temp install\n\n"; - Install("$tmp_installdir", "all", $config); + unless ($ENV{NO_TEMP_INSTALL}) + { + print "Setting up temp install\n\n"; + Install("$tmp_installdir", "all", $config); + } $ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}"; } sub usage { print STDERR - "Usage: vcregress.pl <mode> [ <schedule> ]\n\n", + "Usage: vcregress.pl <mode> [ <arg>]\n\n", "Options for <mode>:\n", " bincheck run tests of utilities in src/bin/\n", " check deploy instance and run regression tests on it\n", @@ -607,9 +620,12 @@ sub usage " modulescheck run tests of modules in src/test/modules/\n", " plcheck run tests of PL languages\n", " recoverycheck run recovery test suite\n", + " taptest run an arbitrary TAP test set\n", " upgradecheck run tests of pg_upgrade\n", - "\nOptions for <schedule>:\n", + "\nOptions for <arg>: (used by check and installcheck)\n", " serial serial mode\n", - " parallel parallel mode\n"; + " parallel parallel mode\n", + "\nOption for <arg>: for taptest\n", + " TEST_DIR (required) directory where tests reside\n"; exit(1); } diff --git a/src/tools/pginclude/pgcheckdefines b/src/tools/pginclude/pgcheckdefines index 5db507070f..aa7c9c2fc1 100755 --- a/src/tools/pginclude/pgcheckdefines +++ b/src/tools/pginclude/pgcheckdefines @@ -20,14 +20,16 @@ # src/tools/pginclude/pgcheckdefines # +use strict; + use Cwd; use File::Basename; -$topdir = cwd(); +my $topdir = cwd(); # Programs to use -$FIND = "find"; -$MAKE = "make"; +my $FIND = "find"; +my $MAKE = "make"; # # Build arrays of all the .c and .h files in the tree @@ -38,43 +40,47 @@ $MAKE = "make"; # Including these .h files would clutter the list of define'd symbols and # cause a lot of false-positive results. # -open PIPE, "$FIND * -type f -name '*.c' |" +my (@cfiles, @hfiles); + +open my $pipe, '-|', "$FIND * -type f -name '*.c'" or die "can't fork: $!"; -while (<PIPE>) +while (<$pipe>) { chomp; push @cfiles, $_; } -close PIPE or die "$FIND failed: $!"; +close $pipe or die "$FIND failed: $!"; -open PIPE, "$FIND * -type f -name '*.h' |" +open $pipe, '-|', "$FIND * -type f -name '*.h'" or die "can't fork: $!"; -while (<PIPE>) +while (<$pipe>) { chomp; push @hfiles, $_ unless m|^src/include/port/| || m|^src/backend/port/\w+/|; } -close PIPE or die "$FIND failed: $!"; +close $pipe or die "$FIND failed: $!"; # # For each .h file, extract all the symbols it #define's, and add them to # a hash table. To cover the possibility of multiple .h files defining # the same symbol, we make each hash entry a hash of filenames. # -foreach $hfile (@hfiles) +my %defines; + +foreach my $hfile (@hfiles) { - open HFILE, $hfile + open my $fh, '<', $hfile or die "can't open $hfile: $!"; - while (<HFILE>) + while (<$fh>) { if (m/^\s*#\s*define\s+(\w+)/) { $defines{$1}{$hfile} = 1; } } - close HFILE; + close $fh; } # @@ -82,9 +88,9 @@ foreach $hfile (@hfiles) # files it #include's. Then extract all the symbols it tests for defined-ness, # and check each one against the previously built hashtable. # -foreach $file (@hfiles, @cfiles) +foreach my $file (@hfiles, @cfiles) { - ($fname, $fpath) = fileparse($file); + my ($fname, $fpath) = fileparse($file); chdir $fpath or die "can't chdir to $fpath: $!"; # @@ -96,16 +102,18 @@ foreach $file (@hfiles, @cfiles) # hence printing multiple definitions --- we keep the last one, which # should come from the current Makefile. # + my $MAKECMD; + if (-f "Makefile" || -f "GNUmakefile") { $MAKECMD = "$MAKE -qp"; } else { - $subdir = $fpath; + my $subdir = $fpath; chop $subdir; - $top_builddir = ".."; - $tmp = $fpath; + my $top_builddir = ".."; + my $tmp = $fpath; while (($tmp = dirname($tmp)) ne '.') { $top_builddir = $top_builddir . "/.."; @@ -113,9 +121,12 @@ foreach $file (@hfiles, @cfiles) $MAKECMD = "$MAKE -qp 'subdir=$subdir' 'top_builddir=$top_builddir' -f '$top_builddir/src/Makefile.global'"; } - open PIPE, "$MAKECMD |" + + my ($CPPFLAGS, $CFLAGS, $CFLAGS_SL, $PTHREAD_CFLAGS, $CC); + + open $pipe, '-|', "$MAKECMD" or die "can't fork: $!"; - while (<PIPE>) + while (<$pipe>) { if (m/^CPPFLAGS :?= (.*)/) { @@ -153,15 +164,15 @@ foreach $file (@hfiles, @cfiles) # "gcc -H" reports inclusions on stderr as "... filename" where the # number of dots varies according to nesting depth. # - @includes = (); - $COMPILE = "$CC $CPPFLAGS $CFLAGS -H -E $fname"; - open PIPE, "$COMPILE 2>&1 >/dev/null |" + my @includes = (); + my $COMPILE = "$CC $CPPFLAGS $CFLAGS -H -E $fname"; + open $pipe, '-|', "$COMPILE 2>&1 >/dev/null" or die "can't fork: $!"; - while (<PIPE>) + while (<$pipe>) { if (m/^\.+ (.*)/) { - $include = $1; + my $include = $1; # Ignore system headers (absolute paths); but complain if a # .c file includes a system header before any PG header. @@ -176,7 +187,7 @@ foreach $file (@hfiles, @cfiles) $include =~ s|^\./||; # Make path relative to top of tree - $ipath = $fpath; + my $ipath = $fpath; while ($include =~ s|^\.\./||) { $ipath = dirname($ipath) . "/"; @@ -200,21 +211,19 @@ foreach $file (@hfiles, @cfiles) # We assume #ifdef isn't continued across lines, and that defined(foo) # isn't split across lines either # - open FILE, $fname + open my $fh, '<', $fname or die "can't open $file: $!"; - $inif = 0; - while (<FILE>) + my $inif = 0; + while (<$fh>) { - $line = $_; + my $line = $_; if ($line =~ m/^\s*#\s*ifdef\s+(\w+)/) { - $symbol = $1; - &checkit; + checkit($file, $1, @includes); } if ($line =~ m/^\s*#\s*ifndef\s+(\w+)/) { - $symbol = $1; - &checkit; + checkit($file, $1, @includes); } if ($line =~ m/^\s*#\s*if\s+/) { @@ -224,8 +233,7 @@ foreach $file (@hfiles, @cfiles) { while ($line =~ s/\bdefined(\s+|\s*\(\s*)(\w+)//) { - $symbol = $2; - &checkit; + checkit($file, $2, @includes); } if (!($line =~ m/\\$/)) { @@ -233,7 +241,7 @@ foreach $file (@hfiles, @cfiles) } } } - close FILE; + close $fh; chdir $topdir or die "can't chdir to $topdir: $!"; } @@ -243,6 +251,7 @@ exit 0; # Check an is-defined reference sub checkit { + my ($file, $symbol, @includes) = @_; # Ignore if symbol isn't defined in any PG include files if (!defined $defines{$symbol}) @@ -258,10 +267,10 @@ sub checkit # occur after the use of the symbol. Given our normal file layout, # however, the risk is minimal. # - foreach $deffile (keys %{ $defines{$symbol} }) + foreach my $deffile (keys %{ $defines{$symbol} }) { return if $deffile eq $file; - foreach $reffile (@includes) + foreach my $reffile (@includes) { return if $deffile eq $reffile; } @@ -273,7 +282,7 @@ sub checkit # if ($file =~ m/\.h$/) { - foreach $deffile (keys %{ $defines{$symbol} }) + foreach my $deffile (keys %{ $defines{$symbol} }) { return if $deffile eq 'src/include/c.h'; return if $deffile eq 'src/include/postgres.h'; @@ -284,7 +293,7 @@ sub checkit } # - @places = keys %{ $defines{$symbol} }; + my @places = keys %{ $defines{$symbol} }; print "$file references $symbol, defined in @places\n"; # print "includes: @includes\n"; diff --git a/src/tools/pgindent/README b/src/tools/pgindent/README index 8e91697bd1..ee27b732ec 100644 --- a/src/tools/pgindent/README +++ b/src/tools/pgindent/README @@ -15,7 +15,8 @@ PREREQUISITES: 2) Install entab (src/tools/entab/). 3) Install perltidy. Please be sure it is v20090616 (older and newer - versions make different formatting choices, and we want consistency). + versions make different formatting choices, and we want consistency). See + https://sourceforge.net/projects/perltidy/files/perltidy/perltidy-20090616/ DOING THE INDENT RUN: @@ -30,9 +31,9 @@ DOING THE INDENT RUN: 3) Download the latest typedef file from the buildfarm: - wget -O src/tools/pgindent/typedefs.list http://buildfarm.postgresql.org/cgi-bin/typedefs.pl + wget -O src/tools/pgindent/typedefs.list https://buildfarm.postgresql.org/cgi-bin/typedefs.pl - (See http://www.pgbuildfarm.org/cgi-bin/typedefs.pl?show_list for a full + (See https://www.pgbuildfarm.org/cgi-bin/typedefs.pl?show_list for a full list of typedef files, if you want to indent some back branch.) 4) Run pgindent on the C files: @@ -108,7 +109,7 @@ BSD indent We have standardized on NetBSD's indent, and renamed it pg_bsd_indent. We have fixed a few bugs which requre the NetBSD source to be patched with indent.bsd.patch patch. A fully patched version is available at -ftp://ftp.postgresql.org/pub/dev. +https://ftp.postgresql.org/pub/dev. GNU indent, version 2.2.6, has several problems, and is not recommended. These bugs become pretty major when you are doing >500k lines of code. diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent index 0d3859d029..f48af32426 100755 --- a/src/tools/pgindent/pgindent +++ b/src/tools/pgindent/pgindent @@ -159,8 +159,7 @@ sub process_exclude while (my $line = <$eh>) { chomp $line; - my $rgx; - eval " \$rgx = qr!$line!;"; + my $rgx = qr!$line!; @files = grep { $_ !~ /$rgx/ } @files if $rgx; } close($eh); @@ -435,7 +434,7 @@ sub diff sub run_build { - eval "use LWP::Simple;"; + eval "use LWP::Simple;"; ## no critic (ProhibitStringyEval); my $code_base = shift || '.'; my $save_dir = getcwd(); @@ -453,7 +452,7 @@ sub run_build chdir "$code_base/src/tools/pgindent"; my $typedefs_list_url = - "http://buildfarm.postgresql.org/cgi-bin/typedefs.pl"; + "https://buildfarm.postgresql.org/cgi-bin/typedefs.pl"; my $rv = getstore($typedefs_list_url, "tmp_typedefs.list"); @@ -463,7 +462,7 @@ sub run_build $ENV{PGTYPEDEFS} = abs_path('tmp_typedefs.list'); my $pg_bsd_indent_url = - "ftp://ftp.postgresql.org/pub/dev/pg_bsd_indent-" + "https://ftp.postgresql.org/pub/dev/pg_bsd_indent-" . $INDENT_VERSION . ".tar.gz"; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index dff6f65ef0..eaa6d32904 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -1,7 +1,6 @@ ABITVEC ACCESS_ALLOWED_ACE ACL_SIZE_INFORMATION -AES_KEY AFFIX ASN1_INTEGER ASN1_OBJECT @@ -37,14 +36,13 @@ AfterTriggerSharedData AfterTriggersData Agg AggClauseCosts -AggHashEntry AggInfo AggPath AggSplit AggState AggStatePerAgg AggStatePerGroup -AggStatePerGroupData +AggStatePerHash AggStatePerPhase AggStatePerTrans AggStrategy @@ -59,6 +57,7 @@ AllocSet AllocSetContext AllocateDesc AllocateDescKind +AlterCollationStmt AlterDatabaseSetStmt AlterDatabaseStmt AlterDefaultPrivilegesStmt @@ -76,9 +75,12 @@ AlterOpFamilyStmt AlterOperatorStmt AlterOwnerStmt AlterPolicyStmt +AlterPublicationStmt AlterRoleSetStmt AlterRoleStmt AlterSeqStmt +AlterSubscriptionStmt +AlterSubscriptionType AlterSystemStmt AlterTSConfigType AlterTSConfigurationStmt @@ -102,7 +104,7 @@ AppendPath AppendRelInfo AppendState Archive -ArchiveEntryPtr +ArchiveEntryPtrType ArchiveFormat ArchiveHandle ArchiveMode @@ -113,22 +115,22 @@ ArrayBuildState ArrayBuildStateAny ArrayBuildStateArr ArrayCoerceExpr -ArrayCoerceExprState ArrayConstIterState ArrayExpr ArrayExprIterState -ArrayExprState +ArrayIOData ArrayIterator ArrayMapState ArrayMetaState ArrayParseState ArrayRef -ArrayRefExprState +ArrayRefState ArrayRemapInfo ArrayType AsyncQueueControl AsyncQueueEntry AttInMetadata +AttStatsSlot AttoptCacheEntry AttoptCacheKey AttrDefInfo @@ -138,8 +140,10 @@ AttributeOpts AuthRequest AutoVacOpts AutoVacuumShmemStruct +AutoVacuumWorkItem +AutoVacuumWorkItemType +AutovacWorkItems AuxProcType -BF_KEY BF_ctx BF_key BF_word @@ -161,10 +165,12 @@ BTCycleId BTIndexStat BTMetaPageData BTOneVacInfo +BTPS_State BTPageOpaque BTPageOpaqueData BTPageStat BTPageState +BTParallelScanDesc BTScanOpaque BTScanOpaqueData BTScanPos @@ -182,6 +188,7 @@ Backend BackendId BackendParameters BackendState +BackendType BackgroundWorker BackgroundWorkerArray BackgroundWorkerHandle @@ -229,7 +236,6 @@ BloomTuple BlowfishContext BoolAggState BoolExpr -BoolExprState BoolExprType BoolTestType BooleanTest @@ -243,8 +249,11 @@ BrinOpcInfo BrinOptions BrinRevmap BrinSpecialSpace +BrinStatsData BrinTuple BrinValues +BtreeCheckState +BtreeLevel Bucket BufFile Buffer @@ -263,7 +272,6 @@ BuiltinScript BulkInsertState CACHESIGN CAC_state -CAST_KEY CEOUC_WAIT_MODE CFuncHashTabEntry CHAR @@ -274,6 +282,7 @@ CMPDAffix CONTEXT COP CRITICAL_SECTION +CRSSnapshotAction CState CV C_block @@ -281,10 +290,8 @@ CachedPlan CachedPlanSource CancelRequestPacket CaseExpr -CaseExprState CaseTestExpr CaseWhen -CaseWhenState Cash CastInfo CatCList @@ -305,21 +312,18 @@ CkptSortItem CkptTsStatus ClientAuthentication_hook_type ClientData -ClonePtr +ClonePtrType ClosePortalStmt -ClosePtr +ClosePtrType Clump ClusterInfo ClusterStmt CmdType CoalesceExpr -CoalesceExprState CoerceParamHook CoerceToDomain -CoerceToDomainState CoerceToDomainValue CoerceViaIO -CoerceViaIOState CoercionContext CoercionForm CoercionPathType @@ -336,6 +340,7 @@ ColumnCompareData ColumnDef ColumnIOData ColumnRef +CombinationGenerator ComboCidEntry ComboCidEntryData ComboCidKey @@ -350,16 +355,20 @@ CommitTimestampShared CommonEntry CommonTableExpr CompareScalarsContext +CompositeIOData CompositeTypeStmt CompoundAffixFlag CompressionAlgorithm CompressorState +ConditionVariable +ConditionalStack ConfigData ConfigVariable ConnCacheEntry ConnCacheKey ConnStatusType ConnType +ConnectionStateEnum ConsiderSplitContext Const ConstrCheck @@ -374,7 +383,6 @@ ConvInfo ConvProcInfo ConversionLocation ConvertRowtypeExpr -ConvertRowtypeExprState CookedConstraint CopyDest CopyState @@ -401,14 +409,17 @@ CreateOpClassStmt CreateOpFamilyStmt CreatePLangStmt CreatePolicyStmt +CreatePublicationStmt CreateRangeStmt CreateReplicationSlotCmd CreateRoleStmt CreateSchemaStmt CreateSchemaStmtContext CreateSeqStmt +CreateStatsStmt CreateStmt CreateStmtContext +CreateSubscriptionStmt CreateTableAsStmt CreateTableSpaceStmt CreateTransformStmt @@ -424,7 +435,7 @@ CtlCommand CtxtHandle CurrentOfExpr CustomExecMethods -CustomOutPtr +CustomOutPtrType CustomPath CustomScan CustomScanMethods @@ -434,8 +445,6 @@ DBState DCHCacheEntry DEADLOCK_INFO DECountItem -DES_cblock -DES_key_schedule DH DIR DNSServiceErrorType @@ -445,6 +454,7 @@ DR_intorel DR_printtup DR_sqlfunction DR_transientrel +DSA DWORD DataDumperPtr DataPageDeleteStack @@ -453,7 +463,7 @@ Datum DatumTupleFields DbInfo DbInfoArr -DeClonePtr +DeClonePtrType DeadLockState DeallocateStmt DeclareCursorStmt @@ -464,6 +474,8 @@ DefElemAction DefaultACLInfo DefineStmt DeleteStmt +DependencyGenerator +DependencyGeneratorData DependencyType DestReceiver DictISpell @@ -473,6 +485,8 @@ DictSnowball DictSubState DictSyn DictThesaurus +DirectoryMethodData +DirectoryMethodFile DisableTimeoutParams DiscardMode DiscardStmt @@ -489,6 +503,7 @@ DropOwnedStmt DropReplicationSlotCmd DropRoleStmt DropStmt +DropSubscriptionStmt DropTableSpaceStmt DropUserMappingStmt DropdbStmt @@ -508,6 +523,8 @@ EOM_get_flat_size_method EPQState EPlan EState +EVP_CIPHER +EVP_CIPHER_CTX EVP_MD EVP_MD_CTX EVP_PKEY @@ -516,15 +533,20 @@ Edge EditableObjectType ElementsState EnableTimeoutParams -EndBlobPtr -EndBlobsPtr -EndDataPtr +EndBlobPtrType +EndBlobsPtrType +EndDataPtrType EndDirectModify_function EndForeignModify_function EndForeignScan_function EndSampleScan_function EnumItem EolType +EphemeralNameRelationType +EphemeralNamedRelation +EphemeralNamedRelationData +EphemeralNamedRelationMetadata +EphemeralNamedRelationMetadataData EquivalenceClass EquivalenceMember ErrorContextCallback @@ -539,6 +561,7 @@ EventTriggerInfo EventTriggerQueryState ExceptionLabelMap ExceptionMap +ExclusiveBackupState ExecAuxRowMark ExecForeignDelete_function ExecForeignInsert_function @@ -572,6 +595,8 @@ ExprContext ExprContextCallbackFunction ExprContext_CB ExprDoneCond +ExprEvalOp +ExprEvalStep ExprState ExprStateEvalFunc ExtensibleNode @@ -588,7 +613,6 @@ FILETIME FSMAddress FSMPage FSMPageData -FState FakeRelCacheEntry FakeRelCacheEntryData FastPathStrongRelationLockData @@ -598,9 +622,7 @@ FetchDirection FetchStmt FieldNot FieldSelect -FieldSelectState FieldStore -FieldStoreState File FileFdwExecutionState FileFdwPlanState @@ -610,6 +632,7 @@ FindSplitData FixedParallelState FixedParamState FlagMode +FlushPosition FmgrBuiltin FmgrHookEventType FmgrInfo @@ -654,15 +677,22 @@ FormData_pg_namespace FormData_pg_opclass FormData_pg_operator FormData_pg_opfamily +FormData_pg_partitioned_table FormData_pg_pltemplate FormData_pg_policy FormData_pg_proc +FormData_pg_publication +FormData_pg_publication_rel FormData_pg_range FormData_pg_replication_origin FormData_pg_rewrite FormData_pg_sequence +FormData_pg_sequence_data FormData_pg_shdepend FormData_pg_statistic +FormData_pg_statistic_ext +FormData_pg_subscription +FormData_pg_subscription_rel FormData_pg_tablespace FormData_pg_transform FormData_pg_trigger @@ -704,15 +734,22 @@ Form_pg_namespace Form_pg_opclass Form_pg_operator Form_pg_opfamily +Form_pg_partitioned_table Form_pg_pltemplate Form_pg_policy Form_pg_proc +Form_pg_publication +Form_pg_publication_rel Form_pg_range Form_pg_replication_origin Form_pg_rewrite Form_pg_sequence +Form_pg_sequence_data Form_pg_shdepend Form_pg_statistic +Form_pg_statistic_ext +Form_pg_subscription +Form_pg_subscription_rel Form_pg_tablespace Form_pg_transform Form_pg_trigger @@ -726,6 +763,13 @@ Form_pg_user_mapping FormatNode FreeBlockNumberArray FreeListData +FreePageBtree +FreePageBtreeHeader +FreePageBtreeInternalKey +FreePageBtreeLeafKey +FreePageBtreeSearchResult +FreePageManager +FreePageSpanLeader FromCharDateMode FromExpr FuncCall @@ -733,9 +777,8 @@ FuncCallContext FuncCandidateList FuncDetailCode FuncExpr -FuncExprState FuncInfo -FuncWithArgs +Function FunctionCallInfo FunctionCallInfoData FunctionParameter @@ -766,13 +809,16 @@ GISTSearchHeapItem GISTSearchItem GISTTYPE GIST_SPLITVEC +GMReaderTupleBuffer GV Gather +GatherMerge +GatherMergePath +GatherMergeState GatherPath GatherState Gene GenericCosts -GenericExprState GenericXLogState GeqoPrivateData GetForeignJoinPaths_function @@ -826,8 +872,8 @@ GroupPath GroupState GroupVarInfo GroupingFunc -GroupingFuncExprState GroupingSet +GroupingSetData GroupingSetKind GroupingSetsPath GucAction @@ -854,6 +900,7 @@ HASHELEMENT HASHHDR HASHSEGMENT HASH_SEQ_STATUS +HCRYPTPROV HE HEntry HIST_ENTRY @@ -874,6 +921,7 @@ HashAllocFunc HashBuildState HashCompareFunc HashCopyFunc +HashIndexStat HashJoin HashJoinState HashJoinTable @@ -883,16 +931,17 @@ HashMetaPage HashMetaPageData HashPageOpaque HashPageOpaqueData +HashPageStat HashPath -HashScanList -HashScanListData HashScanOpaque HashScanOpaqueData +HashScanPosItem HashSkewBucket HashState HashValueFunc HbaLine HbaToken +HeadlineJsonState HeadlineParsedText HeadlineWordEntry HeapScanDesc @@ -905,7 +954,9 @@ HeapUpdateFailureData HistControl HotStandbyState I32 +ICU_Convert_Func INFIX +INT128 INTERFACE_INFO IOFuncSelector IPCompareMethod @@ -914,10 +965,12 @@ IV IdentLine IdentifierLookup IdentifySystemCmd +IfStackElem ImportForeignSchemaStmt ImportForeignSchemaType ImportForeignSchema_function ImportQual +IncludeWal InclusionOpaque IncrementVarSublevelsUp_context Index @@ -948,13 +1001,11 @@ IndexTuple IndexTupleData IndexUniqueCheck IndexVacuumInfo -IndirectBlock IndxInfo InferClause InferenceElem InfoItem InhInfo -InhOption InheritableSocket InitSampleScan_function InitializeDSMForeignScan_function @@ -964,13 +1015,13 @@ InsertStmt Instrumentation Int128AggState Int8TransTypeData -IntArray InternalDefaultACL InternalGrant Interval IntoClause InvalidationChunk InvalidationListHeader +InvertedWalkNextStep IpcMemoryId IpcMemoryKey IpcSemaphoreId @@ -981,12 +1032,11 @@ IspellDict Item ItemId ItemIdData -ItemLength -ItemOffset ItemPointer ItemPointerData IterateDirectModify_function IterateForeignScan_function +IterateJsonStringValuesState JEntry JHashState JOBOBJECTINFOCLASS @@ -1001,12 +1051,16 @@ JoinPath JoinPathExtraData JoinState JoinType +JsObject +JsValue JsonAggState JsonHashEntry +JsonIterateStringValuesAction JsonLexContext JsonParseContext JsonSemAction JsonTokenType +JsonTransformStringValuesAction JsonTypeCategory Jsonb JsonbAggState @@ -1058,9 +1112,9 @@ LWLockHandle LWLockMinimallyPadded LWLockMode LWLockPadded -LWLockTranche LabelProvider LargeObjectDesc +LastAttnumInfo Latch LerpFunc LexDescr @@ -1114,7 +1168,17 @@ LogicalDecodingContext LogicalErrorCallbackState LogicalOutputPluginInit LogicalOutputPluginWriterPrepareWrite +LogicalOutputPluginWriterUpdateProgress LogicalOutputPluginWriterWrite +LogicalRepBeginData +LogicalRepCommitData +LogicalRepCtxStruct +LogicalRepRelId +LogicalRepRelMapEntry +LogicalRepRelation +LogicalRepTupleData +LogicalRepTyp +LogicalRepWorker LogicalRewriteMappingData LogicalTape LogicalTapeSet @@ -1124,8 +1188,10 @@ MEMORY_BASIC_INFORMATION MINIDUMPWRITEDUMP MINIDUMP_TYPE MJEvalResult -MasterEndParallelItemPtr -MasterStartParallelItemPtr +MVDependencies +MVDependency +MVNDistinct +MVNDistinctItem Material MaterialPath MaterialState @@ -1147,7 +1213,6 @@ MergeScanSelCache MinMaxAggInfo MinMaxAggPath MinMaxExpr -MinMaxExprState MinMaxOp MinimalTuple MinimalTupleData @@ -1158,6 +1223,8 @@ ModifyTableState MorphOpaque MsgType MultiAssignRef +MultiSortSupport +MultiSortSupportData MultiXactId MultiXactMember MultiXactOffset @@ -1176,6 +1243,8 @@ NameHashEntry NamedArgExpr NamedLWLockTranche NamedLWLockTrancheRequest +NamedTuplestoreScan +NamedTuplestoreScanState NamespaceInfo NestLoop NestLoopParam @@ -1185,6 +1254,7 @@ NewColumnValue NewConstraint NextSampleBlock_function NextSampleTuple_function +NextValueExpr Node NodeTag NonEmptyRange @@ -1193,18 +1263,19 @@ NotifyStmt Nsrt NullIfExpr NullTest -NullTestState NullTestType Numeric NumericAggState NumericDigit NumericSortSupport +NumericSumAccum NumericVar OM_uint32 OP OSAPerGroupState OSAPerQueryState OSInfo +OSSLCipher OSSLDigest OSVERSIONINFO OVERLAPPED @@ -1220,6 +1291,7 @@ ObjectAddresses ObjectClass ObjectPropertyType ObjectType +ObjectWithArgs Offset OffsetNumber OffsetVarNodes_context @@ -1231,7 +1303,6 @@ OldSnapshotControlData OldToNewMapping OldToNewMappingData OldTriggerInfo -Oldstyle_fnextra OnCommitAction OnCommitItem OnConflictAction @@ -1257,6 +1328,7 @@ OutputPluginOptions OutputPluginOutputType OverrideSearchPath OverrideStackEntry +OverridingKind PACE_HEADER PACL PATH @@ -1282,6 +1354,7 @@ PGLZ_Strategy PGMessageField PGModuleMagicFunction PGNoticeHooks +PGOutputData PGPROC PGP_CFB PGP_Context @@ -1320,6 +1393,7 @@ PLpgSQL_arrayelem PLpgSQL_case_when PLpgSQL_condition PLpgSQL_datum +PLpgSQL_datum_type PLpgSQL_diag_item PLpgSQL_exception PLpgSQL_exception_block @@ -1327,10 +1401,14 @@ PLpgSQL_execstate PLpgSQL_expr PLpgSQL_func_hashkey PLpgSQL_function +PLpgSQL_getdiag_kind PLpgSQL_if_elsif +PLpgSQL_label_type PLpgSQL_nsitem +PLpgSQL_nsitem_type PLpgSQL_plugin PLpgSQL_raise_option +PLpgSQL_raise_option_type PLpgSQL_rec PLpgSQL_recfield PLpgSQL_resolve_option @@ -1360,9 +1438,11 @@ PLpgSQL_stmt_raise PLpgSQL_stmt_return PLpgSQL_stmt_return_next PLpgSQL_stmt_return_query +PLpgSQL_stmt_type PLpgSQL_stmt_while PLpgSQL_trigtype PLpgSQL_type +PLpgSQL_type_type PLpgSQL_var PLpgSQL_variable PLwdatum @@ -1375,6 +1455,7 @@ PLyExecutionContext PLyObToDatum PLyObToDatumFunc PLyObToTuple +PLyObject_AsString_t PLyPlanObject PLyProcedure PLyProcedureEntry @@ -1388,6 +1469,7 @@ PLyTupleToOb PLyTypeInfo PLyTypeInput PLyTypeOutput +PLyUnicode_FromStringAndSize_t PMINIDUMP_CALLBACK_INFORMATION PMINIDUMP_EXCEPTION_INFORMATION PMINIDUMP_USER_STREAM_INFORMATION @@ -1419,8 +1501,10 @@ PSQL_COMP_CASE PSQL_ECHO PSQL_ECHO_HIDDEN PSQL_ERROR_ROLLBACK -PTOKEN_GROUPS +PTEntryArray +PTIterationArray PTOKEN_USER +PUTENVPROC PVOID PX_Alias PX_Cipher @@ -1435,10 +1519,12 @@ PageHeaderData PageXLogRecPtr PagetableEntry Pairs -ParallelArgs +ParallelBitmapHeapState +ParallelCompletionPtr ParallelContext ParallelExecutorInfo ParallelHeapScanDesc +ParallelIndexScanDesc ParallelSlot ParallelState ParallelWorkerInfo @@ -1462,6 +1548,22 @@ ParsedText ParsedWord ParserSetupHook ParserState +PartitionBoundInfo +PartitionBoundInfoData +PartitionBoundSpec +PartitionCmd +PartitionDesc +PartitionDescData +PartitionDispatch +PartitionDispatchData +PartitionElem +PartitionKey +PartitionListValue +PartitionRangeBound +PartitionRangeDatum +PartitionSpec +PartitionedChildRelInfo +PasswordType Path PathClauseUsage PathCostComparison @@ -1476,6 +1578,7 @@ PendingRelDelete PendingUnlinkEntry PendingWriteback PerlInterpreter +Perl_check_t Perl_ppaddr_t Permutation PgBackendSSLStatus @@ -1554,6 +1657,9 @@ Pointer PolicyInfo PolyNumAggState Pool +PopulateArrayContext +PopulateArrayState +PopulateRecordCache PopulateRecordsetState Port Portal @@ -1576,8 +1682,8 @@ PrepareStmt PreparedParamsData PreparedStatement PrewarmType -PrintExtraTocPtr -PrintTocDataPtr +PrintExtraTocPtrType +PrintTocDataPtrType PrintfArgType PrintfArgValue PrintfTarget @@ -1593,16 +1699,24 @@ ProcessUtilityContext ProcessUtility_hook_type ProcessingMode ProgressCommandType +ProjectSet +ProjectSetPath +ProjectSetState ProjectionInfo ProjectionPath ProtocolVersion PrsStorage PruneState PsqlScanCallbacks +PsqlScanQuoteType PsqlScanResult PsqlScanState PsqlScanStateData PsqlSettings +Publication +PublicationActions +PublicationInfo +PublicationRelInfo PullFilter PullFilterOps PushFilter @@ -1625,6 +1739,7 @@ QualCost QualItem Query QueryDesc +QueryEnvironment QueryInfo QueryItem QueryItemType @@ -1639,6 +1754,7 @@ QueuePosition RBNode RBOrderControl RBTree +RBTreeIterator REPARSE_JUNCTION_DATA_BUFFER RIX RI_CompareHashEntry @@ -1646,18 +1762,20 @@ RI_CompareKey RI_ConstraintInfo RI_QueryHashEntry RI_QueryKey -RSA RTEKind RWConflict RWConflictPoolHeader Range RangeBound RangeBox +RangeDatumContent RangeFunction RangeIOData RangeQueryClause RangeRemapInfo RangeSubselect +RangeTableFunc +RangeTableFuncCol RangeTableSample RangeTblEntry RangeTblFunction @@ -1666,11 +1784,12 @@ RangeType RangeVar RangeVarGetRelidCallback RawColumnDefault +RawStmt ReScanForeignScan_function -ReadBufPtr +ReadBufPtrType ReadBufferMode -ReadBytePtr -ReadExtraTocPtr +ReadBytePtrType +ReadExtraTocPtrType ReadFunc ReassignOwnedStmt RecheckForeignScan_function @@ -1709,14 +1828,18 @@ RelabelType Relation RelationData RelationPtr +RelationSyncEntry RelativeTime RelcacheCallbackFunction RelfilenodeMapEntry RelfilenodeMapKey Relids RelocationBufferInfo +RelptrFreePageBtree +RelptrFreePageManager +RelptrFreePageSpanLeader RenameStmt -ReopenPtr +ReopenPtrType ReorderBuffer ReorderBufferApplyChangeCB ReorderBufferBeginCB @@ -1773,11 +1896,10 @@ RmgrIds RoleSpec RoleSpecType RoleStmtType +RollupData RowCompareExpr -RowCompareExprState RowCompareType RowExpr -RowExprState RowMarkClause RowMarkType RowSecurityDesc @@ -1798,9 +1920,7 @@ SERVICE_STATUS SERVICE_STATUS_HANDLE SERVICE_TABLE_ENTRY SHA1_CTX -SHA224_CTX SHA256_CTX -SHA384_CTX SHA512_CTX SHM_QUEUE SID_AND_ATTRIBUTES @@ -1818,10 +1938,13 @@ SPLITCOST SPNode SPNodeData SPPageDesc +SQLCmd SQLDropObject SQLFunctionCache SQLFunctionCachePtr SQLFunctionParseInfoPtr +SQLValueFunction +SQLValueFunctionOp SSL SSLExtensionInfoContext SSL_CTX @@ -1833,7 +1956,7 @@ SampleScanGetSampleSize_function SampleScanState SamplerRandomState ScalarArrayOpExpr -ScalarArrayOpExprState +ScalarIOData ScalarItem ScalarMCVItem Scan @@ -1849,6 +1972,7 @@ SecBuffer SecBufferDesc SecLabelItem SecLabelStmt +SeenRelsEntry SelectStmt Selectivity SemiAntiJoinFactors @@ -1859,22 +1983,23 @@ SeqTableData SerCommitSeqNo SerializedSnapshotData Session +SessionBackupState SetConstraintState SetConstraintStateData SetConstraintTriggerData +SetExprState SetFunctionReturnMode SetOp SetOpCmd -SetOpHashEntry SetOpPath SetOpState SetOpStatePerGroup -SetOpStatePerGroupData SetOpStrategy SetOperation SetOperationStmt SetToDefault -SetupWorkerPtr +SetupWorkerPtrType +SharedBitmapState SharedDependencyObjectType SharedDependencyType SharedExecutorInstrumentation @@ -1889,6 +2014,7 @@ ShellTypeInfo ShippableCacheEntry ShippableCacheKey ShmemIndexEnt +ShutdownForeignScan_function ShutdownInformation ShutdownMode SignTSVector @@ -1902,6 +2028,11 @@ SimpleStringList SimpleStringListCell SingleBoundSortItem Size +SlabBlock +SlabChunk +SlabContext +SlabSlot +SlotErrCallbackArg SlotNumber SlruCtl SlruCtlData @@ -1924,6 +2055,7 @@ SortBy SortByDir SortByNulls SortGroupClause +SortItem SortPath SortShimExtra SortState @@ -1958,18 +2090,20 @@ SplitLR SplitVar SplitedPageLayout StackElem -StandardChunkHeader -StartBlobPtr -StartBlobsPtr -StartDataPtr +StartBlobPtrType +StartBlobsPtrType +StartDataPtrType StartReplicationCmd StartupPacket StartupStatusEnum StatEntry +StatExtEntry StatMsgType StateFileChunk +StatisticExtInfo Stats StatsData +StatsExtInfo StdAnalyzeData StdRdOptions Step @@ -1990,6 +2124,9 @@ SubXactEvent SubqueryScan SubqueryScanPath SubqueryScanState +Subscription +SubscriptionInfo +SubscriptionRelState Syn SyncRepConfigData SysScanDesc @@ -1999,7 +2136,10 @@ SystemSamplerData SystemTimeSamplerData TAR_MEMBER TBMIterateResult +TBMIteratingState TBMIterator +TBMSharedIterator +TBMSharedIteratorState TBMStatus TBlockState TIDBitmap @@ -2020,6 +2160,7 @@ TSConfigCacheEntry TSConfigInfo TSDictInfo TSDictionaryCacheEntry +TSExecuteCallback TSLexeme TSParserCacheEntry TSParserInfo @@ -2031,6 +2172,7 @@ TSReadPointer TSTemplateInfo TSTokenTypeStorage TSVector +TSVectorBuildState TSVectorData TSVectorParseState TSVectorStat @@ -2040,8 +2182,13 @@ TTOffList TYPCATEGORY T_Action T_WorkerStatus +TabStatHashEntry TabStatusArray TableDataInfo +TableFunc +TableFuncRoutine +TableFuncScan +TableFuncScanState TableInfo TableLikeClause TableSampleClause @@ -2049,6 +2196,9 @@ TableSpaceCacheEntry TableSpaceOpts TablespaceList TablespaceListCell +TapeBlockTrailer +TarMethodData +TarMethodFile TargetEntry TclExceptionNameMap Tcl_DString @@ -2065,6 +2215,7 @@ TextFreq TextPositionState TheLexeme TheSubstitute +TidExpr TidHashKey TidPath TidScan @@ -2087,6 +2238,7 @@ TmFromChar TmToChar TocEntry TokenAuxData +TokenizedLine TrackItem TransInvalidationInfo TransState @@ -2096,6 +2248,7 @@ TransactionStateData TransactionStmt TransactionStmtKind TransformInfo +TransformJsonStringValuesState TrgmArc TrgmArcInfo TrgmColor @@ -2115,6 +2268,7 @@ TriggerDesc TriggerEvent TriggerFlags TriggerInfo +TriggerTransition TruncateStmt TsmRoutine TupOutputState @@ -2150,16 +2304,24 @@ Type TypeCacheEntry TypeCacheEnumData TypeCast +TypeCat TypeFuncClass TypeInfo TypeName U32 U8 +UChar +UCharIterator +UCollator +UConverter +UEnumeration +UErrorCode UINT ULARGE_INTEGER ULONG ULONG_PTR UV +UVersionInfo Unique UniquePath UniquePathMethod @@ -2195,6 +2357,7 @@ VariableSetStmt VariableShowStmt VariableSpace VariableStatData +VariableSubstituteHook Vfd ViewCheckOption ViewOptions @@ -2207,6 +2370,7 @@ WALInsertLock WALInsertLockPadded WCHAR WCOKind +WFW_WaitOption WIDGET WIN32_FILE_ATTRIBUTE_DATA WORD @@ -2216,15 +2380,28 @@ WSADATA WSANETWORKEVENTS WSAPROTOCOL_INFO WaitEvent +WaitEventActivity +WaitEventClient +WaitEventIO +WaitEventIPC WaitEventSet +WaitEventTimeout +WalCloseMethod WalLevel WalRcvData +WalRcvExecResult +WalRcvExecStatus WalRcvState +WalRcvStreamOptions +WalReceiverConn +WalReceiverFunctionsType WalSnd WalSndCtlData WalSndSendDataCallback WalSndState -WholeRowVarExprState +WalTimeSample +WalWriteMethod +Walfile WindowAgg WindowAggPath WindowAggState @@ -2250,13 +2427,13 @@ WorkTableScanState WorkerInfo WorkerInfoData WorkerInstrumentation -WorkerJobDumpPtr -WorkerJobRestorePtr +WorkerJobDumpPtrType +WorkerJobRestorePtrType Working_State -WriteBufPtr -WriteBytePtr -WriteDataPtr -WriteExtraTocPtr +WriteBufPtrType +WriteBytePtrType +WriteDataPtrType +WriteExtraTocPtrType WriteFunc WritebackContext X509 @@ -2298,9 +2475,9 @@ XactLockTableWaitInfo XidStatus XmlExpr XmlExprOp -XmlExprState XmlOptionType XmlSerialize +XmlTableBuilderData YYLTYPE YYSTYPE YY_BUFFER_STATE @@ -2325,11 +2502,14 @@ ambulkdelete_function amcanreturn_function amcostestimate_function amendscan_function +amestimateparallelscan_function amgetbitmap_function amgettuple_function +aminitparallelscan_function aminsert_function ammarkpos_function amoptions_function +amparallelrescan_function amproperty_function amrescan_function amrestrpos_function @@ -2358,7 +2538,6 @@ brin_column_state bytea cached_re_str cashKEY -celt cfp check_agg_arguments_context check_function_callback @@ -2375,9 +2554,11 @@ codes_t coercion collation_cache_entry color +colormaprange config_var_value contain_aggs_of_level_context convert_testexpr_context +copy_data_source_cb core_YYSTYPE core_yy_extra_type core_yyscan_t @@ -2406,6 +2587,15 @@ dlist_iter dlist_mutable_iter dlist_node ds_state +dsa_area +dsa_area_control +dsa_area_pool +dsa_area_span +dsa_handle +dsa_pointer +dsa_segment_header +dsa_segment_index +dsa_segment_map dsm_control_header dsm_control_item dsm_handle @@ -2427,6 +2617,8 @@ execution_state explain_get_index_name_hook_type f_smgr fd_set +fe_scram_state +fe_scram_state_enum file_action_t file_entry_t file_type_t @@ -2451,7 +2643,6 @@ foreign_loc_cxt freeaddrinfo_ptr_t freefunc fsec_t -func_ptr gbt_vsrt_arg gbtree_ninfo gbtree_vinfo @@ -2483,21 +2674,28 @@ ginxlogVacuumDataLeafPage gistxlogPage gistxlogPageSplit gistxlogPageUpdate +grouping_sets_data gseg_picksplit_item gss_OID +gss_OID_desc gss_buffer_desc gss_cred_id_t gss_ctx_id_t gss_name_t gtrgm_consistent_cache gzFile -has_parallel_hazard_arg hashfunc hbaPort heap_page_items_state help_handler hlCheck +hstoreCheckKeyLen_t +hstoreCheckValLen_t +hstorePairs_t +hstoreUniquePairs_t +hstoreUpgrade_t hyperLogLogState +ifState import_error_callback_arg indexed_tlist inet @@ -2535,6 +2733,7 @@ lclContext lclTocEntry leafSegmentInfo line_t +lineno_t locale_t locate_agg_of_level_context locate_var_of_level_context @@ -2548,9 +2747,13 @@ ltree_gist ltree_level ltxtquery mXactCacheEnt +mac8KEY macKEY macaddr +macaddr8 +macaddr_sortsupport_state map_variable_attnos_context +max_parallel_hazard_context mb2wchar_with_len_converter mbcharacter_incrementer mbdisplaylen_converter @@ -2582,19 +2785,22 @@ oidKEY oidvector on_dsm_detach_callback on_exit_nicely_callback -ossldata +ossl_EVP_cipher_func output_type +pagetable_hash +pagetable_iterator pairingheap pairingheap_comparator pairingheap_node parallel_worker_main_type parse_error_callback_arg -pcolor pendingPosition pgParameterStatus pg_atomic_flag pg_atomic_uint32 pg_atomic_uint64 +pg_conn_host +pg_conn_host_type pg_conv_map pg_crc32 pg_crc32c @@ -2605,17 +2811,22 @@ pg_enc2name pg_encname pg_gssinfo pg_int64 -pg_local_to_utf pg_local_to_utf_combined pg_locale_t +pg_mb_radix_tree pg_on_exit_callback pg_re_flags +pg_saslprep_rc +pg_sha224_ctx +pg_sha256_ctx +pg_sha384_ctx +pg_sha512_ctx pg_stack_base_t pg_time_t pg_tz pg_tz_cache pg_tzenum -pg_utf_to_local +pg_unicode_decomposition pg_utf_to_local_combined pg_uuid_t pg_wc_probefunc @@ -2648,6 +2859,7 @@ plperl_query_entry plpgsql_CastHashEntry plpgsql_CastHashKey plpgsql_HashEnt +pltcl_call_state pltcl_interp_desc pltcl_proc_desc pltcl_proc_key @@ -2668,12 +2880,16 @@ printTextRule priv_map process_file_callback_t process_sublinks_context +proclist_head +proclist_mutable_iter +proclist_node promptStatus_t pthread_attr_t pthread_key_t pthread_mutex_t pthread_once_t pthread_t +ptrdiff_t pull_var_clause_context pull_varattnos_context pull_varnos_context @@ -2720,7 +2936,10 @@ rm_detail_t role_auth_extra row_security_policy_hook_type save_buffer -security_barrier_replace_vars_context +scram_HMAC_ctx +scram_state +scram_state_enum +sem_t sequence_magic set_join_pathlist_hook_type set_rel_pathlist_hook_type @@ -2766,6 +2985,7 @@ spgxlogState spgxlogVacuumLeaf spgxlogVacuumRedirect spgxlogVacuumRoot +split_pathtarget_context sql_error_callback_arg sqlparseInfo sqlparseState @@ -2807,6 +3027,8 @@ tsKEY ts_db_fctx ts_tokentype tsearch_readline_state +tuplehash_hash +tuplehash_iterator txid tzEntry u1byte @@ -2832,6 +3054,7 @@ unicode_linestyle unit_conversion unlogged_relation_entry utf_local_conversion_func +uuidKEY uuid_rc_t uuid_sortsupport_state uuid_t @@ -2844,15 +3067,18 @@ varattrib_1b varattrib_1b_e varattrib_4b vbits -walrcv_connect_type -walrcv_disconnect_type -walrcv_endstreaming_type -walrcv_get_conninfo_type -walrcv_identify_system_type -walrcv_readtimelinehistoryfile_type -walrcv_receive_type -walrcv_send_type -walrcv_startstreaming_type +walrcv_check_conninfo_fn +walrcv_connect_fn +walrcv_create_slot_fn +walrcv_disconnect_fn +walrcv_endstreaming_fn +walrcv_exec_fn +walrcv_get_conninfo_fn +walrcv_identify_system_fn +walrcv_readtimelinehistoryfile_fn +walrcv_receive_fn +walrcv_send_fn +walrcv_startstreaming_fn wchar2mb_with_len_converter wchar_t win32_deadchild_waitinfo @@ -2861,6 +3087,7 @@ wint_t worker_state worktable xl_brin_createidx +xl_brin_desummarize xl_brin_insert xl_brin_revmap_extend xl_brin_samepage_update @@ -2874,10 +3101,23 @@ xl_btree_reuse_page xl_btree_split xl_btree_unlink_page xl_btree_vacuum +xl_clog_truncate xl_commit_ts_set +xl_commit_ts_truncate xl_dbase_create_rec xl_dbase_drop_rec xl_end_of_recovery +xl_hash_add_ovfl_page +xl_hash_delete +xl_hash_init_bitmap_page +xl_hash_init_meta_page +xl_hash_insert +xl_hash_move_page_contents +xl_hash_split_allocate_page +xl_hash_split_complete +xl_hash_squeeze_page +xl_hash_update_meta_page +xl_hash_vacuum_one_page xl_heap_clean xl_heap_cleanup_info xl_heap_confirm diff --git a/src/tools/testint128.c b/src/tools/testint128.c new file mode 100644 index 0000000000..b6c8a0a4ef --- /dev/null +++ b/src/tools/testint128.c @@ -0,0 +1,183 @@ +/*------------------------------------------------------------------------- + * + * testint128.c + * Testbed for roll-our-own 128-bit integer arithmetic. + * + * This is a standalone test program that compares the behavior of an + * implementation in int128.h to an (assumed correct) int128 native type. + * + * Copyright (c) 2017, PostgreSQL Global Development Group + * + * + * IDENTIFICATION + * src/tools/testint128.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres_fe.h" + +/* + * By default, we test the non-native implementation in int128.h; but + * by predefining USE_NATIVE_INT128 to 1, you can test the native + * implementation, just to be sure. + */ +#ifndef USE_NATIVE_INT128 +#define USE_NATIVE_INT128 0 +#endif + +#include "common/int128.h" + +/* + * We assume the parts of this union are laid out compatibly. + */ +typedef union +{ + int128 i128; + INT128 I128; + union + { +#ifdef WORDS_BIGENDIAN + int64 hi; + uint64 lo; +#else + uint64 lo; + int64 hi; +#endif + } hl; +} test128; + + +/* + * Control version of comparator. + */ +static inline int +my_int128_compare(int128 x, int128 y) +{ + if (x < y) + return -1; + if (x > y) + return 1; + return 0; +} + +/* + * Get a random uint64 value. + * We don't assume random() is good for more than 16 bits. + */ +static uint64 +get_random_uint64(void) +{ + uint64 x; + + x = (uint64) (random() & 0xFFFF) << 48; + x |= (uint64) (random() & 0xFFFF) << 32; + x |= (uint64) (random() & 0xFFFF) << 16; + x |= (uint64) (random() & 0xFFFF); + return x; +} + +/* + * Main program. + * + * Generates a lot of random numbers and tests the implementation for each. + * The results should be reproducible, since we don't call srandom(). + * + * You can give a loop count if you don't like the default 1B iterations. + */ +int +main(int argc, char **argv) +{ + long count; + + if (argc >= 2) + count = strtol(argv[1], NULL, 0); + else + count = 1000000000; + + while (count-- > 0) + { + int64 x = get_random_uint64(); + int64 y = get_random_uint64(); + int64 z = get_random_uint64(); + test128 t1; + test128 t2; + + /* check unsigned addition */ + t1.hl.hi = x; + t1.hl.lo = y; + t2 = t1; + t1.i128 += (int128) (uint64) z; + int128_add_uint64(&t2.I128, (uint64) z); + + if (t1.hl.hi != t2.hl.hi || t1.hl.lo != t2.hl.lo) + { + printf("%016lX%016lX + unsigned %lX\n", x, y, z); + printf("native = %016lX%016lX\n", t1.hl.hi, t1.hl.lo); + printf("result = %016lX%016lX\n", t2.hl.hi, t2.hl.lo); + return 1; + } + + /* check signed addition */ + t1.hl.hi = x; + t1.hl.lo = y; + t2 = t1; + t1.i128 += (int128) z; + int128_add_int64(&t2.I128, z); + + if (t1.hl.hi != t2.hl.hi || t1.hl.lo != t2.hl.lo) + { + printf("%016lX%016lX + signed %lX\n", x, y, z); + printf("native = %016lX%016lX\n", t1.hl.hi, t1.hl.lo); + printf("result = %016lX%016lX\n", t2.hl.hi, t2.hl.lo); + return 1; + } + + /* check multiplication */ + t1.i128 = (int128) x *(int128) y; + + t2.hl.hi = t2.hl.lo = 0; + int128_add_int64_mul_int64(&t2.I128, x, y); + + if (t1.hl.hi != t2.hl.hi || t1.hl.lo != t2.hl.lo) + { + printf("%lX * %lX\n", x, y); + printf("native = %016lX%016lX\n", t1.hl.hi, t1.hl.lo); + printf("result = %016lX%016lX\n", t2.hl.hi, t2.hl.lo); + return 1; + } + + /* check comparison */ + t1.hl.hi = x; + t1.hl.lo = y; + t2.hl.hi = z; + t2.hl.lo = get_random_uint64(); + + if (my_int128_compare(t1.i128, t2.i128) != + int128_compare(t1.I128, t2.I128)) + { + printf("comparison failure: %d vs %d\n", + my_int128_compare(t1.i128, t2.i128), + int128_compare(t1.I128, t2.I128)); + printf("arg1 = %016lX%016lX\n", t1.hl.hi, t1.hl.lo); + printf("arg2 = %016lX%016lX\n", t2.hl.hi, t2.hl.lo); + return 1; + } + + /* check case with identical hi parts; above will hardly ever hit it */ + t2.hl.hi = x; + + if (my_int128_compare(t1.i128, t2.i128) != + int128_compare(t1.I128, t2.I128)) + { + printf("comparison failure: %d vs %d\n", + my_int128_compare(t1.i128, t2.i128), + int128_compare(t1.I128, t2.I128)); + printf("arg1 = %016lX%016lX\n", t1.hl.hi, t1.hl.lo); + printf("arg2 = %016lX%016lX\n", t2.hl.hi, t2.hl.lo); + return 1; + } + } + + return 0; +} diff --git a/src/tools/version_stamp.pl b/src/tools/version_stamp.pl index cc685453dd..f973dd950c 100755 --- a/src/tools/version_stamp.pl +++ b/src/tools/version_stamp.pl @@ -3,7 +3,7 @@ ################################################################# # version_stamp.pl -- update version stamps throughout the source tree # -# Copyright (c) 2008-2016, PostgreSQL Global Development Group +# Copyright (c) 2008-2017, PostgreSQL Global Development Group # # src/tools/version_stamp.pl ################################################################# @@ -20,15 +20,18 @@ # "devel", "alphaN", "betaN", "rcN". # +use strict; + # Major version is hard-wired into the script. We update it when we branch # a new development version. -$major1 = 9; -$major2 = 6; +my $majorversion = 10; # Validate argument and compute derived variables -$minor = shift; +my $minor = shift; defined($minor) || die "$0: missing required argument: minor-version\n"; +my ($dotneeded, $numericminor); + if ($minor =~ m/^\d+$/) { $dotneeded = 1; @@ -59,8 +62,9 @@ else die "$0: minor-version must be N, devel, alphaN, betaN, or rcN\n"; } +my $fullversion; + # Create various required forms of the version number -$majorversion = $major1 . "." . $major2; if ($dotneeded) { $fullversion = $majorversion . "." . $minor; @@ -69,15 +73,15 @@ else { $fullversion = $majorversion . $minor; } -$numericversion = $majorversion . "." . $numericminor; -$padnumericversion = sprintf("%d%02d%02d", $major1, $major2, $numericminor); +my $numericversion = $majorversion . "." . $numericminor; +my $padnumericversion = sprintf("%d%04d", $majorversion, $numericminor); # Get the autoconf version number for eventual nag message # (this also ensures we're in the right directory) -$aconfver = ""; -open(FILE, "configure.in") || die "could not read configure.in: $!\n"; -while (<FILE>) +my $aconfver = ""; +open(my $fh, '<', "configure.in") || die "could not read configure.in: $!\n"; +while (<$fh>) { if ( m/^m4_if\(m4_defn\(\[m4_PACKAGE_VERSION\]\), \[(.*)\], \[\], \[m4_fatal/) @@ -86,13 +90,13 @@ m/^m4_if\(m4_defn\(\[m4_PACKAGE_VERSION\]\), \[(.*)\], \[\], \[m4_fatal/) last; } } -close(FILE); +close($fh); $aconfver ne "" || die "could not find autoconf version number in configure.in\n"; # Update configure.in and other files that contain version numbers -$fixedfiles = ""; +my $fixedfiles = ""; sed_file("configure.in", "-e 's/AC_INIT(\\[PostgreSQL\\], \\[[0-9a-z.]*\\]/AC_INIT([PostgreSQL], [$fullversion]/'" @@ -110,15 +114,15 @@ sed_file("src/include/pg_config.h.win32", ); sed_file("src/interfaces/libpq/libpq.rc.in", -"-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $major1,$major2,$numericminor,0/' " - . "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $major1,$major2,$numericminor,0/' " +"-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $majorversion,0,$numericminor,0/' " + . "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $majorversion,0,$numericminor,0/' " . "-e 's/VALUE \"FileVersion\", \"[0-9.]*/VALUE \"FileVersion\", \"$numericversion/' " . "-e 's/VALUE \"ProductVersion\", \"[0-9.]*/VALUE \"ProductVersion\", \"$numericversion/'" ); sed_file("src/port/win32ver.rc", -"-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $major1,$major2,$numericminor,0/' " - . "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $major1,$major2,$numericminor,0/'" +"-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $majorversion,0,$numericminor,0/' " + . "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $majorversion,0,$numericminor,0/'" ); print "Stamped these files with version number $fullversion:\n$fixedfiles"; diff --git a/src/tools/win32tzlist.pl b/src/tools/win32tzlist.pl index 3976205446..0bdcc3610f 100755 --- a/src/tools/win32tzlist.pl +++ b/src/tools/win32tzlist.pl @@ -2,7 +2,7 @@ # # win32tzlist.pl -- compare Windows timezone information # -# Copyright (c) 2008-2016, PostgreSQL Global Development Group +# Copyright (c) 2008-2017, PostgreSQL Global Development Group # # src/tools/win32tzlist.pl ################################################################# @@ -58,11 +58,11 @@ $basekey->Close(); # Fetch all timezones currently in the file # my @file_zones; -open(TZFILE, "<$tzfile") or die "Could not open $tzfile!\n"; +open(my $tzfh, '<', $tzfile) or die "Could not open $tzfile!\n"; my $t = $/; undef $/; -my $pgtz = <TZFILE>; -close(TZFILE); +my $pgtz = <$tzfh>; +close($tzfh); $/ = $t; # Attempt to locate and extract the complete win32_tzmap struct |