We are using Redshift which is using Postgres 8.
I need to compare (2) tables which will almost be identical, but the other table will have extra columns so, I need to find out the column difference.
Example:
CREATE TABLE table1 (
v_id character varying(255) NOT NULL,
v_created timestamp without time zone NOT NULL,
abc_102 boolean,
abc_103 boolean,
abc_104 boolean,
def_56 boolean DEFAULT false NOT NULL,
def_57 boolean DEFAULT false NOT NULL
)
CREATE TABLE table2 (
v_id character varying(255) NOT NULL,
v_created timestamp without time zone NOT NULL,
abc_102 boolean,
abc_103 boolean,
abc_104 boolean,
abc_105 boolean,
def_56 boolean DEFAULT false NOT NULL,
def_57 boolean DEFAULT false NOT NULL,
def_58 boolean DEFAULT false NOT NULL,
)
What query can I use that will give me a list of the column differences?