we use below command to check which table has NO column encoding
-
SELECT database, schema || '.' || "table" AS "table", encoded, size
-
FROM svv_table_info
-
WHERE encoded='N'
-
ORDER BY 2;
use below command to check the tables and columns which aren’t encoded b
-
SELECT trim(n.nspname || '.' || c.relname) AS "table",trim(a.attname) AS "column",format_type(a.atttypid, a.atttypmod) AS "type",
-
format_encoding(a.attencodingtype::integer) AS "encoding", a.attsortkeyord AS "sortkey"
-
FROM pg_namespace n, pg_class c, pg_attribute a
-
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;
阅读(948) | 评论(0) | 转发(0) |