Thanks to all who answered this question!

From: Brent Wood <[EMAIL PROTECTED]>
To: basel novo <[EMAIL PROTECTED]>
CC: pgsql-general@postgresql.org
Subject: Re: [GENERAL] newbie question: reading sql commands from script
Date: Wed, 26 Oct 2005 10:36:34 +1300 (NZDT)



On Tue, 25 Oct 2005, basel novo wrote:

> What is the equivalent of the mysql 'source' command for reading sql
> commands from ascii script files?
>

I have not used mysql, so am not familiar with the source command, but to
have postgres run a set of sql statements/queries from a file you can:

psql <DB> -f "filename"



also, to run a single command from a script (or commandline)

psql <DB> -c "<sql command>"



Cheers,

  Brent Wood

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to