Friday, March 1, 2019

PostgreSQL's psql \set vs. SET

It is easy for someone who is new to PostgreSQL and who uses PostgreSQL's terminal editor psql to confuse the commands\set and SET. This post contrasts these commands and provides a brief overview of other commands that include the word "set."

The easiest way to remember how to differentiate \set from SET is to keep in mind that the "backslash commands" such as \set are "meta commands" for the command-line psql tool and do not mean anything to the PostgreSQL database itself. The SET command, which lacks a backslash, is a PostgreSQL database command that happens to be executed against the database from the psql command-line client.



from DZone.com Feed https://ift.tt/2VtVE5A

No comments:

Post a Comment