Hi Mike
Thanks for letting me know postgresql won't accept this. I had a feeling it
wouldn't as it's more stringent than mysql. Well I guess I reinstate my
request that MODS has date granularity as an attribute :)
Mike: date validation isn't the only concern - it is sorting by date. So it
must be a date or timestamp field for postgres to sort it correctly.
Thanks,
Christiaan
On 2/5/07 3:23 PM, "Mike Rylander" <[log in to unmask]> wrote:
> On 5/2/07, Christiaan Kortekaas <[log in to unmask]> wrote:
>> Hi Ray
>>
>> Yes MySQL appears to allow that (and hopefully PostgreSQL will too). Thanks!
>
> If you want to use a DATE or TIMESTAMP field then Postgres won't
> accept that, and for good reason -- it's not a date (or timestamp).
> :) If data validation isn't a concern, you could just use a text
> field with a CHECK constraint to restrict input to your desired valid
> values.
>
>> I guess that will do as a workaround without any change to MODS. For some
>> reason I thought the DB would reject a date like that. Apologies for the
>> confusion, this will work nicely.
>
> Most data architects would consider this a "gotcha."
>
> http://sql-info.de/en/mysql/gotchas.html#1_14
>
> Just my $0.02 ...
>
> --miker
>
>>
>> Cheers,
>> Christiaan
>>
>>
>> On 30/4/07 11:48 PM, "Ray Denenberg, Library of Congress" <[log in to unmask]>
>> wrote:
>>
>>> From: "Christiaan Kortekaas" <[log in to unmask]>
>>>> The reason I can't just supply 2007-02 is because in the backend MODS is
>>>> being indexed in a relational database in a 'datetime' field which even if
>>>> you insert '2007-02' would store it as '2007-02-01'. It is necessary to
>>>> store it as a datetime field so I can do datetime sorting, searching etc.
>>>
>>> Would it be possible to store it as 2007-02-00? (Or 2007-02-99 depending on
>>> whether you want it sorted at top or bottom.)
>>>
>>> --Ray
>>
>> --
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Christiaan Kortekaas
>> Senior Library Systems Programmer
>> Library Technology Service
>> The University of Queensland, Australia QLD 4072
>> Telephone : (+61) (7) 3346 4337
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Christiaan Kortekaas
Senior Library Systems Programmer
Library Technology Service
The University of Queensland, Australia QLD 4072
Telephone : (+61) (7) 3346 4337
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|