X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D74AB540A7 for ; Sat, 23 Apr 2005 03:04:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 29877-05 for ; Sat, 23 Apr 2005 06:04:52 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by svr1.postgresql.org (Postfix) with ESMTP id E9D2654096 for ; Sat, 23 Apr 2005 03:04:50 -0300 (ADT) Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1DPDl5-00063T-00 for pgsql-sql@postgresql.org; Sat, 23 Apr 2005 08:04:51 +0200 Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1DPDl4-0008CB-00 for pgsql-sql@postgresql.org; Sat, 23 Apr 2005 08:04:50 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.35 #1) id 1DPDlq-0005Ce-00 for pgsql-sql@postgresql.org; Sat, 23 Apr 2005 08:05:38 +0200 Date: Sat, 23 Apr 2005 08:05:38 +0200 From: Andreas Kretschmer To: pgsql-sql@postgresql.org Subject: Re: [despammed] Insert psql commands inside a script Message-ID: <20050423060538.GA19935@webserv.wug-glas.de> Mail-Followup-To: Andreas Kretschmer , pgsql-sql@postgresql.org References: <2F1DE8CC97C00645B9FEA539982DA22401900D5A@USEA-EXCH4.na.uis.unisys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2F1DE8CC97C00645B9FEA539982DA22401900D5A@USEA-EXCH4.na.uis.unisys.com> X-DEST: 208 X-MSMail-Priority: High X-Message-Flag: The Windows platform is not just insecure - it's patently, blatantly, and unashamedly insecure by design. X-PrivatMail: kretschmer@kaufbach.delug.de X-OS: Linux - weil ich es mir Wert bin! X-Info: registrierter Linux-User 97922 http://counter.li.org User-Agent: mutt-ng 1.5.9i (Linux) X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:51ea9561fc3f6d9539a2acd743e4748c X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.347 tagged_above=0 required=5 tests=AWL, MISSING_MIMEOLE, X_MSMAIL_PRIORITY_HIGH X-Spam-Level: X-Archive-Number: 200504/354 X-Sequence-Number: 21247 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 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 ===