Waiting for 9.2 – Stacked Diagnostics in PL/pgSQL

On 18th of July, Tom Lane committed patch: Add GET STACKED DIAGNOSTICS plpgsql command to retrieve exception info.   This is more SQL-spec-compliant, more easily extensible, and better performing than the old method of inventing special variables.   Pavel Stehule, reviewed by Shigeru Hanada and David Wheeler

Waiting for 9.2 – NOT VALID CHECKS

On 30th of June, Alvaro Herrera committed patch: Enable CHECK constraints to be declared NOT VALID   This means that they can initially be added to a large existing table without checking its initial contents, but new tuples must comply to them; a separate pass invoked by ALTER TABLE / VALIDATE can verify existing data … Continue reading “Waiting for 9.2 – NOT VALID CHECKS”

Understanding postgresql.conf : log*

After loooong pause, adding next (well, second) post to the “series“. This time, I’d like to describe how logging works. And I don’t mean binary logging (WAL), but the log for us, humans, to read. Before I will go to the postgresql.conf options, let me first describe what happens when PostgreSQL wants to log something.

Waiting for 9.1 – Synchronous replication

On 6th of March, Simon Riggs committed patch: Efficient transaction-controlled synchronous replication. If a standby is broadcasting reply messages and we have named one or more standbys in synchronous_standby_names then allow users who set synchronous_replication to wait for commit, which then provides strict data integrity guarantees. Design avoids sending and receiving transaction state information so … Continue reading “Waiting for 9.1 – Synchronous replication”

Waiting for 9.1 – Foreign data wrapper

Well, saying that on particular date someone committed patch, wouldn’t be really telling. In fact various bits and pieces of underlying logic have been committed for a long time, but now we finally have some functionality visible and available to end users. This became the case thanks to these two commits, both committed on 20th … Continue reading “Waiting for 9.1 – Foreign data wrapper”

Waiting for 9.1 – Arrays in PL/Perl

On 18th of February, Alvaro Herrera committed patch: Convert Postgres arrays to Perl arrays on PL/perl input arguments   More generally, arrays are turned in Perl array references, and row and composite types are turned into Perl hash references. This is done recursively, in a way that’s natural to every Perl programmer.   To avoid … Continue reading “Waiting for 9.1 – Arrays in PL/Perl”

Waiting for 9.1 – Rewrite-less changing types of column

On 12th of February, Robert Haas committed patch: Teach ALTER TABLE .. SET DATA TYPE to avoid some table rewrites.   When the old type is binary coercible to the new type and the using clause does not change the column contents, we can avoid a full table rewrite, though any indexes on the affected … Continue reading “Waiting for 9.1 – Rewrite-less changing types of column”

Waiting for 9.1 – Per-column collation support

On 8th of February, Peter Eisentraut committed patch: Per-column collation support   This adds collation support for columns and domains, a COLLATE clause to override it per expression, and B-tree index support.   Peter Eisentraut reviewed by Pavel Stehule, Itagaki Takahiro, Robert Haas, Noah Misch   Branch —— master

Waiting for 9.1 – INVALID FOREIGN KEYS

On 8th of February, Simon Riggs committed patch: Extend ALTER TABLE to allow Foreign Keys to be added without initial validation. FK constraints that are marked NOT VALID may later be VALIDATED, which uses an ShareUpdateExclusiveLock on constraint table and RowShareLock on referenced table. Significantly reduces lock strength and duration when adding FKs. New state … Continue reading “Waiting for 9.1 – INVALID FOREIGN KEYS”