Re: Combine psql command with shell script - Mailing list pgsql-general

From John R Pierce
Subject Re: Combine psql command with shell script
Date
Msg-id 49B75EBC.4010309@hogranch.com
Whole thread Raw
In response to Combine psql command with shell script  (John Wang <johnw822003@yahoo.com>)
List pgsql-general
John Wang wrote:
> How to combine psql commands, such as "\copy", with shell script? Is there any sample code? For example, I have 10
tablesand want to user the "\copy" command to import data from 10 different text files. I can execute the "\copy"
command10 times. But it is not convenient. 
>


$ psql .... -f filename.sql

where filename.sql contains whatever stack of commands you wanna run.

pgsql-general by date:

Previous
From: John Wang
Date:
Subject: Combine psql command with shell script
Next
From: "A. Kretschmer"
Date:
Subject: Re: Combine psql command with shell script