File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.48 2001/05/06 17:21:11 petere Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.49 2001/05/06 17:38:31 petere Exp $
3
3
Postgres documentation
4
4
-->
5
5
@@ -1292,6 +1292,12 @@ Access permissions for database "test"
1292
1292
After the file is processed, <application>psql</application> terminates.
1293
1293
This is in many ways equivalent to the internal command <command>\i</command>.
1294
1294
</para>
1295
+
1296
+ <para>
1297
+ If <replaceable>filename</replaceable> is <literal>-</literal>
1298
+ (hyphen), then standard input is read.
1299
+ </para>
1300
+
1295
1301
<para>
1296
1302
Using this option is subtly different from writing
1297
1303
<literal>psql < <replaceable class="parameter">filename</replaceable></literal>.
Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright 2000 by PostgreSQL Global Development Group
5
5
*
6
- * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.46 2001/03/23 00:36:38 tgl Exp $
6
+ * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.47 2001/05/06 17:38:32 petere Exp $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
@@ -230,7 +230,7 @@ main(int argc, char *argv[])
230
230
/*
231
231
* process file given by -f
232
232
*/
233
- if (options .action == ACT_FILE )
233
+ if (options .action == ACT_FILE && strcmp ( options . action_string , "-" ) != 0 )
234
234
{
235
235
if (!options .no_psqlrc )
236
236
process_psqlrc ();
@@ -290,6 +290,8 @@ main(int argc, char *argv[])
290
290
process_psqlrc ();
291
291
if (!pset .notty )
292
292
initializeInput (options .no_readline ? 0 : 1 );
293
+ if (options .action_string ) /* -f - was used */
294
+ pset .inputfile = "<stdin>" ;
293
295
successResult = MainLoop (stdin );
294
296
}
295
297
You can’t perform that action at this time.
0 commit comments