如何阅读 PostgreSQL 命令的文档语法? [英] How do I read the documentation syntax for PostgreSQL commands?

查看:53
本文介绍了如何阅读 PostgreSQL 命令的文档语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从数据库 B 中的几个表在数据库 A 中创建一个表.我去了 PostgreSQL 的文档 此处 以了解如何使用方括号、条形、大括号、圆括号、粗体字和全大写字样等装饰命令的文档.

所有这些符号都表示该命令的内容是什么,请有人展示我将如何阅读文档以确定从数据库 B 中的表的选择查询中创建数据库 A 中的表的正确语法.

互联网是用于复制和粘贴基本 PostgreSQL 公式的绝佳资源,但我想超越复制和粘贴那些神奇的公式.

解决方案

约定 手册章节:

<块引用>

在命令概要中使用以下约定:方括号([])表示可选部分.(在 Tcl 命令的概要中,使用问号 (?) 代替,这在 Tcl 中很常见.)大括号({}) 和竖线 (|) 表示您必须选择一个选项.点 (...) 表示前面的元素可以重复.

所以 { a |b } 表示 ab[ stuff ] 表示 stuff 是可选的.此外,示例命令中的粗体文本表示您需要填写的内容,而固定宽度的文本是相关语法的文字部分.

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.

解决方案

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.

这篇关于如何阅读 PostgreSQL 命令的文档语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆