Re: initdb failure (was Re: [GENERAL] sequence's plpgsql)

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: initdb failure (was Re: [GENERAL] sequence's plpgsql)
Date: 2003-09-27 05:55:49
Message-ID: 1064642149.16483.42.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-jdbc

On Fri, 2003-09-26 at 23:18, Bruce Momjian wrote:
> If you are loading from pg_dump, you have lots of copy commands, so how
> do you know which COPY command caused the failure. You just have the
> line number of _a_ copy.

I would recommend using
psql -e
so that the sql commands are output too.

Here is a documentation patch:

Index: backup.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql-server/doc/src/sgml/backup.sgml,v
retrieving revision 2.30
diff -c -r2.30 backup.sgml
*** backup.sgml 31 Aug 2003 17:32:18 -0000 2.30
--- backup.sgml 27 Sep 2003 05:45:04 -0000
***************
*** 100,106 ****
be read in by the <application>psql</application> program. The
general command form to restore a dump is
<synopsis>
! psql <replaceable class="parameter">dbname</replaceable> &lt; <replaceable class="parameter">infile</replaceable>
</synopsis>
where <replaceable class="parameter">infile</replaceable> is what
you used as <replaceable class="parameter">outfile</replaceable>
--- 100,106 ----
be read in by the <application>psql</application> program. The
general command form to restore a dump is
<synopsis>
! psql -f <replaceable class="parameter">infile</replaceable> -d <replaceable class="parameter">dbname</replaceable>
</synopsis>
where <replaceable class="parameter">infile</replaceable> is what
you used as <replaceable class="parameter">outfile</replaceable>
***************
*** 112,117 ****
--- 112,124 ----
<application>psql</> supports similar options to <application>pg_dump</>
for controlling the database server location and the user name. See
its reference page for more information.
+ </para>
+
+ <para>
+ With a large dump, it may be difficult to identify where any errors are
+ occurring. You may use the -e option to psql to print the SQL commands
+ as they are run, so that it is easy to see precisely which commands are
+ causing errors.
</para>

<para>

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"My brethren, count it all joy when ye fall into
various trials, Knowing that the testing of your faith
produces endurance." James 1:2,3

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rajesh Kumar Mallah 2003-09-27 09:01:30 RT with PostgreSQL .
Previous Message Bruce Momjian 2003-09-27 01:03:04 Re: initdb failure (was Re: [GENERAL] sequence's plpgsql)

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-09-27 05:59:38 Re: 2-phase commit
Previous Message Christopher Kings-Lynne 2003-09-27 05:35:24 Re: 2-phase commit

Browse pgsql-jdbc by date

  From Date Subject
Next Message Paul Thomas 2003-09-27 09:23:43 Re: Tomcat - PostgreSQL - Cannot load JDBC driver class "null"
Previous Message Jim Wright 2003-09-27 02:19:03 Re: Tomcat - PostgreSQL - Cannot load JDBC driverclass"null"