Data Type : PostgreSQL A quick look
  • NULL Values :NULL values represent missing, unknown, or not-applicable values.
  • Characters : CHARACTER(n), CHARACTER VARYING(n), and TEXT.
    • TEXT column can store strings of any length.
    • string data should be within the escape characters  $$ 123.45$$ or '1234.56'  'Yony' ' s pizza '
    • \b backspace
    • \r carriage return
    • \n new line
    • \t tab characterr
  • NUMERIC 
    • exact numeric = SMALLINT, INTEGER,BIGINT
    • approximate : DOUBLE PRECISION , REAL
    • SERIAL and SEQUENCE: indexed numeric data
       
  • DATE value stores a century, year, month, and day
  • TIME value stores hours, minutes, seconds, and microseconds
  • INTERVAL represents a span of time.
Creating and Using Composite Types

CREATE TYPE address AS
(
street_number VARCHAR,
city VARCHAR,
state CHAR(2),
postal_code VARCHAR
);
ALTER TABLE emp ADD COLUMN home_address address;