Re: [despammed] Insert psql commands inside a script

From: Andreas Kretschmer <akretschmer(at)despammed(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: [despammed] Insert psql commands inside a script
Date: 2005-04-23 06:05:38
Message-ID: 20050423060538.GA19935@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

am 21.04.2005, um 17:19:23 -0500 mailte Letnes, David G. folgendes:
>
> I have used the psql -f /tmp/SelectCommands.sql before, but now I want
> to put the sql statement right in the shell script. I haven't had any
> luck. Is there a command I can use that will not point to a file for
> the sql instructions but right on the same line. I use very short psql
> commands and would like to do it all with 1 file.

echo "select bla from fasel" | psql -U <username> database

You can also use here documents, shell-variables and so on.

Regards, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Sean Davis 2005-04-23 12:05:58 Re: Looking for a way to sum integer arrays....
Previous Message Michael Fuhr 2005-04-23 05:50:55 Re: Insert psql commands inside a script