Hi,
I upgraded to Ruby 1.8.4 and whatever the latest Rails is as of March 29
2006.
I am using PostgreSQL 7.4.
With the earlier version of rails, I had insert queries that looked like
this:
Topic Create (0.001189) INSERT INTO topics (“inlibrary”,
“irx_display_title”, “irx_title”, “title”, “creation_stamp”,
“last_update_stamp”, “url”, “mime_type”, “irx_doc_path”, “dr_title”,
“irx_machine_id”, “source”, “keywords”) VALUES(‘t’, NULL, 'd gdssg sd5
gd5g ', NULL, ‘2006-03-29 10:49:23’, ‘2006-03-29 10:49:23’, NULL, NULL,
‘/irx/xml/DGdssgSd5Gd5g.xml’, ‘dgbtev sgdg d’, ‘DGdssgSd5Gd5g’, NULL,
NULL)
Note that creation_stamp and last_update_stamp (which are both defined
as timestamp without time zone | not null default
(‘now’::text)::timestamp(6) with time zone) are populated with the
current time. My code does not explicitly do that, so I’m not sure where
that came from.
With the new version of rails, the same query fails:
Topic Create (0.000000) PGError: ERROR: null value in column
“creation_stamp” violates not-null constraint
: INSERT INTO topics (“inlibrary”, “irx_display_title”, “irx_title”,
“title”, “creation_stamp”, “last_update_stamp”, “url”, “mime_type”,
“irx_doc_path”, “dr_title”, “irx_machine_id”, “source”, “keywords”)
VALUES(‘t’, NULL, 'd gdssg sd5 gd5g ', NULL, NULL, NULL, NULL, NULL,
‘/irx/xml/DGdssgSd5Gd5g.xml’, ‘dgbtev sgdg d’, ‘DGdssgSd5Gd5g’, NULL,
NULL)
Here the timestamp columns are inserted as null. I would prefer that the
insert not try to insert values for those columns, as the default will
put in the appropriate value. (For updating, I have a trigger that
accomplishes the same thing).
How can I fix this?