Waiting for 8.4 – storage types for table columns

Gregory Stark wrote, and Bruce Momjian committed (on 14th of July) patch which shows storage type in psql.

Log Message:
Add column storage type to psql \d+ display.
Gregory Stark

How does it work? It's pretty simple. Let's create new table:

# CREATE TABLE testit (i int4, ts TIMESTAMP, t text, z VARCHAR(10), z255 VARCHAR(255));

And see \d+ of it:

# \d+ testit
                           Table "public.testit"
 Column |            Type             | Modifiers | Storage  | Description
 i      | integer                     |           | plain    |
 ts     | timestamp without time zone |           | plain    |
 t      | text                        |           | extended |
 z      | character varying(10)       |           | extended |
 z255   | character varying(255)      |           | extended |
Has OIDs: no

As you can see there is new column which has some new information.

In case you don't know what plain/extended (or external or main) means, please consult the documentation.

Basically, if it says anything else than plain, real data of this column is (or might be) in separate, system, tables – so called “toast tables".

If the storage is main or extended, it means the data in given column is compressed (PostgreSQL uses very fast compression algorithm from the LZ family).

One thought on “Waiting for 8.4 – storage types for table columns”

  1. Both last things are quite interesting, while not adding real value to PostgreSQL itself.
    Sounds like the eye-candy I see in modern desktop environment (as nice as useless).
    tThese two things can have some real use, though.

Comments are closed.