From: pythonesque@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #13776: Views with nested composite attributes can break pg_dump
Date: Sun, 15 Nov 2015 16:58:27 +0000
Message-ID: <20151115165827.12771.5089@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 13776
Logged by: Joshua Yanovski
Email address: pythonesque@gmail.com
PostgreSQL version: 9.4.5
Operating system: Mac OS X 10.10.2
Description:
The below instructions provide a reproducible testcase. Essentially, the
view definition is invalid SQL, so when you try to restore from a dump with
a view like this you get an error and can't proceed. Currently I'm working
around it by using ROW(ROW(foo.*)) instead, but it seems to me that the
semantics there are slightly different since adding a column to foo won't
automatically add it to the view (though maybe this is desirable).
---
# CREATE TABLE foo ();
# CREATE TYPE bar AS (x foo);
# CREATE VIEW baz AS SELECT ROW(foo)::bar FROM foo;
# \d+ baz
View definition:
SELECT ROW(foo.*)::bar AS "row"
FROM foo;
# SELECT ROW(foo.*)::bar AS "row"
FROM foo;
ERROR: cannot cast type record to bar
LINE 1: SELECT ROW(foo.*)::bar AS "row"
^
DETAIL: Input has too few columns.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: pythonesque@gmail.com
Subject: Re: BUG #13776: Views with nested composite attributes can break pg_dump
In-Reply-To: <20151115165827.12771.5089@wrigleys.postgresql.org>
References: <20151115165827.12771.5089@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox