[lug] Newbie question

rm at mamma.varadinet.de rm at mamma.varadinet.de
Fri Jul 13 02:15:15 MDT 2001


On Thu, Jul 12, 2001 at 12:19:26PM -0600, D. Stimits wrote:
> > > Also how do I run a .sql file?  I also need to attach a "\i" to the
> > > command???
> > >
> > 
> > I'll defer to someone else on this part.
> 
> That reminds me...what is "\i", escape notation for something uncommon?
> I guess I'm wondering, in the context of sql, what is the desired
> meaning of "\i"?

A hint of the original poster that he's using postgresql, i assume:-)
'\i' is used in 'psql' (postgresql's terminal based frontend) to load
an SQL-file from disk.

BTW, the easiest way to run an sql file (i consider sql a programming
language) is the following construct:

  /usr/bin/psql < file.sql 

or alternatively:

 /usr/bin/psql -f file.sql

The manpage of psql will tell you more. Just one more comment:

 Ralf



More information about the LUG mailing list