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

pgsql: Fix bugs in relpersistence handling during table creation.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix bugs in relpersistence handling during table creation.
Date: 2011-07-03 21:47:25
Message-ID: E1QdUVh-0001wZ-2N@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Fix bugs in relpersistence handling during table creation.

Unlike the relistemp field which it replaced, relpersistence must be
set correctly quite early during the table creation process, as we
rely on it quite early on for a number of purposes, including security
checks.  Normally, this is set based on whether the user enters CREATE
TABLE, CREATE UNLOGGED TABLE, or CREATE TEMPORARY TABLE, but a
relation may also be made implicitly temporary by creating it in
pg_temp.  This patch fixes the handling of that case, and also
disables creation of unlogged tables in temporary tablespace (such
table indeed skip WAL-logging, but we reject an explicit
specification) and creation of relations in the temporary schemas of
other sessions (which is not very sensible, and didn't work right
anyway).

Report by Amit Khandekar.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5da79169d3e9f0fab47da03318c44075b3f824c5

Modified Files
--------------
src/backend/catalog/namespace.c           |   57 ++++++++++++++++++++++-------
src/backend/commands/tablecmds.c          |   13 ++++---
src/backend/commands/typecmds.c           |    1 +
src/backend/commands/view.c               |   27 ++++++++------
src/backend/executor/execMain.c           |   13 ++++---
src/backend/parser/parse_utilcmd.c        |    4 ++
src/include/catalog/namespace.h           |    1 +
src/test/regress/expected/create_view.out |    4 +-
8 files changed, 81 insertions(+), 39 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2011-07-03 23:04:20
Subject: pgsql: Put comments on the installable procedural languages.
Previous:From: Robert HaasDate: 2011-07-03 21:24:27
Subject: Re: [COMMITTERS] pgsql: Make the visibility map crash-safe.

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