| From: | "basel novo" <baselnovo(at)hotmail(dot)com> |
|---|---|
| To: | b(dot)wood(at)niwa(dot)co(dot)nz |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: newbie question: reading sql commands from script |
| Date: | 2005-10-29 00:50:52 |
| Message-ID: | BAY106-F129EF374E8CD474F3F7846AE6A0@phx.gbl |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Thanks to all who answered this question!
>From: Brent Wood <b(dot)wood(at)niwa(dot)co(dot)nz>
>To: basel novo <baselnovo(at)hotmail(dot)com>
>CC: pgsql-general(at)postgresql(dot)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/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Robert Treat | 2005-10-29 01:47:17 | postgis / mediawiki / postgresql was Re: [Freegis-list] Re: [GENERAL] Map of Postgresql Users (OT) |
| Previous Message | Miguel | 2005-10-29 00:14:21 | Re: problems after pg_resetxlog |