Hacker News new | ask | show | jobs
by samgaw 2643 days ago
It sounds like what you're asking for falls under a 'composite type'. So what you could do is something along the lines of:

  CREATE TYPE datetimetz AS (
    dt  timestamptz,
    tz  varchar
  );
Then in your table def you can call your new type to avoid multiple columns:

  CREATE TABLE example (
    id          integer,
    created_at  datetimetz
  );