Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread Francisco Olarte
Hi Melvin: On Tue, Mar 15, 2016 at 3:57 PM, Melvin Davidson wrote: > What you really want is > "ON_ERROR_STOP ... > So just > SET ON_ERROR_STOP = ON > before any other statements IIRC you are right with the variable ... BUT .. it is a psql setting, not a session setting, so he'll probably need t

Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread Albe Laurenz
John McKown wrote: > I'm likely abusing the psql program. What I have is an awk program which > reads a file and produces a > number of INSERT INTO commands. I then feed these commands into psql to > execute them. Yes, a Perl > program would be a better idea. Anyway, sometimes the commands are re

Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread John McKown
On Tue, Mar 15, 2016 at 9:57 AM, Melvin Davidson wrote: > > > On Tue, Mar 15, 2016 at 10:49 AM, John McKown < > john.archie.mck...@gmail.com> wrote: > >> On Tue, Mar 15, 2016 at 9:38 AM, Adrian Klaver > > wrote: >> >>> On 03/15/2016 07:33 AM, John McKown wrote: >>> I'm likely abusing the psq

Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread Melvin Davidson
On Tue, Mar 15, 2016 at 10:49 AM, John McKown wrote: > On Tue, Mar 15, 2016 at 9:38 AM, Adrian Klaver > wrote: > >> On 03/15/2016 07:33 AM, John McKown wrote: >> >>> I'm likely abusing the psql program. What I have is an awk program which >>> reads a file and produces a number of INSERT INTO com

Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread John McKown
On Tue, Mar 15, 2016 at 9:38 AM, Adrian Klaver wrote: > On 03/15/2016 07:33 AM, John McKown wrote: > >> I'm likely abusing the psql program. What I have is an awk program which >> reads a file and produces a number of INSERT INTO commands. I then feed >> these commands into psql to execute them.

Re: [GENERAL] psql question: aborting a "script"

2016-03-15 Thread Adrian Klaver
On 03/15/2016 07:33 AM, John McKown wrote: I'm likely abusing the psql program. What I have is an awk program which reads a file and produces a number of INSERT INTO commands. I then feed these commands into psql to execute them. Yes, a Perl program would be a better idea. Anyway, sometimes the c

[GENERAL] psql question: aborting a "script"

2016-03-15 Thread John McKown
I'm likely abusing the psql program. What I have is an awk program which reads a file and produces a number of INSERT INTO commands. I then feed these commands into psql to execute them. Yes, a Perl program would be a better idea. Anyway, sometimes the commands are rejected due to some problem, suc

Re: [GENERAL] psql question

2013-01-31 Thread Little, Douglas
rch.com] Sent: Wednesday, January 30, 2013 4:49 PM To: Little, Douglas Cc: PostgreSQL General (pgsql-general@postgresql.org) Subject: Re: [GENERAL] psql question On 01/30/2013 01:51 PM, Little, Douglas wrote: I'm looking for a way where I can tailor DDL scripts for deployment with environm

Re: [GENERAL] psql question

2013-01-30 Thread Tom Lane
Steve Crawford writes: > On 01/30/2013 01:51 PM, Little, Douglas wrote: >> p1gp1=> \set env dev >> p1gp1=> \i P1GP1_ETL_STAGE_TBLS_BIO6113_100.:env.sql >> P1GP1_ETL_STAGE_TBLS_BIO6113_100.:env.sql: No such file or directory >> >> Any thoughts on how I might get this to work? > Perhaps try concat

Re: [GENERAL] psql question

2013-01-30 Thread Steve Crawford
On 01/30/2013 01:51 PM, Little, Douglas wrote: I'm looking for a way where I can tailor DDL scripts for deployment with environment variables. Support I have a requirement to prefix table names with dev_ , fqa_, or prod_ I'd like to have a file for each env with their own unique settings -

[GENERAL] psql question

2013-01-30 Thread Little, Douglas
I'm looking for a way where I can tailor DDL scripts for deployment with environment variables. Support I have a requirement to prefix table names with dev_ , fqa_, or prod_ I'd like to have a file for each env with their own unique settings - host, dbname Dev.sql \set env dev Fq

[GENERAL] psql question on echo output

2005-02-02 Thread John DeSoi
I have output set to go to a file with \o. Now I want to process a file with \i. With ECHO set to all, I would like the statement to be echoed in the file before the output, but instead it comes to the screen (standard output). Is there some setting or trick I missed to accomplish this? I reali

Re: [GENERAL] Psql Question

2000-09-19 Thread Peter Eisentraut
Danny writes: > mydb=# INSERT INTO Customer >(Customer_ID,Customer_Name,Customer_Address,Customer_Email) > mydb-# VALUES ('1','Danny Ho','99 Second Ave, Kingswood','[EMAIL PROTECTED]'), > mydb-# ('2','Randal Handel','54 Oxford Road, Cambridge','[EMAIL PROTECTED]') > mydb-# ; > > -and I get the

Re: [GENERAL] Psql Question

2000-09-18 Thread He Weiping (Laser Henry)
Danny wrote: > - Hello > - I had previous experience with Access and MySQL. > > -Situation > > - I am trying to create the equvilant of the following which is a mysql > command. > > - Queston > - But I cannot figure out how to do this is postgresql > > "mysql -u root -p mydb < mydb.dump" > I thi

[GENERAL] Psql Question

2000-09-18 Thread Danny
- Hello - I had previous experience with Access and MySQL. -Situation - I am trying to create the equvilant of the following which is a mysql command. - Queston - But I cannot figure out how to do this is postgresql "mysql -u root -p mydb < mydb.dump" - I was trying to create a test databa