Thread: psql -e problem

psql -e problem

From
Simon Drabble
Date:
Just upgraded to 6.4.2 from 6.3.2 and I've got a bit of a problem.

Compiled, installed, regressed(?) all went fine. Come to load up the old
datbases, and it appears that \. is not being recognised as end-of-input
in the database dump file (I did a pg_dumpall -z, if that helps).

For example, I have some data as follows, which should be read in up to
the \. line, but the \. lines appears to not be recognised/ handled,
causing the following lines to be treated as data, which leads to the
commands not being executed...


COPY stats FROM stdin;
11.5    2.5     07-11-1998
12      3       07-16-1998
12      3       07-19-1998
14      4       07-30-1998
14      4       08-06-1998
15      4.5     08-15-1998
15      4.5     08-24-1998
16.5    5       08-30-1998
18.5    5       09-13-1998
20      5.5     09-20-1998
23      6       10-05-1998
\.
\connect template1 simon
create database members;

This \connect line is being treated as data, as is the create.. line,
which means the members database is not created.

Apart from separating out all the data (COPY blocks) from the command
lines, and running two or more separate routines to update the data, is
there anything I can do?


Si.


--
  "Is it farther to New York or by plane?"

   Simon Drabble                  madlather@syspac.com


Re: [GENERAL] psql -e problem

From
Bruce Momjian
Date:
Sounds like an OS bug.

> Just upgraded to 6.4.2 from 6.3.2 and I've got a bit of a problem.
>
> Compiled, installed, regressed(?) all went fine. Come to load up the old
> datbases, and it appears that \. is not being recognised as end-of-input
> in the database dump file (I did a pg_dumpall -z, if that helps).
>
> For example, I have some data as follows, which should be read in up to
> the \. line, but the \. lines appears to not be recognised/ handled,
> causing the following lines to be treated as data, which leads to the
> commands not being executed...
>
>
> COPY stats FROM stdin;
> 11.5    2.5     07-11-1998
> 12      3       07-16-1998
> 12      3       07-19-1998
> 14      4       07-30-1998
> 14      4       08-06-1998
> 15      4.5     08-15-1998
> 15      4.5     08-24-1998
> 16.5    5       08-30-1998
> 18.5    5       09-13-1998
> 20      5.5     09-20-1998
> 23      6       10-05-1998
> \.
> \connect template1 simon
> create database members;
>
> This \connect line is being treated as data, as is the create.. line,
> which means the members database is not created.
>
> Apart from separating out all the data (COPY blocks) from the command
> lines, and running two or more separate routines to update the data, is
> there anything I can do?
>
>
> Si.
>
>
> --
>   "Is it farther to New York or by plane?"
>
>    Simon Drabble                  madlather@syspac.com
>
>
>


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

Re: [GENERAL] psql -e problem

From
Simon Drabble
Date:
On Fri, 5 Feb 1999, Bruce Momjian wrote:

> Sounds like an OS bug.

o...k...

Linux is famous for this sort of behaviour, I shoulda guessed.


Anyone else with perhaps a more helpful idea?


Simon.



>
> > Just upgraded to 6.4.2 from 6.3.2 and I've got a bit of a problem.
> >
> > Compiled, installed, regressed(?) all went fine. Come to load up the old
> > datbases, and it appears that \. is not being recognised as end-of-input
> > in the database dump file (I did a pg_dumpall -z, if that helps).
> >
> > For example, I have some data as follows, which should be read in up to
> > the \. line, but the \. lines appears to not be recognised/ handled,
> > causing the following lines to be treated as data, which leads to the
> > commands not being executed...
> >
> >
> > COPY stats FROM stdin;
> > 11.5    2.5     07-11-1998
> > 12      3       07-16-1998
> > 12      3       07-19-1998
> > 14      4       07-30-1998
> > 14      4       08-06-1998
> > 15      4.5     08-15-1998
> > 15      4.5     08-24-1998
> > 16.5    5       08-30-1998
> > 18.5    5       09-13-1998
> > 20      5.5     09-20-1998
> > 23      6       10-05-1998
> > \.
> > \connect template1 simon
> > create database members;
> >
> > This \connect line is being treated as data, as is the create.. line,
> > which means the members database is not created.
> >
> > Apart from separating out all the data (COPY blocks) from the command
> > lines, and running two or more separate routines to update the data, is
> > there anything I can do?
> >
> >
> > Si.
> >
> >
> > --
> >   "Is it farther to New York or by plane?"
> >
> >    Simon Drabble                  madlather@syspac.com
> >
> >
> >
>
>
> --
>   Bruce Momjian                        |  http://www.op.net/~candle
>   maillist@candle.pha.pa.us            |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
>

--
  "Is it farther to New York or by plane?"

   Simon Drabble                  madlather@syspac.com