Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D0C6A476230 for ; Sat, 3 Aug 2002 23:07:14 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 4B633475E97 for ; Sat, 3 Aug 2002 23:07:14 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g7436fVk006563; Sat, 3 Aug 2002 23:06:42 -0400 (EDT) To: "Kristian Eide" Cc: pgsql-sql@postgresql.org Subject: Re: Bug with dump/restore when using UNION and ORDER BY in views In-reply-to: <036501c23b32$5c5149f0$6b97f181@speed> References: <036501c23b32$5c5149f0$6b97f181@speed> Comments: In-reply-to "Kristian Eide" message dated "Sat, 03 Aug 2002 23:11:40 +0200" Date: Sat, 03 Aug 2002 23:06:41 -0400 Message-ID: <6562.1028430401@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/73 X-Sequence-Number: 8919 "Kristian Eide" writes: > There seems to be a bug when dumping a view which is a UNION of selects, one > of which has an ORDER BY. A pair of paranthesises around the select is > missing, and this cause a subsequent restore to fail. Yeah. This is fixed in current sources, and I back-patched it into the REL7_2 branch, but current plans don't seem to include a 7.2.2 release --- we'll be going straight to 7.3 beta instead. If you're sufficiently annoyed to want to install a source patch locally, see rev 1.89.2.1 at http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/utils/adt/ruleutils.c Note this is a server-side patch; the bug is not in pg_dump. So using a 7.3 pg_dump against your existing server won't help. You might want to apply the back-patch just so that you can dump when the time comes to go to 7.3... regards, tom lane