Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I read the documentation syntax for PostgreSQL commands?

Tags:

postgresql

I want to create a table in database A from several tables in database B. I went to the PostgreSQL's documentation here to figure out how and the documentation for the command is decorated with brackets, bars, curly brackets, parenthesis, bold words and all-caps words, etc.

What do all of these symbols denote about the command and could somebody please show how I would read the documentation to determine what the correct syntax for creating a table in database A from a select query on a table in database B.

The internet has been a great resource for basic PostgreSQL formulas to copy and paste, but I'd like to move beyond copying and pasting formulas that just magically work.

like image 365
user12345678 Avatar asked Sep 28 '14 17:09

user12345678


1 Answers

The conventions are covered in the Conventions chapter of the manual:

The following conventions are used in the synopsis of a command: brackets ([ and ]) indicate optional parts. (In the synopsis of a Tcl command, question marks (?) are used instead, as is usual in Tcl.) Braces ({ and }) and vertical lines (|) indicate that you must choose one alternative. Dots (...) mean that the preceding element can be repeated.

So { a | b } means a or b and [ stuff ] means that stuff is optional. Furthermore, bold text in an example command represents something you need to fill in and fixed-width text is a literal part of the syntax in question.

like image 100
mu is too short Avatar answered Oct 17 '22 17:10

mu is too short