Received: from ece.rice.edu (ece.rice.edu [128.42.4.34]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5KLU5a66090 for ; Wed, 20 Jun 2001 17:30:05 -0400 (EDT) (envelope-from reedstrm@rice.edu) Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by ece.rice.edu (Postfix) with ESMTP id 2567C68A84; Wed, 20 Jun 2001 16:30:01 -0500 (CDT) Received: from reedstrm by wallace.ece.rice.edu with local (Exim 3.22 #1 (Debian)) id 15CpXy-0000yA-00; Wed, 20 Jun 2001 16:29:58 -0500 Date: Wed, 20 Jun 2001 16:29:58 -0500 From: "Ross J. Reedstrom" To: Gerard Mason Cc: pgsql-admin@postgresql.org Subject: Re: Re: pg_dump dumps views as tables??? Message-ID: <20010620162958.C3249@rice.edu> Mail-Followup-To: "Ross J. Reedstrom" , Gerard Mason , pgsql-admin@postgresql.org References: <9gbd3s$2d6$1@news.tht.net> <9gn1a0$2det$1@news.tht.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9gn1a0$2det$1@news.tht.net> User-Agent: Mutt/1.3.18i X-Archive-Number: 200106/139 X-Sequence-Number: 1706 If you look farther down that same dump, you'll see a CREATE RULE that looks something like: CREATE RULE AS ON SELECT CREATE RULE "_RETincluded_works" AS ON SELECT TO "included_works" DO INSTEAD SELECT "works"."uuid", "works"."title" as "lhs" [...] In other words, pg_dump, especially before 7.1, exposes the details of how views are implemented, rather than recreating the SQL you wrote to create the schema. Ross On Tue, Jun 19, 2001 at 09:12:32AM +0100, Gerard Mason wrote: > Anybody? > > > "Gerard Mason" wrote in message > news:9gbd3s$2d6$1@news.tht.net... > > I am running postgresql-server-7.0.3-12mdk (Mandrake 8.0). The relevant > part > > of my build script looks like this: > > > > create view included_works > > as > > select uuid, title as lhs > > , trim(to_char(cast(year_of_publication as int), '0000')) as rhs > > from works > > where include=true > > ; > > > > What pg_dump actually outputs is this: > > > > CREATE TABLE "included_works" ( > > "uuid" character(36), > > "lhs" character varying(80), > > "rhs" text > > ); > > > > > > I would be more appalled if I was less gobsmacked. Surely I'm doing > > something wrong? But I can't find any reference to this in either the > Admin > > Guide or the Reference Manual (though admittedly I'm looking at the 7.1 > > ones -- the 7.0 ones didn't have any info on it at all, I think). > > > > Help. > > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html