Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on"fields

2006-10-01 Thread Jonathan Vanasco
On Oct 1, 2006, at 1:10 PM, Uwe Voelker wrote: > What do you mean by that? MySQL has 'NOW()' - how does that differ? NOW() in mysql means 'now' as in the moment in time when 'now()' was called NOW() in pgsql means 'now' as in the moment in time where the transaction that NOW() sits in was b

Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on"fields

2006-10-01 Thread Jonathan Vanasco
On Oct 1, 2006, at 1:10 PM, Uwe Voelker wrote: > What do you mean by that? MySQL has 'NOW()' - how does that differ? NOW() in mysql means 'now' as in the moment in time when 'now()' was called NOW() in pgsql means 'now' as in the moment in time where the transaction that NOW() sits in was b

Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on"fields

2006-10-01 Thread John Siracusa
On 10/1/06 1:10 PM, Uwe Voelker wrote: >> Keep in mind that there's a subtle difference between "now" used in a >> database like Pg that understands the value, and "now" used in a db like >> MySQL that doesn't. > > What do you mean by that? MySQL has 'NOW()' - how does that differ? There's a diff

Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on"fields

2006-10-01 Thread Uwe Voelker
Hello John, > Keep in mind that there's a subtle difference between "now" used in a > database like Pg that understands the value, and "now" used in a db like > MySQL that doesn't. What do you mean by that? MySQL has 'NOW()' - how does that differ? Thanks, Uwe --

Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on"fields

2006-10-01 Thread John Siracusa
On 10/1/06 11:11 AM, Randal L. Schwartz wrote: > And 'now' it simplifies a bunch of my code. Keep in mind that there's a subtle difference between "now" used in a database like Pg that understands the value, and "now" used in a db like MySQL that doesn't. When "now" is evaluated by the database i

Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on"fields

2006-10-01 Thread Randal L. Schwartz
> "John" == John Siracusa <[EMAIL PROTECTED]> writes: John> On 10/1/06 10:44 AM, Randal L. Schwartz wrote: >> Is "now" a special value? I thought I had to always give a DateTime >> object there? >> >> And of course, you'll point out that this is documented in the most >> precise spot already

Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on"fields

2006-10-01 Thread John Siracusa
On 10/1/06 10:32 AM, Randal L. Schwartz wrote: > it doesn't permit my userland code to set a forced value for 'modified' (since > the code here is always setting it). I was trying to think through a solution > to that and didn't come up with one. One way to do that would be to add an on_set trigg

Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on"fields

2006-10-01 Thread John Siracusa
On 10/1/06 10:44 AM, Randal L. Schwartz wrote: > Is "now" a special value? I thought I had to always give a DateTime > object there? > > And of course, you'll point out that this is documented in the most > precise spot already, which is never the obvious spots. :) You have to follow the trail o

Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on"fields

2006-10-01 Thread Randal L. Schwartz
> "John" == John Siracusa <[EMAIL PROTECTED]> writes: John> sub save John> { John> my($self) = shift; John> $self->last_modified('now'); John> return $self->SUPER::save(@_); John> } Is "now" a special value? I thought I had to always give a DateTime object there? And of co

Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on"fields

2006-10-01 Thread John Siracusa
On 10/1/06 7:13 AM, Ask Bjørn Hansen wrote: > With RDBO we've so far just used "TIMESTAMP" columns, but now we have > a table where we need to keep track of both when the entry was > created and when it was last updated. MySQL can't do that > automatically, so now I'd like to make RDBO do it. >

Re: [RDBO] RDBO "triggers" to update "last_updated" / "created_on" fields

2006-10-01 Thread Randal L. Schwartz
> "Ask" == Ask Bjørn Hansen <[EMAIL PROTECTED]> writes: Ask> Hi, Ask> With CDBI I'd often use the "trigger" system to update/maintain Ask> "created_on" and "last_updated" fields. Ask> With RDBO we've so far just used "TIMESTAMP" columns, but now we have Ask> a table where we need to keep

[RDBO] RDBO "triggers" to update "last_updated" / "created_on" fields

2006-10-01 Thread Ask Bjørn Hansen
Hi, With CDBI I'd often use the "trigger" system to update/maintain "created_on" and "last_updated" fields. With RDBO we've so far just used "TIMESTAMP" columns, but now we have a table where we need to keep track of both when the entry was created and when it was last updated. MySQL can'