summaryrefslogtreecommitdiff
path: root/src/tools/pginclude
Commit message (Collapse)AuthorAgeFilesLines
* pg_dump: Add support for zstd compressionTomas Vondra2023-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Allow pg_dump to use the zstd compression, in addition to gzip/lz4. Bulk of the new compression method is implemented in compress_zstd.{c,h}, covering the pg_dump compression APIs. The rest of the patch adds test and makes various places aware of the new compression method. The zstd library (which this patch relies on) supports multithreaded compression since version 1.5. We however disallow that feature for now, as it might interfere with parallel backups on platforms that rely on threads (e.g. Windows). This can be improved / relaxed in the future. This also fixes a minor issue in InitDiscoverCompressFileHandle(), which was not updated to check if the file already has the .lz4 extension. Adding zstd compression was originally proposed in 2020 (see the second thread), but then was reworked to use the new compression API introduced in e9960732a9. I've considered both threads when compiling the list of reviewers. Author: Justin Pryzby Reviewed-by: Tomas Vondra, Jacob Champion, Andreas Karlsson Discussion: https://postgr.es/m/20230224191840.GD1653@telsasoft.com Discussion: https://postgr.es/m/20201221194924.GI30237@telsasoft.com
* Tighten header pre-inclusions in headerscheck and cpluspluscheck.Tom Lane2023-03-042-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | We allow our header files to depend on the appropriate one of postgres.h, postgres_fe.h, or c.h having already been included. However, there are a few headers such as libpq-fe.h that are meant to be used by client applications and therefore must compile without any assumptions about previous inclusions. These test scripts failed to consider that, which seems quite hazardous since we might not immediately notice such a problem otherwise. Hence, adjust these scripts to test relevant libpq and ecpg headers with no prior inclusion. While at it, we can also make an effort to actually use the relevant one of postgres.h, postgres_fe.h, or c.h. I added some rules that guess which one to use based on the first-level src subdirectory, e.g. use postgres_fe.h under src/bin/. These rules are hardly water-tight but they seem to work today, and we can always refine them in the future. These changes don't reveal any live problems today, which is good, but they should make these scripts more able to catch future bugs. Discussion: https://postgr.es/m/2488193.1677863247@sss.pgh.pa.us
* Add LZ4 compression to pg_dumpTomas Vondra2023-02-231-0/+1
| | | | | | | | | | | | Expand pg_dump's compression streaming and file APIs to support the lz4 algorithm. The newly added compress_lz4.{c,h} files cover all the functionality of the aforementioned APIs. Minor changes were necessary in various pg_backup_* files, where code for the 'lz4' file suffix has been added, as well as pg_dump's compression option parsing. Author: Georgios Kokolatos Reviewed-by: Michael Paquier, Rachel Heaton, Justin Pryzby, Shi Yu, Tomas Vondra Discussion: https://postgr.es/m/faUNEOpts9vunEaLnmxmG-DldLSg_ql137OC3JYDmgrOMHm1RvvWY2IdBkv_CRxm5spCCb_OmKNk2T03TMm0fBEWveFF9wA1WizPuAgB7Ss%3D%40protonmail.com
* Introduce a generic pg_dump compression APITomas Vondra2023-02-231-0/+2
| | | | | | | | | | | | | | | | | Switch pg_dump to use the Compression API, implemented by bf9aa490db. The CompressFileHandle replaces the cfp* family of functions with a struct of callbacks for accessing (compressed) files. This allows adding new compression methods simply by introducing a new struct instance with appropriate implementation of the callbacks. Archives compressed using custom compression methods store an identifier of the compression algorithm in their header instead of the compression level. The header version is bumped. Author: Georgios Kokolatos Reviewed-by: Michael Paquier, Rachel Heaton, Justin Pryzby, Tomas Vondra Discussion: https://postgr.es/m/faUNEOpts9vunEaLnmxmG-DldLSg_ql137OC3JYDmgrOMHm1RvvWY2IdBkv_CRxm5spCCb_OmKNk2T03TMm0fBEWveFF9wA1WizPuAgB7Ss%3D%40protonmail.com
* Update copyright for 2023Bruce Momjian2023-01-023-3/+3
| | | | Backpatch-through: 11
* Fix `trap` in a few shell scriptsAlvaro Herrera2022-09-202-4/+4
| | | | | | | | | | | | The original `trap` lines in these scripts are incomplete: in case of any signal, they delete the working directory but let the script run to completion, which is useless because it will only proceed to complain about the working directory being removed. Add `exit` there, with the original exit value (not rm's). Since this is mostly just cosmetic, no backpatch. Discussion: https://postgr.es/m/20220913181002.hzsosy7qkemb7ky7@alvherre.pgsql
* Fix failure to build gramparse.h standalone in vpath buildsJohn Naylor2022-09-142-0/+4
| | | | | | Add include directory in a similar fashion as 829906fb6c. Per buildfarm animal crake
* Move gramparse.h to src/backend/parserJohn Naylor2022-09-142-2/+0
| | | | | | | | | | | | | This header is semi-private, being used only in files related to raw parsing, so move to the backend directory where those files live. This allows removal of Makefile rules that symlink gram.h to src/include/parser, since gramparse.h can now include gram.h from within the same directory. This has the side-effect of no longer installing gram.h and gramparse.h, but there doesn't seem to be a good reason to continue doing so. Per suggestion from Andres Freund and Peter Eisentraut Discussion: https://www.postgresql.org/message-id/20220904181759.px6uosll6zbxcum5%40awork3.anarazel.de
* Adjust header exceptions for 0bd9c6297John Naylor2022-09-132-2/+2
| | | | Per buildfarm animal crake
* Fix cplusplusscheck in vpath buildsJohn Naylor2022-09-061-0/+2
| | | | Same solution as 829906fb6.
* Fix headerscheck in vpath buildsJohn Naylor2022-09-061-0/+2
| | | | | | | Oversight in dac048f71e per buildfarm animal crake. Fix per suggestion from Andrew Dunstan. Discussion: https://www.postgresql.org/message-id/e3f4a3d0-dfcc-41cc-1ed2-acc15700ddef%40dunslane.net
* Add missing exceptions to cpluspluscheckJohn Naylor2022-09-061-0/+8
| | | | | | | | dac048f71 added exceptions to headerscheck but failed to do the same for cpluspluscheck Per report from Andres Freund regarding CI Discussion:https://www.postgresql.org/message-id/20220904205743.y3ntq6ij3aibmxvy%40awork3.anarazel.de
* Build all Flex files standaloneJohn Naylor2022-09-041-0/+8
| | | | | | | | | | | | | The proposed Meson build system will need a way to ignore certain generated files in order to coexist with the autoconf build system, and C files generated by Flex which are #include'd into .y files make this more difficult. In similar vein to 72b1e3a21, arrange for all Flex C files to compile to their own .o targets. Reviewed by Andres Freund Discussion: https://www.postgresql.org/message-id/20220810171935.7k5zgnjwqzalzmtm%40awork3.anarazel.de Discussion: https://www.postgresql.org/message-id/CAFBsxsF8Gc2StS3haXofshHCzqNMRXiSxvQEYGwnFsTmsdwNeg@mail.gmail.com
* Fix headerscheck and cpluspluscheck's exit codes.Thomas Munro2022-08-162-4/+16
| | | | | | | | | | For the benefit of CI, which started running these header check scripts in its CompilerWarnings task in commit 81b9f23c9c8, they should report failure if any individual header failed to compile. Reviewed-by: Andrew Dunstan <andrew@dunslane.net> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA%2BhUKGKtDwPo9wzKgbStDwfOhEpywMc6PQofio8fAHR7yUjgxw%40mail.gmail.com
* Add new win32 header to headerscheck and cpluspluscheckThomas Munro2022-08-142-0/+2
| | | | | | Commit 5579388d added src/include/port/win32/netdb.h but forgot to filter it out in the header checking scripts. Per build farm animal crake.
* Remove configure probe for sys/resource.h and refactor.Thomas Munro2022-08-142-8/+1
| | | | | | | | | | | | <sys/resource.h> is in SUSv2 and is on all targeted Unix systems. We have a replacement for getrusage() on Windows, so let's just move its declarations into src/include/port/win32/sys/resource.h so that we can use a standard-looking #include. Also remove an obsolete reference to CLK_TCK. Also rename src/port/getrusage.c to win32getrusage.c, following the convention for Windows-only fallback code. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* Exclude nodetags.h from headerscheck and cpluspluscheck.Tom Lane2022-07-092-0/+8
| | | | | Since this file contains just a fragment of an enum declaration, it can't be compiled on its own.
* Remove HP/Intel Itanium support.Thomas Munro2022-07-082-2/+0
| | | | | | | | | | | | | This CPU architecture has been discontinued. We already removed HP-UX support, we never supported Windows/Itanium, and the open source operating systems that a vintage hardware owner might hope to run have all either ended Itanium support or never fully released support (NetBSD may eventually). The extra code we carry for this rare ISA is now untested. It seems like a good time to remove it. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/1415825.1656893299%40sss.pgh.pa.us
* Remove HP-UX port.Thomas Munro2022-07-082-2/+0
| | | | | | | | | | | | | | | | | HP-UX hardware is no longer produced, build farm coverage recently ended, and there are no known active maintainers targeting this OS. Since there is a major rewrite of the build system in the pipeline for PostgreSQL 16, and that requires development, testing and maintainance for each OS and tool chain, it seems like a good time to drop support for: * HP-UX, the operating system. * HP aCC, the HP-UX native compiler. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/1415825.1656893299%40sss.pgh.pa.us
* Add missing include guard to win32ntdll.h.Thomas Munro2022-01-122-0/+2
| | | | | | | | | Oversight in commit e2f0f8ed. Also add this file to the exclusion lists in headerscheck and cpluscpluscheck, because Unix systems don't have a header it includes. Reported-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/2760528.1641929756%40sss.pgh.pa.us
* Update copyright for 2022Bruce Momjian2022-01-073-3/+3
| | | | Backpatch-through: 10
* Add exception for unicode_east_asian_fw_table.h to headerscheck alsoJohn Naylor2021-09-231-0/+1
| | | | Followup to a315b19cc
* Add exception for unicode_east_asian_fw_table.h to cpluspluscheckJohn Naylor2021-09-231-0/+1
| | | | | | | | | unicode_east_asian_fw_table.h should not be compiled standalone, similarly to unicode_combining_table.h, but cpluspluscheck did not get the memo. Oversight in bab982161. Per report from Tom Lane
* Remove extraneous newlines added by perl copyright patchAndrew Dunstan2021-05-071-1/+0
|
* Add a copyright notice to perl files lacking one.Andrew Dunstan2021-05-071-0/+3
|
* Replace remaining uses of "whitelist".Thomas Munro2021-01-051-2/+2
| | | | | | | | Instead describe the action that the list effects, or just use "list" where the meaning is obvious from context. Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Discussion: https://postgr.es/m/20200615182235.x7lch5n6kcjq4aue%40alap3.anarazel.de
* Update copyright for 2021Bruce Momjian2021-01-022-2/+2
| | | | Backpatch-through: 9.5
* Use perl warnings pragma consistentlyAndrew Dunstan2020-04-131-1/+2
| | | | | | | | | | We've had a mixture of the warnings pragma, the -w switch on the shebang line, and no warnings at all. This patch removes the -w swicth and add the warnings pragma to all perl sources missing it. It raises the severity of the TestingAndDebugging::RequireUseWarnings perlcritic policy to level 5, so that we catch any future violations. Discussion: https://postgr.es/m/20200412074245.GB623763@rfd.leadboat.com
* Fix up recent breakage of headerscheck and cpluspluscheck.Tom Lane2020-03-212-0/+2
| | | | | | | | | | | | | | | | headerscheck and cpluspluscheck should skip the recently-added cmdtaglist.h header, since (like kwlist.h and some other similarly- designed headers) it's not meant to be included standalone. evtcache.h was missing an #include to support its usage of Bitmapset. typecmds.h was missing an #include to support its usage of ParseState. The first two of these were evidently oversights in commit 2f9661311. I didn't track down exactly which change broke typecmds.h, but it must have been some rearrangement in one of its existing inclusions, because it's referenced ParseState for quite a long time and there were not complaints from these checking programs before.
* Blacklist port/win32_msvc/utime.h in cpluspluscheck and headerscheck.Tom Lane2020-03-022-0/+2
| | | | | Since commit 481c8e923 it tends to produce "error: sys/utime.h: No such file or directory" on non-Windows platforms.
* Add exclusion to headercheckPeter Eisentraut2020-01-242-0/+6
| | | | | | | | | src/include/common/unicode_combining_table.h is currently not meant to be included standalone. Things could be refactored to allow it, but that would be beyond the present purpose. So adding an exclusion here seems best. Discussion: https://www.postgresql.org/message-id/10754.1579535012@sss.pgh.pa.us
* Update copyrights for 2020Bruce Momjian2020-01-012-2/+2
| | | | Backpatch-through: update all files in master, backpatch legal files through 9.4
* For all ppc compilers, implement compare_exchange and fetch_add with asm.Noah Misch2019-10-182-2/+0
| | | | | | | | This is more like how we handle s_lock.h and arch-x86.h. Reviewed by Tom Lane. Discussion: https://postgr.es/m/20191005173400.GA3979129@rfd.leadboat.com
* Add "headerscheck" script to test header-file compilability under C.Tom Lane2019-08-193-0/+206
| | | | | | | | | | | | | | | We already had "cpluspluscheck", which served the dual purposes of verifying that headers compile standalone and that they compile as C++. However, C++ compilers don't have the exact same set of error conditions as C compilers, so this doesn't really prove that a header will compile standalone as C. Hence, add a second script that's largely similar but runs the C compiler not C++. Also add a bit more documentation than the none-at-all we had before. Discussion: https://postgr.es/m/14803.1566175851@sss.pgh.pa.us
* Make cpluspluscheck more portable.Tom Lane2019-06-021-3/+17
| | | | | | | | | | | | | Teach it to scrape -I and -D switches from CPPFLAGS in Makefile.global. This is useful for testing on, eg, FreeBSD, where you won't get far without "-I/usr/local/include". Also, expand the set of blacklisted-for-unportability atomics headers, based on noting that arch-x86.h fails to compile on an ARM box. The other ones I'd omitted seem to compile all right on architectures they don't belong to, but that's surely too shaky to rely on. Let's do like we did for the src/include/port/ headers, and ignore all except the variant that's pulled in by the arch-independent header.
* Un-break ecpg tests for Windows.Tom Lane2019-06-021-0/+2
| | | | | | | | | | Declaring a function "inline" still doesn't work with Windows compilers (C99? what's that?), unless the macro provided by pg_config.h is in-scope, which it is not in our ECPG test programs. So the workaround I tried to use in commit 7640f9312 doesn't work for Windows. Revert the change in printf_hack.h, and instead just blacklist that file in cpluspluscheck --- since it's a not-installed test file, we don't really need to verify its C++ cleanliness anyway.
* Improve coverage of cpluspluscheck.Tom Lane2019-05-311-28/+116
| | | | | | | | | | | | | Formerly, cpluspluscheck was only meant to examine headers that we thought of as exported --- but its notion of what we export was well behind the times. Let's just make it check *all* .h files, except for a well-defined blacklist, instead. While at it, improve its ability to use a C++ compiler other than g++, by scraping the CXX setting from Makefile.global and making it possible to override the warning options used (per suggestion from Andres Freund). Discussion: https://postgr.es/m/b517ec3918d645eb950505eac8dd434e@gaz-is.ru
* Integrate cpluspluscheck into build system.Andres Freund2019-05-311-3/+23
| | | | | | | | Previously cpluspluscheck wouldn't work in vpath builds, this commit fixes that. To make it easier to invoke, there's a top-level cpluspluscheck target. Discussion: https://postgr.es/20190530220244.kiputcbl4gkl2oo6@alap3.anarazel.de
* Don't fall off the end of perl functionsAndrew Dunstan2018-05-271-0/+2
| | | | | | | | | | | | | | | This complies with the perlcritic policy Subroutines::RequireFinalReturn, which is a severity 4 policy. Since we only currently check at severity level 5, the policy is raised to that level until we move to level 4 or lower, so that any new infringements will be caught. A small cosmetic piece of tidying of the pgperlcritic script is included. Mike Blackwell Discussion: https://postgr.es/m/CAESHdJpfFm_9wQnQ3koY3c91FoRQsO-fh02za9R3OEMndOn84A@mail.gmail.com
* perltidy: Add option --nooutdent-long-quotesPeter Eisentraut2018-04-271-1/+1
|
* Reindent Perl files with perltidy version 20170521.Tom Lane2018-04-251-1/+1
| | | | Discussion: https://postgr.es/m/CABUevEzK3cNiHZQ18f5tK0guoT+cN_jWeVzhYYxY=r+1Q3SmoA@mail.gmail.com
* Clean up Perl code according to perlcriticPeter Eisentraut2017-03-271-16/+16
| | | | | | | | Fix all perlcritic warnings of severity level 5, except in src/backend/utils/Gen_dummy_probes.pl, which is automatically generated. Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
* Use 'use strict' in all Perl programsPeter Eisentraut2017-01-051-25/+34
|
* cpluspluscheck: Update include pathPeter Eisentraut2016-04-111-1/+1
| | | | | Some things in src/include/fe_utils require libpq headers, so add libpq's include path to the command line used here.
* pgindent run for release 9.3Bruce Momjian2013-05-291-165/+216
| | | | | This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
* Exclude utils/probes.h and pg_trace.h from cpluspluscheckPeter Eisentraut2013-03-011-1/+5
| | | | | They can include sys/sdt.h from SystemTap, which itself contains C++ code and so won't compile with a C++ compiler under extern "C" linkage.
* Exclude access/rmgrlist.h from cpluspluscheckPeter Eisentraut2013-02-081-0/+2
| | | | It is not meant to be included standalone.
* Don't include postgres.h in postgres_fe.h for cpluspluscheck.Andrew Dunstan2012-12-181-1/+1
| | | | | | Error exposed by recent Assert changes. Complaint from Peter Eisentraut.
* Add URL for include file visualization tool.Bruce Momjian2012-08-161-0/+4
|
* Add possible alternate tool for pgrminclude, from Peter GeogheganBruce Momjian2012-08-161-0/+4
|