The following problem has me stumped
SELECT string_agg(e.enumlabel, '|') as enum_value
FROM pg_type t
JOIN pg_enum e on t.oid = e.enumtypid
JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace
WHERE typname = 'contacts'
above|below|lateral|lateral-bottom|lateral-top|within
CREATE TABLE unit_contacts
(
id integer NOT NULL DEFAULT nextval('unit_contacts_id_seq1'::regclass),
unit_id integer NOT NULL,
old_contact contacts NOT NULL,
contact contacts NOT NULL,
old_with_unit integer NOT NULL,
with_unit integer NOT NULL,
CONSTRAINT unit_contacts__pkey PRIMARY KEY (id )
)
WITH (
OIDS=FALSE
);
mm=> INSERT INTO unit_contacts VALUES (15, 1, 'below', 'below', 8112, 2);
ERROR: malformed record literal: "below"
LINE 1: ...SERT INTO unit_contacts VALUES (15, 1, 'below', '...
I can't figure out why I am unable to insert the row at all.
insert into unit_contacts (id, unit_id, old_contact, ...) values (...)
? – Parodic