Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 83F12476147 for ; Tue, 9 Apr 2002 11:53:21 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 6D030D5FA; Tue, 9 Apr 2002 08:53:25 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 60BA95C01; Tue, 9 Apr 2002 08:53:25 -0700 (PDT) Date: Tue, 9 Apr 2002 08:53:25 -0700 (PDT) From: Stephan Szabo To: Jodi Kanter Cc: Postgres Admin List Subject: Re: table dump In-Reply-To: <00a001c1dfd0$4818a1d0$de138f80@virginia.edu> Message-ID: <20020409085143.Y94187-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200204/77 X-Sequence-Number: 3965 On Tue, 9 Apr 2002, Jodi Kanter wrote: > I just completed a data only dump of a table by using the following command: > > pg_dump genex -Rau -t species > species.sql > > I noticed that the first line of the file seems to be disabling some > postgres trigger. It reads: > > UPDATE "pg_class" SET "reltriggers" = 0 WHERE "relname" = 'species'; > > Then all the data is listed. > > At the end of the file the triggers are enabled again with the > following command: > > UPDATE pg_class SET reltriggers = (SELECT count(*) FROM pg_trigger > where pg_class.oid = tgrelid) WHERE relname = 'species'; > > Can someone explain why this is happening? The problem is that I am > coping this dump into another schema creation file that I have. I want > the data from this particular file included in with my new database. > However, I am creating this database with a user account so that all > tables will be owned by that user. I think the problem here is that > this trigger stuff requires that you be signed in as postgres in order > to do anything with the pg_class table. correct? You'd need to be a superuser I'd guess. The reason for those statmenets is to turn off foreign key constraints during the load of what's assumed to be correct data since it came from a dump. You can ignore them if you don't have any or don't mind having the constraints run.