Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYAHD-0001hP-9u for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Jul 2017 12:09:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dYAHC-0005di-Jp for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Jul 2017 12:09:54 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dYAHB-0005dX-Sq for pgsql-hackers@postgresql.org; Thu, 20 Jul 2017 12:09:54 +0000 Received: from mail-pg0-x22d.google.com ([2607:f8b0:400e:c05::22d]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dYAH7-0002Cc-9F for pgsql-hackers@postgresql.org; Thu, 20 Jul 2017 12:09:51 +0000 Received: by mail-pg0-x22d.google.com with SMTP id k14so14167084pgr.0 for ; Thu, 20 Jul 2017 05:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=WxNeZtcWLeMpt6bog/NFLernUlqZLij0fgvP0XC6OKg=; b=rg+1xuNqebYXWUyJX/augV0+DQzoJWrEBbxXKdj2DxFLGhqBE+orv2dBV/d4kNvi7S xcOhjQOVD50k5VO9gvSbaAvazgc63Bfi9v83tLCrO5Cl94JdxIDnESw3M+hBp7U6kIWc ewvoLccY4T/zdgxWAqXjtMaRncNlOgiV0wuL99aVsA7pUEwcm9SkH3T4G6TCT/P5L1W1 s6LG98SOatAA35Lp0wvSpwho61524AVV0skrXhXHmW6QwchB2/JmdXoCFkRyBGhagmSi GwWmUzEN0CjRh8atV1fR7BCcHfdQ9UXDFP5Bem+uKViBVD2WJJzsVzmeItMfxpj+fbR5 Yalw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=WxNeZtcWLeMpt6bog/NFLernUlqZLij0fgvP0XC6OKg=; b=dBUOetc+DOIaTDOH1wYnPpRfz8xIt4Cn5ccA9F+PQI38q52UlsPXozH9tYRVrcOU1y gcrBWzW+OKK8l0TvEy45tu21jUDw9PpqDMRXXyKYvveDpIfuEJfNxXE3zHlnVSanTc5o qp5CYAwrK/rdjZ7D+MLFpwiUkKZgfzwG1NrDGAfL7ni4yKE5PSHmEdEOwfy8mEKax8wA HI4WUmWtKoDRiqDcYL04ZtVUm0REmOkS8EuUi8DG2skZp7GLG3N+FcDHO4vyChqlFhSN G9OMoS0T48iI6dkH4+eXY+jscX6GYnOd5lrWqccrEDT+5AjjeQtcvDlpMar9MgIRp9S5 rnEw== X-Gm-Message-State: AIVw112QxM+5W+zBtYlVMeEZacbb1WQ+hcDzAjAjySFy0QOjHl2ejAs9 +uTpue3kSVAHPWb5K97NKQZ27637jB48gDkx6f7Bp8kCUh1Vrzbmi56CV65cBB6d/smhWgl0sO7 bIy/QrqCYMKcMVyUGbhg9T3zpWnPwq79OrB7tFVzFJk/FxsoluNkYTr91sKupjLRlLwyBJVTLaA == X-Received: by 10.98.87.93 with SMTP id l90mr3634248pfb.3.1500552587346; Thu, 20 Jul 2017 05:09:47 -0700 (PDT) Received: from localhost.localdomain ([59.162.78.200]) by smtp.gmail.com with ESMTPSA id g67sm5274683pfe.104.2017.07.20.05.09.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jul 2017 05:09:46 -0700 (PDT) From: tushar Subject: pg_upgrade failed if view contain natural left join condition To: PostgreSQL-development Message-ID: <98b283cd-6dda-5d3f-f8ac-87db8c76a3da@enterprisedb.com> Date: Thu, 20 Jul 2017 17:39:43 +0530 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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