可以使用help
语句查看所有postgreSQL语句的语法。 按照以下步骤查看PostgreSQL中所有语句的语法。
psql
为:程序文件 -> PostgreSQL 9.2 -> SQL Shell(psql)
在这里,我们提供了所有postgreSQL语句及其语法的列表:
ABORT语句:
语法:
ABORT [ WORK | TRANSACTION ]
ALTER AGGREGATE语句:
语法:
ALTER AGGREGATE name ( type ) RENAME TO new_name ALTER AGGREGATE name ( type ) OWNER TO new_ownerALTER CONVERSION语句:
语法:
ALTER CONVERSION name RENAME TO new_name ALTER CONVERSION name OWNER TO new_owner
ALTER DATABASE语句:
语法:
ALTER DATABASE name SET parameter { TO | = } { value | DEFAULT } ALTER DATABASE name RESET parameter ALTER DATABASE name RENAME TO new_name ALTER DATABASE name OWNER TO new_ownerALTER DOMAIN语句:
语法:
ALTER DOMAIN name { SET DEFAULT expression | DROP DEFAULT } ALTER DOMAIN name { SET | DROP } NOT NULL ALTER DOMAIN name ADD domain_constraint ALTER DOMAIN name DROP CONSTRAINT constraint_name [ RESTRICT | CASCADE ] ALTER DOMAIN name OWNER TO new_ownerALTER FUNCTION语句:
语法:
ALTER FUNCTION name ( [ type [, ...] ] ) RENAME TO new_name ALTER FUNCTION name ( [ type [, ...] ] ) OWNER TO new_owner
ALTER GROUP语句:
语法:
ALTER GROUP groupname ADD USER username [, ... ] ALTER GROUP groupname DROP USER username [, ... ] ALTER GROUP groupname RENAME TO new_name
ALTER INDEX语句:
语法:
ALTER INDEX name OWNER TO new_owner ALTER INDEX name SET TABLESPACE indexspace_name ALTER INDEX name RENAME TO new_nameALTER LANGUAGE语句:
语法:
ALTER LANGUAGE name RENAME TO new_nameALTER OPERATOR语句:
语法:
ALTER OPERATOR name ( { lefttype | NONE } , { righttype | NONE } ) OWNER TO new_ownerALTER OPERATOR CLASS语句:
语法:
ALTER OPERATOR CLASS name USING index_method RENAME TO new_name ALTER OPERATOR CLASS name USING index_method OWNER TO new_ownerALTER SCHEMA语句:
语法:
ALTER SCHEMA name RENAME TO new_name ALTER SCHEMA name OWNER TO new_ownerALTER SEQUENCE语句:
语法:
ALTER SEQUENCE name [ INCREMENT [ BY ] increment ] [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] [ RESTART [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ]
ALTER TABLE语句:
语法:
ALTER TABLE [ ONLY ] name [ * ] action [, ... ] ALTER TABLE [ ONLY ] name [ * ] RENAME [ COLUMN ] column TO new_column ALTER TABLE name RENAME TO new_name