Re: Executing SQL commands in script files

From: "Andres Ledesma" <aledes(at)telefonica(dot)net>
To: "Susan Hoddinott" <susan(at)perth(dot)dialix(dot)com(dot)au>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Executing SQL commands in script files
Date: 2003-02-14 01:46:44
Message-ID: 001101c2d3ca$ee669530$02001aac@maradis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

psql < scriptfile.txt

or in a psql console

\i scriptfile.txt

----- Original Message -----
From: Susan Hoddinott
To: pgsql-novice(at)postgresql(dot)org
Sent: Thursday, February 13, 2003 5:15 AM
Subject: [NOVICE] Executing SQL commands in script files

Following reading through all the documentation it is not clear to me how to run a script file containing a number of SQL commands. Presumably I do this through the psql interface but how do I tell it to run a script?

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message simran 2003-02-14 01:49:45 Re: Executing SQL commands in script files
Previous Message Michael Weaver 2003-02-14 01:44:09 Returning result sets.