referencing table does not change the tuple's FK column(s), we don't bother
to check the PK table since the constraint was presumably already valid.
However, the check is still necessary if the tuple was inserted by our own
transaction, since in that case the INSERT trigger will conclude it need not
make the check (since its version of the tuple has been deleted). We got this
right for simple cases, but not when the insert and update are in different
subtransactions of the current top-level transaction; in such cases the FK
check would never be made at all. (Hence, problem dates back to 8.0 when
subtransactions were added --- it's actually the subtransaction version of a
bug fixed in 7.3.5.) Fix, and add regression test cases. Report and fix by
Affan Salman.
been broken since forever, but was not noticed because people seldom look
at raw parse trees. AFAIK, no impact on users except that debug_print_parse
might fail; but patch it all the way back anyway. Per report from Jeff Ross.
and add a note about why. This is not tremendously important right now,
probably, but it will get more urgent if NUM_BUFFER_PARTITIONS is increased
as much as proposed.
name. With this patch, it is always possible for the user to qualify a
plpgsql variable name if needed to avoid ambiguity. While there is much more
work to be done in this area, this simple change removes one unnecessary
incompatibility with Oracle. Per discussion.
theoretically vary depending on what the compile-time locale setting is.
Hence, force it to see LC_CTYPE=C to ensure consistent build results.
(It's likely that this makes no difference in practice, since our
specification for "identifier" surely includes both ends of any possible
uppercase/lowercase pair anyway. But it should silence warnings about
ambiguous character classes that are reported by some buildfarm members.)
sanely if the loop value overflows int32 on the way to the end value.
Avoid useless computation of "SELECT 1" when BY is omitted. Avoid some
type-punning between Datum and int4 that dates from the original coding.
of variable substitution and plan caching behavior in dedicated sections.
(A lot of this material existed already, but was scattered in various places
in the chapter.) Reorganize material a little bit, mostly to try to avoid
diving into deep details in the first introductory sections. Document some
fine points that had escaped treatment before, notably the ability to qualify
plpgsql variable names with block labels. Some minor wordsmithing here and
there.
from old versions of gcc. It's not clear to me that this is really
necessary for correctness, but less warnings are always good.
Per buildfarm results and local testing.
define pg_dlsym() as returning a PGFunction pointer, not just any
pointer-to-function. But many are not. Suppress compiler warnings
on platforms that aren't careful by inserting explicit casts at the
two call sites that didn't have a cast already. Per Stefan.