2011-10-04 13:30 keltezéssel, Robert Buckley írta:
You also need to add a DEFAULT _expression_ and optionally make the sequence owned by the column: ALTER TABLE tablename ALTER COLUMN hist_id SET DEFAULT nextval('hist_id_seq'); ALTER SEQUENCE hist_id_seq OWNED BY tablename.hist_id; The "ALTER SEQUENCE ... OWNED BY ..." will make the sequence automatically dropped if this column or table is dropped.
-- ---------------------------------- Zoltán Böszörményi Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de http://www.postgresql.at/ |