pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding", d.datcollate as "Collate", d.datctype as "Ctype", pg_catalog.array_to_string(d.datacl, E'\n') AS "Access privileges" FROM pg_catalog.pg_database d ORDER BY 1; 1. 2. 3. 4. 5. 6. 7. 8. 数据库的encoding 是UTF8...
"age" int4 NOT NULL, "gender" varchar(10) COLLATE "pg_catalog"."default" NOT NULL, "address" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, "phone" varchar(20) COLLATE "pg_catalog"."default" NOT NULL, "grade" varchar(20) COLLATE "pg_catalog"."default" NOT NULL, CONSTRAINT...
idcharactervarying(128)COLLATEpg_catalog."default"NOTNULL, namecharactervarying(100)COLLATEpg_catalog."default"NOTNULL, moneydouble precision, daysinteger, create_timetimestampwithouttimezoneNOTNULL,CONSTRAINTsome_info_pkeyPRIMARYKEY (id) ) TABLESPACE pg_default;ALTERTABLEschema2023.some_info OWNERtopostg...
pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding", d.datcollate as "Collate", d.datctype as "Ctype", pg_catalog.array_to_string(d.datacl, E'\n') AS "Access privileges" FROM pg_catalog.pg_database d ORDER BY 1;
CREATE TABLE "public"."t_user" ( "id" int8 NOT NULL DEFAULT nextval( 'upms_log_id_seq' :: regclass ), "name" VARCHAR ( 255 ) COLLATE "pg_catalog"."default", "phone" VARCHAR ( 255 ) COLLATE "pg_catalog"."default", "birthday" TIMESTAMP ( 6 ), "sex" VARCHAR ( 64 ) COLLATE...
CREATEORREPLACEFUNCTION"public"."func1"()RETURNS"pg_catalog"."void"AS$BODY$--returnsvoid,在保存的时候自动会变成"pg_catalog"."void"BEGIN--建表语句 create tablea(id int4,namevarchar(50));END$BODY$LANGUAGEplpgsqlVOLATILECOST100 返回基本类型 ...
pg_stat_io 首先我最感兴趣的是 pg_stat_io,顾名思义——I/O 类的统计信息 postgres=#\dpg_stat_ioView"pg_catalog.pg_stat_io"Column|Type|Collation|Nullable|Default---+---+---+---+---backend_type|text|||object|text|||context|text|||reads|bigint|||read_time|doubleprecision|||write...
创建PG的表脚本 DROP TABLE IF EXISTS"public"."t_resource_info"; CREATE TABLE"public"."t_resource_info"("area_code"varchar(255) COLLATE"pg_catalog"."default"NOT NULL DEFAULT NULL::character varying,"id"int4 NOT NULL DEFAULT NULL,"resource_title"varchar(1024) COLLATE"pg_catalog"."default"...
$pg_ctl -D /usr/local/ pg12.2/data start 创建用户:create role 同步用的用户名 login replication encrypted password '密码'; postgres=# create role repl login replication encrypted password 'repl'; CREATE ROLE postgres=#\q --退出psql
PostgreSQL从小白到专家,是从入门逐渐能力提升的一个系列教程,内容包括对PG基础的认知、包括安装使用、包括角色权限、包括维护管理、、等内容,希望对热爱PG、学习PG的同学们有帮助,欢迎持续关注CUUG PG技术大讲堂。 第44讲:流复制部署 PostgreSQL第44讲:2月3日(周六)19:30,钉钉群(35822460)& 视频号(数据库老陈)直...