Skip site navigation (1) Skip section navigation (2)

Re: sql files in psql ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mariateresa L <mariateresa(dot)ll(at)bresciaonline(dot)it>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: sql files in psql ?
Date: 2010-05-31 21:14:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Mariateresa L <mariateresa(dot)ll(at)bresciaonline(dot)it> writes:
> ... I want to pack everything in a nice shell script,
> with proper error control, automated file shuffling,
> predefined queries in text files and so on, but I cannot
> convince psql that the SQL commands (select, insert or
> copy...) it has to handle come from a file.
> I can submit  ("\i filename" or "psql --file filename")
> files that contains commands, eg starting with "\" but
> psql does not understand the same sintax if tne file
> contains a simple "SELECT * FROM tablex".

Really?  Works for most people.

> Am I uber-newbie or is this a known limitation of psql?

Well, you need to learn something about submitting trouble reports.
Show us exactly what you did (including what's in the file) and
exactly what error messages you got, rather than telling us what your
interpretation of the problem is.

			regards, tom lane

In response to


pgsql-novice by date

Next:From: Lonni J FriedmanDate: 2010-05-31 21:25:26
Subject: Re: psql in bash scrpts, is possible ?
Previous:From: Mariateresa LDate: 2010-05-31 21:05:38
Subject: sql files in psql ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group