Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id JAA23799 for postgres-redist; Mon, 11 Sep 1995 09:37:57 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199509111637.JAA23799@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from serv1.cl.msu.edu (serv1.cl.msu.edu [35.8.2.41]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id JAA25389 for <postgres@nobozo.CS.Berkeley.EDU>; Mon, 11 Sep 1995 09:37:56 -0700
From: kang@risca.rs.msu.edu
Received: from risca.rs.msu.edu by serv1.cl.msu.edu (4.1/MSU-2.09)
 id AA03848; Mon, 11 Sep 95 12:37:48 EDT
Received: by risca.rs.msu.edu (AIX 3.2/UCB 5.64/4.03)
          id AA15290; Mon, 11 Sep 1995 11:49:16 -0400
Date: Mon, 11 Sep 1995 11:49:16 -0400
Message-Id: <9509111549.AA15290@risca.rs.msu.edu>
To: postgres@postgres.Berkeley.EDU
Subject: Does psql -f filename work?
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Mon, 11 Sep 95 09:37:56 -0700
Resent-XMts: smtp



Hi,
I am running pg95 Beta 0.03 from Linux 1.2.11 without ELF.  There is an option
"-f filename	use file as a source of queries" when initiating psql command.

I tried the followings:
psql -d mydb -f my_source_file
psql -f my_source_file -d mydb

It always give me the following error message:
Connecting to database 'my_source_file' failed.
FATAL 1" database my_source_file does not exist, bailing out ...

It seems that the entry after -f has become the db name in psql.
Can the -f co-exist with -d?

I have to use a shell script like this:
psql -d mydb <<!
\i my_source_file
\q
!

Kang,


==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
