ICode9

精准搜索请尝试: 精确搜索
  • mysql、postgresql查询表字所有字段2021-12-21 15:33:07

    1、mysql查询表字所有字段 SHOW FULL COLUMNS FROM table_name; 解释: Field :字段名 Type:字段类型 Collation:字符集(mysql 5.0以上有) Null :是否可以为NULL Key:索引(PRI,unique,index) Default:缺省值 Extra:额外(是否 auto_increment) Privileges:权限 Comment:备注(mysql 5.0以上有) 2

  • postgreSQL常用sql2021-08-31 17:04:05

    查看表字段注释 Select a.attnum,(select description from pg_catalog.pg_description where objoid=a.attrelid and objsubid=a.attnum) as descript,a.attname,pg_catalog.format_type(a.atttypid,a.atttypmod) as data_type from pg_catalog.pg_attribute a where 1=1 and a.

  • PostgreSQL获取建表语句存储过程2021-06-07 11:53:20

    PG版本: PostgreSQL 11.11存储过程:create or replace function get_tab_ddl(tab_name varchar)returns text as $$declare    --定义变量    tab_ddl text;    curs refcursor;    tmp_col record;    tab_info record;begin     --获取表的pid、schema信息    open

  • PostgreSQL获取建表语句存储过程2021-06-07 11:32:22

    PG版本: PostgreSQL 11.11 存储过程: create or replace function get_tab_ddl(tab_name varchar)returns text as $$declare --定义变量 tab_ddl text; curs refcursor; tmp_col record; tab_info record;begin --获取表的pid、schema信息 open curs for SELECT c.oid,n.ns

  • PostgreSQL查看表、表索引、视图、表结构以及参数设置2019-10-16 12:01:49

    -- 表索引select * from pg_indexes where tablename='person_wechat_label';select * from pg_statio_all_indexes where relname='person_wechat_label';-- 所有表SELECT * FROM pg_tables;-- 所有视图SELECT * FROM pg_views;-- 表结构SELECT a.attnum,a.attname AS

  • postgresql9.1.1解析表结构2019-09-29 14:52:00

    pg_class,表,索引,序列,视图("关系")。字段:relname 表,索引,视图等的名字。relnamespace 包含这个关系的名字空间(模式)的 OID,对应pg_namespace.oidrelkind r = 普通表,i = 索引,S = 序列,v = 视图, c = 复合类型,s = 特殊,t = TOAST表 pg_namespace,名字空间(模式),字段:nspname 名字空间的名字nspowne

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有