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: 19627.1275340485@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

Responses

Browse pgsql-novice by date

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