From: tushar <tushar.ahuja@enterprisedb.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: pg_upgrade failed if view contain natural left join condition
Date: Thu, 20 Jul 2017 17:39:43 +0530
Message-ID: <98b283cd-6dda-5d3f-f8ac-87db8c76a3da@enterprisedb.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Steps to reproduce -
v9.6
postgres=# create table t(n int);
CREATE TABLE
postgres=# create table t1(a int);
CREATE TABLE
postgres=# create view ttt1 as SELECT e.n FROM t e NATURAL LEFT JOIN t1 d;
CREATE VIEW
v10 -
run pg_upgrade -
going to fail ,with this error -
"
pg_restore: creating TABLE "public.t"
pg_restore: creating TABLE "public.t1"
pg_restore: creating VIEW "public.ttt1"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 187; 1259 16390 VIEW
ttt1 edb
pg_restore: [archiver (db)] could not execute query: ERROR: syntax
error at or near ")"
LINE 16: LEFT JOIN "t1" "d");
^
Command was:
-- For binary upgrade, must preserve pg_type oid
SELECT
pg_catalog.binary_upgrade_set_next_pg_type_oid('16392'::pg_catalog.oid);
-- For binary upgrade, must preserve pg_type array oid
SELECT
pg_catalog.binary_upgrade_set_next_array_pg_type_oid('16391'::pg_catalog.oid);
-- For binary upgrade, must preserve pg_class oids
SELECT
pg_catalog.binary_upgrade_set_next_heap_pg_class_oid('16390'::pg_catalog.oid);
CREATE VIEW "ttt1" AS
SELECT "e"."n"
FROM ("t" "e"
LEFT JOIN "t1" "d");
"
I think -this issue should be there in the older branches as well but
not checked that.
--
regards,tushar
EnterpriseDB https://www.enterprisedb.com/
The Enterprise PostgreSQL Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tushar.ahuja@enterprisedb.com
Subject: Re: pg_upgrade failed if view contain natural left join condition
In-Reply-To: <98b283cd-6dda-5d3f-f8ac-87db8c76a3da@enterprisedb.com>
* 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