[Dbix-class] Issues with postgres timestamp in a primary key

Matt S Trout dbix-class at trout.me.uk
Wed Jul 30 11:24:30 BST 2008


On Tue, Jul 29, 2008 at 08:04:40AM -0500, Todd Rinaldo wrote:
> > Oterwise, you'd need to either
> >
> > (a) figure out how to get back the timestamp value that was inserted and
> > patch Storage::DBI::Pg to handle it
> >
> > (b) add an option to insert() to say "I know my object is going to be
> > broken after I call this method and I don't care".
> >
> > And I don't think (a) is possible. I'd be happy enough to take a patch for
> > either or both on the ground of pragmatism over perfection :)
> 
> Matt, thanks for the advice, this pushed us into the right direction
> for thinking about this. We're just going to be explicit about the
> date stamp for now. My team mate may be getting back to the list with
> a patch for this. He's determined that this should work. I suspect
> it's going to have to be a DBD patch though.

That's fair enough, so long as he understands that we both want it
to work and think it's an incredibly bad idea to do it voluntarily.
 
> I have a third suggestion to solve this problem: Do you think it would
> be worth while to offer a create option where you would tell DBIC not
> to try to find the pkey when it's done? In this case, we didn't
> actually need the row back. We just needed to be sure it was inserted.

that's option (b). Remember create() is just sugar for new+insert.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list