Re: [HACKERS] pg_upgrade problem

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] pg_upgrade problem
Date: 1999-06-07 22:59:24
Message-ID: 199906072259.SAA04247@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Applied.

>
> I attach a patch for pg_upgrade. This does two things:
>
> 1. check whether the program is being executed in $PGDATA/.. This is
> necessary if the data tree is not in the standard place, as is the
> case with the Debian distribution (because of Debian policy).
>
> 2. give a clearer error message if the dumped data structure fails to
> be loaded.
>
> ===================== start patch =================
> *** src/bin/pg_dump/pg_upgrade~ Mon Jun 7 22:13:00 1999
> --- src/bin/pg_dump/pg_upgrade Mon Jun 7 22:11:13 1999
> ***************
> *** 29,36 ****
>
> # check things
>
> ! if [ ! -f "./lib/global1.bki.source" ]
> ! then echo "$0 must be run from the top of the postgres directory tree." 1>&2
> exit 1
> fi
>
> --- 29,37 ----
>
> # check things
>
> ! if [ ! -f "./data/PG_VERSION" ]
> ! then echo "`basename $0` must be run from the directory containing
> ! the database directory \`data' (`dirname $PGDATA`.)" 1>&2
> exit 1
> fi
>
> ***************
> *** 72,78 ****
> psql "template1" <"/tmp/$$"
>
> if [ $? -ne 0 ]
> ! then echo "psql failed to execute $INPUT script." 1>&2
> exit 1
> fi
>
> --- 73,80 ----
> psql "template1" <"/tmp/$$"
>
> if [ $? -ne 0 ]
> ! then echo "There were errors in the input script $INPUT.
> ! $0 aborted." 1>&2
> exit 1
> fi
>
> ===================== end patch =================
>
> --
> Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
> Isle of Wight http://www.lfix.co.uk/oliver
> PGP key from public servers; key ID 32B8FAA1
> ========================================
> "There is a way that seems right to a man, but in the
> end it leads to death."
> Proverbs 16:25
>
>
>
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-06-07 23:03:11 Re: [HACKERS] PostgreSQL History(Parody)
Previous Message Bruce Momjian 1999-06-07 22:56:33 Re: [HACKERS] pg_upgrade problem