summaryrefslogtreecommitdiff
path: root/src/tools/pgindent
AgeCommit message (Collapse)Author
2017-05-23Update URLs in pgindent source and READMEMagnus Hagander
Website and buildfarm is https, not http, and the ftp protocol will be shut down shortly.
2015-09-26Rework the way multixact truncations work.Andres Freund
The fact that multixact truncations are not WAL logged has caused a fair share of problems. Amongst others it requires to do computations during recovery while the database is not in a consistent state, delaying truncations till checkpoints, and handling members being truncated, but offset not. We tried to put bandaids on lots of these issues over the last years, but it seems time to change course. Thus this patch introduces WAL logging for multixact truncations. This allows: 1) to perform the truncation directly during VACUUM, instead of delaying it to the checkpoint. 2) to avoid looking at the offsets SLRU for truncation during recovery, we can just use the master's values. 3) simplify a fair amount of logic to keep in memory limits straight, this has gotten much easier During the course of fixing this a bunch of additional bugs had to be fixed: 1) Data was not purged from memory the member's SLRU before deleting segments. This happened to be hard or impossible to hit due to the interlock between checkpoints and truncation. 2) find_multixact_start() relied on SimpleLruDoesPhysicalPageExist - but that doesn't work for offsets that haven't yet been flushed to disk. Add code to flush the SLRUs to fix. Not pretty, but it feels slightly safer to only make decisions based on actual on-disk state. 3) find_multixact_start() could be called concurrently with a truncation and thus fail. Via SetOffsetVacuumLimit() that could lead to a round of emergency vacuuming. The problem remains in pg_get_multixact_members(), but that's quite harmless. For now this is going to only get applied to 9.5+, leaving the issues in the older branches in place. It is quite possible that we need to backpatch at a later point though. For the case this gets backpatched we need to handle that an updated standby may be replaying WAL from a not-yet upgraded primary. We have to recognize that situation and use "old style" truncation (i.e. looking at the SLRUs) during WAL replay. In contrast to before, this now happens in the startup process, when replaying a checkpoint record, instead of the checkpointer. Doing truncation in the restartpoint is incorrect, they can happen much later than the original checkpoint, thereby leading to wraparound. To avoid "multixact_redo: unknown op code 48" errors standbys would have to be upgraded before primaries. A later patch will bump the WAL page magic, and remove the legacy truncation codepaths. Legacy truncation support is just included to make a possible future backpatch easier. Discussion: 20150621192409.GA4797@alap3.anarazel.de Reviewed-By: Robert Haas, Alvaro Herrera, Thomas Munro Backpatch: 9.5 for now
2015-06-01pgindent: add typedef blog URLBruce Momjian
2015-05-25pgindent: document location of "all" typedef listsBruce Momjian
2015-05-25pgindent: fix typoBruce Momjian
Report by Michael Paquier
2015-05-24pgindent: more doc updates for skipping __asm__ filesBruce Momjian
2015-05-24Revert 9.5 pgindent changes to atomics directory filesBruce Momjian
This is because there are many __asm__ blocks there that pgindent messes up. Also configure pgindent to skip that directory in the future.
2015-05-23Update typedef file in preparation for pgindent runBruce Momjian
2015-05-23Improve pgindent instructions regarding Perl backup filesBruce Momjian
2015-05-20Fix more typos in comments.Heikki Linnakangas
Patch by CharSyam, plus a few more I spotted with grep.
2015-02-09Move pg_lzcompress.c to src/common.Fujii Masao
The meta data of PGLZ symbolized by PGLZ_Header is removed, to make the compression and decompression code independent on the backend-only varlena facility. PGLZ_Header is being used to store some meta data related to the data being compressed like the raw length of the uncompressed record or some varlena-related data, making it unpluggable once PGLZ is stored in src/common as it contains some backend-only code paths with the management of varlena structures. The APIs of PGLZ are reworked at the same time to do only compression and decompression of buffers without the meta-data layer, simplifying its use for a more general usage. On-disk format is preserved as well, so there is no incompatibility with previous major versions of PostgreSQL for TOAST entries. Exposing compression and decompression APIs of pglz makes possible its use by extensions and contrib modules. Especially this commit is required for upcoming WAL compression feature so that the WAL reader facility can decompress the WAL data by using pglz_decompress. Michael Paquier, reviewed by me.
2014-08-21Rework 'MOVE ALL' to 'ALTER .. ALL IN TABLESPACE'Stephen Frost
As 'ALTER TABLESPACE .. MOVE ALL' really didn't change the tablespace but instead changed objects inside tablespaces, it made sense to rework the syntax and supporting functions to operate under the 'ALTER (TABLE|INDEX|MATERIALIZED VIEW)' syntax and to be in tablecmds.c. Pointed out by Alvaro, who also suggested the new syntax. Back-patch to 9.4.
2014-07-14Move view reloptions into their own varlena structAlvaro Herrera
Per discussion after a gripe from me in http://www.postgresql.org/message-id/20140611194633.GH18688@eldon.alvh.no-ip.org Jaime Casanova
2014-05-06Remove pgindent ecpg exclusion patternBruce Momjian
Report by Tom Lane
2014-05-06Improve pgindent test instructionsBruce Momjian
2014-05-06pgindent run for 9.4Bruce Momjian
This includes removing tabs after periods in C comments, which was applied to back branches, so this change should not effect backpatching.
2014-05-06Adjust pgindent to remove tabs after periods in C comments.Bruce Momjian
2014-05-06Update typedef list in preparation for pgindent runBruce Momjian
2014-03-10Allow logical decoding via the walsender interface.Robert Haas
In order for this to work, walsenders need the optional ability to connect to a database, so the "replication" keyword now allows true or false, for backward-compatibility, and the new value "database" (which causes the "dbname" parameter to be respected). walsender needs to loop not only when idle but also when sending decoded data to the user and when waiting for more xlog data to decode. This means that there are now three separate loops inside walsender.c; although some refactoring has been done here, this is still a bit ugly. Andres Freund, with contributions from Álvaro Herrera, and further review by me.
2014-03-03Introduce logical decoding.Robert Haas
This feature, building on previous commits, allows the write-ahead log stream to be decoded into a series of logical changes; that is, inserts, updates, and deletes and the transactions which contain them. It is capable of handling decoding even across changes to the schema of the effected tables. The output format is controlled by a so-called "output plugin"; an example is included. To make use of this in a real replication system, the output plugin will need to be modified to produce output in the format appropriate to that system, and to perform filtering. Currently, information can be extracted from the logical decoding system only via SQL; future commits will add the ability to stream changes via walsender. Andres Freund, with review and other contributions from many other people, including Álvaro Herrera, Abhijit Menon-Sen, Peter Gheogegan, Kevin Grittner, Robert Haas, Heikki Linnakangas, Fujii Masao, Abhijit Menon-Sen, Michael Paquier, Simon Riggs, Craig Ringer, and Steve Singer.
2014-02-12Rename 'gmake' to 'make' in docs and recommended commandsBruce Momjian
This simplifies the docs and makes it easier to cut/paste command lines.
2014-01-31Introduce replication slots.Robert Haas
Replication slots are a crash-safe data structure which can be created on either a master or a standby to prevent premature removal of write-ahead log segments needed by a standby, as well as (with hot_standby_feedback=on) pruning of tuples whose removal would cause replication conflicts. Slots have some advantages over existing techniques, as explained in the documentation. In a few places, we refer to the type of replication slots introduced by this patch as "physical" slots, because forthcoming patches for logical decoding will also have slots, but with somewhat different properties. Andres Freund and Robert Haas
2014-01-31pgindent: add Perl commentBruce Momjian
2014-01-31pgindent: add --list-of-typedefs optionBruce Momjian
Allows typedefs to be specified on the command line, per request from Andrew.
2014-01-30pgindent: preserve blank lines around #else/#endifBruce Momjian
This requires a new version of pg_bsd_indent, version 1.3, to be downloaded.
2014-01-27Relax the requirement that all lwlocks be stored in a single array.Robert Haas
This makes it possible to store lwlocks as part of some other data structure in the main shared memory segment, or in a dynamic shared memory segment. There is still a main LWLock array and this patch does not move anything out of it, but it provides necessary infrastructure for doing that in the future. This change is likely to increase the size of LWLockPadded on some platforms, especially 32-bit platforms where it was previously only 16 bytes. Patch by me. Review by Andres Freund and KaiGai Kohei.
2014-01-18Add ALTER TABLESPACE ... MOVE commandStephen Frost
This adds a 'MOVE' sub-command to ALTER TABLESPACE which allows moving sets of objects from one tablespace to another. This can be extremely handy and avoids a lot of error-prone scripting. ALTER TABLESPACE ... MOVE will only move objects the user owns, will notify the user if no objects were found, and can be used to move ALL objects or specific types of objects (TABLES, INDEXES, or MATERIALIZED VIEWS).
2013-12-20pg_prewarm, a contrib module for prewarming relationd data.Robert Haas
Patch by me. Review by Álvaro Herrera, Amit Kapila, Jeff Janes, Gurjeet Singh, and others.
2013-12-10Add new wal_level, logical, sufficient for logical decoding.Robert Haas
When wal_level=logical, we'll log columns from the old tuple as configured by the REPLICA IDENTITY facility added in commit 07cacba983ef79be4a84fcd0e0ca3b5fcb85dd65. This makes it possible a properly-configured logical replication solution to correctly follow table updates even if they change the chosen key columns, or, with REPLICA IDENTITY FULL, even if the table has no key at all. Note that updates which do not modify the replica identity column won't log anything extra, making the choice of a good key (i.e. one that will rarely be changed) important to performance when wal_level=logical is configured. Each insert, update, or delete to a catalog table will also log the CMIN and/or CMAX values of stamped by the current transaction. This is necessary because logical decoding will require access to historical snapshots of the catalog in order to decode some data types, and the CMIN/CMAX values that we may need in order to judge row visibility may have been overwritten by the time we need them. Andres Freund, reviewed in various versions by myself, Heikki Linnakangas, KONDO Mitsumasa, and many others.
2013-11-10Fix whitespace issues found by git diff --check, add gitattributesPeter Eisentraut
Set per file type attributes in .gitattributes to fine-tune whitespace checks. With the associated cleanups, the tree is now clean for git
2013-09-05Eliminate pg_rewrite.ev_attr column and related dead code.Kevin Grittner
Commit 95ef6a344821655ce4d0a74999ac49dd6af6d342 removed the ability to create rules on an individual column as of 7.3, but left some residual code which has since been useless. This cleans up that dead code without any change in behavior other than dropping the useless column from the catalog.
2013-06-01Minor spelling fixesStephen Frost
Fix a few spelling mistakes. Per bug report #8193 from Lajos Veres.
2013-05-30Remove whitespace from end of linesPeter Eisentraut
2013-05-29pgindent run for release 9.3Bruce Momjian
This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
2013-04-16pgindent: add newline to die() so script line number is not reported on ↵Bruce Momjian
failure.
2013-04-12pgindent: improve error messagesBruce Momjian
per suggestion from Gurjeet Singh
2013-04-12pgindent: fix downloading of BSD indent binaryBruce Momjian
Also fix accessing pgentab binary and tar. Gurjeet Singh
2013-02-14pgindent: Fix order in instructionsPeter Eisentraut
The previous order of steps didn't literally work, because git clean -fdx would delete the downloaded typedefs.list. Also, pgindent needs to be called with a path when one is in at the top of the build tree.
2013-01-07Fix a logic bug in pgindent.Andrew Dunstan
2012-08-27Have pgindent requre pg_bsd_indent version 1.2 now that a new versionBruce Momjian
has been created by adding #include <stdlib.h> to parse.c. per request from Kevin Grittner.
2012-08-07Tweak new Perl pgindent for compatibility with middle-aged Perls.Tom Lane
We seem to have a rough policy that our Perl scripts should work with Perl 5.8, so make this one do so. Main change is to not use the newfangled \h character class in regexes; "[ \t]" is a serviceable replacement.
2012-08-04Replace pgindent shell script with Perl script. Update perltidyBruce Momjian
instructions to perltidy Perl files that lack Perl file extensions. pgindent Perl coding by Andrew Dunstan, restructured by me.
2012-07-12Remove 'x =- 1' check for pgindent, not needed, per report from AndrewBruce Momjian
Dunstan.
2012-06-16Remove 'for' loop perltidy argument, and move args to perltidyrc file.Bruce Momjian
Backpatch to 9.2. Per suggestion from Noah Misch
2012-06-15In pgindent, suppress reading the perltidy RC file using --noprofile.Bruce Momjian
2012-06-15Update pgindent Perl indentation instructions based on feedback fromBruce Momjian
Àlvaro and Noah Misch. Backpatch to 9.2.
2012-06-10Update pgindent install instructions and update typedef list.Bruce Momjian
2012-03-21Add installing entab to pgindent instructionsPeter Eisentraut
And minor other pgindent documentation tweaks.
2012-01-09Fix pathname in pgindent README.Robert Haas
Kevin Grittner
2011-11-28Document that perl needs to be indented during the pgindent run.Bruce Momjian