Skip site navigation (1) Skip section navigation (2)

pgsql: Fix failure to ensure that a snapshot is available to datatype

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix failure to ensure that a snapshot is available to datatype
Date: 2008-12-13 02:00:20
Message-ID: 20081213020020.A51187545A4@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix failure to ensure that a snapshot is available to datatype input functions
when they are invoked by the parser.  We had been setting up a snapshot at
plan time but really it needs to be done earlier, before parse analysis.
Per report from Dmitry Koterov.

Also fix two related problems discovered while poking at this one:
exec_bind_message called datatype input functions without establishing a
snapshot, and SET CONSTRAINTS IMMEDIATE could call trigger functions without
establishing a snapshot.

Backpatch to 8.2.  The underlying problem goes much further back, but it is
masked in 8.1 and before because we didn't attempt to invoke domain check
constraints within datatype input.  It would only be exposed if a C-language
datatype input function used the snapshot; which evidently none do, or we'd
have heard complaints sooner.  Since this code has changed a lot over time,
a back-patch is hardly risk-free, and so I'm disinclined to patch further
than absolutely necessary.

Modified Files:
--------------
    pgsql/src/backend/commands:
        trigger.c (r1.241 -> r1.242)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/trigger.c?r1=1.241&r2=1.242)
    pgsql/src/backend/parser:
        analyze.c (r1.383 -> r1.384)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/analyze.c?r1=1.383&r2=1.384)
    pgsql/src/backend/tcop:
        postgres.c (r1.560 -> r1.561)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c?r1=1.560&r2=1.561)
    pgsql/src/backend/utils/cache:
        plancache.c (r1.23 -> r1.24)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/plancache.c?r1=1.23&r2=1.24)
    pgsql/src/include/parser:
        analyze.h (r1.38 -> r1.39)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/analyze.h?r1=1.38&r2=1.39)

pgsql-committers by date

Next:From: Tom LaneDate: 2008-12-13 02:00:30
Subject: pgsql: Fix failure to ensure that a snapshot is available to datatype
Previous:From: Alvaro HerreraDate: 2008-12-12 22:56:00
Subject: pgsql: Reduce some rel.h inclusions, and add pg_list.h to pg_proc_fn.h.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group