Runs in single-line mode where a new line terminates an SQL command, as a semicolon does. That means the user is prompted before each command is sent to the server, with the option to cancel execution as well. Use separator as the record separator for unaligned output. R separator | -record-separator=separator This is equivalent to setting the variable QUIET to If this option is used, none of this happens. By default, it prints welcome messages and various informational output. Note that here you have to separate name and value with an equal sign instead of a space. Put all query output into the specified file.Īllows you to specify printing options in the style of This can be useful to turn off tab expansion when cutting and pasting. Write all query output into the specified log file, in addition to the normal output destination.ĭo not use Readline for line editing and do not use the command history. Other non-connection options are ignored. Use the specified separator as the field separator for unaligned output. F separator | -field-separator=separator On the other hand, the variant using the shell's input redirection is (in theory) guaranteed to yield exactly the same output you would have received had you entered everything by hand. There is also a slight chance that using this option will reduce the start-up overhead. f enables some nice features such as error messages with line numbers. In general, both will do what you expect, but using Using this option is subtly different from writing Note however that Readline is not used in this case (much as if -n had been specified). If filename is - (hyphen), then standard input is read until an EOF indication or \q meta-command. This is in many ways equivalent to the meta-command \i. After the file is processed, psql terminates. Use the file filename as the source of commands instead of reading commands interactively. This is equivalent to setting the variable ECHO_HIDDEN to = sign or starts with a valid URI prefix (Ĭonnection Strings in the PostgreSQL documentation for more information.Ĭopy all SQL commands sent to the server to standard output as well. This is equivalent to specifying dbname as the first non-option argument on the command line. Specifies the name of the database to connect to. Also, only the result of the last SQL command is returned. This is different from the behavior when the same string is fed to If the command string contains multiple SQL commands, they are processed in a single transaction, unless there are explicitīEGIN/COMMIT commands included in the string to divide it into multiple transactions. To achieve that, you could pipe the string into psql, like this: echo '\x \\ SELECT * FROM foo ' | psql Thus you cannot mix SQL and psql meta-commands with this option. command must be either a command string that is completely parseable by the server, or a single backslash command. Specifies that psql is to run the specified command string, and then exit. (This does not apply to lines read interactively.) This is equivalent to setting the variable ECHO to Print all nonempty input lines to standard output as they are read. In addition, it provides a number of meta-commands and various shell-like features to facilitate writing scripts and automating a wide variety of tasks. It enables you to type in queries interactively, issue them to Greenplum Database, and see the query results. Psql is a terminal-based front-end to Greenplum Database. Interactive command-line interface for Greenplum Database Synopsis psql ]
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |