Using a function in a primary key field [message #4973] |
Wed, 02 September 2015 01:50 |
rafs
Messages: 69 Registered: May 2015
|
Member |
|
|
I also ran into a situation where I have a compound UNIQUE key (some_timestamp, some_type_id), and both fields are NOT NULL.
I wanted some_timestamp to get the value now()::timestamp(0) with time zone.
(This truncates the miliseconds from the timestamp which I don't want because I want only one record of this type per second.
But it seems the framework will test the UNIQUENESS and fail since now() is not a real value yet.
[Updated on: Wed, 02 September 2015 01:52] Report message to a moderator
|
|
|