The bucardo project has released its nagios plugins for PostgreSQL and we can extract from them this nice view in order to check for table and index bloatinto our PostgreSQL databases: 下面是检查表空间的使用情况的脚本: CREATE OR REPLACE VIEW bloat AS SELECT schemana…
warehouse_db=# create table item (item_id integer not null,item_name text,item_price numeric,item_data text);CREATE TABLEwarehouse_db=# create index item_idx on item(item_id);CREATE INDEX warehouse_db=# \di item_idx List of relations Schema | Name |…
postgresql数据库创建/修改/删除等写入类代码语法总结: 1,创建库 2,创建/删除表 2.1 创建表 create table myTableName 2.2 如果表不存在则创建表 create table if not exists myTableName 2.3 删除表 drop table if exists myTableName; 2.4 实例代码: drop table if exists myTableName; create table if not exists my…