CREATE TABLE t_numeric_types (
    c_bigserial bigserial PRIMARY KEY,
    c_smallint smallint,
    c_integer integer,
    c_bigint bigint,
    c_decimal decimal,
    c_numeric numeric,
    c_real real,
    c_double_precision double precision
);

CREATE TABLE t_binary_types (
    id bigserial PRIMARY KEY,
    bytea_col bytea
);

CREATE TABLE t_character_types (
    id bigserial PRIMARY KEY,
    c_char char(4),
    c_varchar varchar(1000),
    c_text text
);

CREATE TABLE t_time_types (
    id bigserial PRIMARY KEY,
    c_time time,
    c_timetz time with time zone,
    c_timestamp timestamp,
    c_timestamptz timestamp with time zone
);

CREATE TABLE t_geometric_types (
    id bigserial PRIMARY KEY,
    point_col point,
    line_col line,
    lseg_col lseg,
    box_col box,
    path_col1 PATH,
    path_col2 PATH,
    polygon_col polygon,
    circle_col circle
);

CREATE TABLE t_network_types (
    id bigserial PRIMARY KEY,
    cidr_col cidr,
    inet_col inet,
    macaddr_col macaddr
);

CREATE TABLE t_bit_types (
    a bit(3),
    b bit varying(5)
);

CREATE TABLE t_json_types (
    id bigserial PRIMARY KEY,
    json_col json,
    jsonb_col jsonb
);

CREATE TABLE t_array_types (
    id bigserial PRIMARY KEY,
    int_array integer[],
    text_array text[],
    boolean_array boolean[]
);

CREATE TYPE address AS (
    street text,
    city text,
    state text,
    zipcode integer
);

CREATE TABLE t_complex_types (
    id bigserial PRIMARY KEY,
    address_col address
);

CREATE TABLE t_range_types (
    id bigserial PRIMARY KEY,
    int4range_col int4range,
    int8range_col int8range,
    numrange_col numrange,
    tsrange_col tsrange,
    tstzrange_col tstzrange,
    daterange_col daterange
);

CREATE DOMAIN email AS TEXT CHECK (value ~ '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$');

CREATE TABLE t_domain_types (
    id bigserial PRIMARY KEY,
    email_col email,
    age integer CHECK (age > 0)
);

