postgresql column ordering

Solutions on MaxInterview for postgresql column ordering by the best coders in the world

showing results for - "postgresql column ordering"
Emie
10 Jan 2020
1SELECT a.attname, t.typname, t.typalign, t.typlen
2  FROM pg_class c
3  JOIN pg_attribute a ON (a.attrelid = c.oid)
4  JOIN pg_type t ON (t.oid = a.atttypid)
5 WHERE c.relname = 'user_order'
6   AND a.attnum >= 0
7 ORDER BY t.typlen DESC;
8
9   attname   |   typname   | typalign | typlen 
10-------------+-------------+----------+--------
11 id          | int8        | d        |      8
12 user_id     | int8        | d        |      8
13 order_dt    | timestamptz | d        |      8
14 ship_dt     | timestamptz | d        |      8
15 receive_dt  | timestamptz | d        |      8
16 item_ct     | int4        | i        |      4
17 order_type  | int2        | s        |      2
18 is_shipped  | bool        | c        |      1
19 tracking_cd | text        | i        |     -1
20 ship_cost   | numeric     | i        |     -1
21 order_total | numeric     | i        |     -1
22