Chinaunix首页 | 论坛 | 博客
  • 博客访问: 480433
  • 博文数量: 108
  • 博客积分: 25
  • 博客等级: 民兵
  • 技术积分: 1134
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-29 19:43
文章分类

全部博文(108)

文章存档

2016年(10)

2015年(9)

2014年(73)

2013年(16)

我的朋友

分类: 云计算

2016-09-22 16:22:59

we use below command to check which table has NO column encoding

点击(此处)折叠或打开

  1. SELECT database, schema || '.' || "table" AS "table", encoded, size
  2. FROM svv_table_info
  3. WHERE encoded='N'
  4. ORDER BY 2;

use below command to check the tables and columns which aren’t encoded b


点击(此处)折叠或打开

  1. SELECT trim(n.nspname || '.' || c.relname) AS "table",trim(a.attname) AS "column",format_type(a.atttypid, a.atttypmod) AS "type",
  2. format_encoding(a.attencodingtype::integer) AS "encoding", a.attsortkeyord AS "sortkey"
  3. FROM pg_namespace n, pg_class c, pg_attribute a
  4. WHERE n.oid = c.relnamespace AND c.oid = a.attrelid AND a.attnum > 0 AND NOT a.attisdropped and n.nspname NOT IN ('information_schema','pg_catalog','pg_toast') AND format_encoding(a.attencodingtype::integer) = 'none' AND c.relkind='r' AND a.attsortkeyord != 1 ORDER BY n.nspname, c.relname, a.attnum;

阅读(929) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~