Re: Need help with bash script and postgresql - Mailing list pgsql-general

From Pavel Stehule
Subject Re: Need help with bash script and postgresql
Date
Msg-id 162867790707230309o31d05f37gd5fb5e17307c1605@mail.gmail.com
Whole thread Raw
In response to Need help with bash script and postgresql  ("Chuck Payne" <cpayne@magigames.net>)
Responses Re: Need help with bash script and postgresql
List pgsql-general
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 <cpayne@magigames.net>:
>
> 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 -pxxxx -Asse mydatabase  "insert
> into mytable  (aaa,bbb) values ("xxx", "yyy");"
>
> I have tried to do what with pgsql and it not working. I have looked at my
> two books I have and they are very limited.
>
> Can some what tell if postgre has flag like -Asse? Or show me a simple
> script they have do that is kinda like above.
>
> Thanks,
>
> Payne
>
> ----------------------------------------------------
> www.britishscifiexchange.com
> www.magigames.net

pgsql-general by date:

Previous
From: Ow Mun Heng
Date:
Subject: Re: Need help with bash script and postgresql
Next
From: Raymond O'Donnell
Date:
Subject: Re: Need help with bash script and postgresql