Re: [GENERAL] Need help with bash script and postgresql

2007-07-24 Thread [EMAIL PROTECTED]
On Jul 23, 6:11 am, [EMAIL PROTECTED] ("Raymond O'Donnell") wrote: > On 23/07/2007 11:04, Andy Dale wrote: > > > The posgres command in the loop should look like so (not sure about the > > password): > > As I understand it, you supply the password via a pgpass file - you > can't include it on the c

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Scott Marlowe
On 7/23/07, Chuck Payne <[EMAIL PROTECTED]> wrote: Hey, I have spend the last several days looking for a website or how to that would show me how to call postgresql in bash script. I know that in mysql I can do like this for i in `cat myfile.txt` ; do mysql -uxxx -p -Asse mydatabase "inse

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Raymond O'Donnell
On 23/07/2007 14:51, Perry Smith wrote: Ah... I knew that. I always assume it does, then it doesn't work, then I look at the man page. Sorry. Been there, still wearing the t-shirt! :-) Ray. --- Raymond O'Donnell, Director of Mus

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Perry Smith
On Jul 23, 2007, at 8:32 AM, Raymond O'Donnell wrote: On 23/07/2007 14:22, Perry Smith wrote: First, you can specify a password with -P (I think --password works also). psql --help for optins. -P doesn't specify the password - see below: C:\Documents and Settings\rod>psql --help This is p

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Raymond O'Donnell
On 23/07/2007 14:22, Perry Smith wrote: First, you can specify a password with -P (I think --password works also). psql --help for optins. -P doesn't specify the password - see below: C:\Documents and Settings\rod>psql --help This is psql 8.2.4, the PostgreSQL interactive terminal. Usage:

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Perry Smith
First, you can specify a password with -P (I think --password works also). psql --help for optins. Usually the DB defaults to trusting everything local (if I'm not mistaken -- someone please correct me if I'm over simplifying). As far as getting your data into the database, I would look at

Re: {Spam} [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Dimitri Fontaine
Hi, Le lundi 23 juillet 2007, Chuck Payne a écrit : > for i in `cat > myfile.txt` ; do mysql -uxxx -p -Asse mydatabase  "insert > into mytable  (aaa,bbb) values ("xxx", > "yyy");" It seems a part of your problem is not about scripting psql but loading data into PostgreSQL, so let me present

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Pavel Stehule
Hello I don't understand well, what you want to do. You can cat myfile.txt | psql database or like your sample for i in `cat myfile.txt` ; do psql mydatabase -c "insert into mytable (aaa,bbb) values ("xxx", "yyy");" ... regards Pavel Stehule 2007/7/23, Chuck Payne <[EMAIL PROTECTED]>:

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Raymond O'Donnell
On 23/07/2007 11:04, Andy Dale wrote: The posgres command in the loop should look like so (not sure about the password): As I understand it, you supply the password via a pgpass file - you can't include it on the command line. Ray. --

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Ow Mun Heng
On Mon, 2007-07-23 at 05:34 -0400, Chuck Payne wrote: > > Hey, > > I have spend the last several days looking for a website or how to > that would show me how to call postgresql in bash script. I know that > in mysql I can do like this > > for i in `cat myfile.txt` ; do mysql -uxxx -p -Ass

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Andy Dale
Hi Chuck, I am no expert but this should definitely be possible with postgres. The posgres command in the loop should look like so (not sure about the password): psql -U -d mydatabase -c ""insert into mytable (aaa,bbb) values ('xxx', 'yyy');" Cheers, Andy On 23/07/07, Chuck Payne <[EMAIL P

[GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Chuck Payne
Hey, I have spend the last several days looking for a website or how to that would show me how to call postgresql in bash script. I know that in mysql I can do like this for i in `cat myfile.txt` ; do mysql -uxxx -p -Asse mydatabase  "insert into mytable  (aaa,bbb) values ("xxx", "yyy");