Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-19 Thread Lew
rawi wrote: Grails/Hibernate wishes per default one sequence for all tables-PKs and all PKs as BigInt. How is that a Hibernate default? Hibernate lets you define a multitude of types as a primary key, and the sequence each uses is a matter of XML or annotation configuration, at least in the

[SQL] extracting from epoch values in pgsql

2009-09-19 Thread Gavin McCullagh
Hi folks, I have a db that I need to draw some stats from. The db itself is from the web application moodle which, perhaps to be cross-platform, uses unix epoch times stored as integers throughout (see table description at end of mail). I'd like to query some stats based on the appearance of obje

Re: [SQL] extracting from epoch values in pgsql

2009-09-19 Thread Kenneth Marshall
On Thu, Sep 17, 2009 at 06:34:39PM +0100, Gavin McCullagh wrote: > On Thu, 17 Sep 2009, Gavin McCullagh wrote: > > > On Thu, 17 Sep 2009, Frank Bax wrote: > > > > > Gavin McCullagh wrote: > > >> SELECT time, to_timestamp(time) AS ts, > > >> EXTRACT('months',to_timestamp(time)) FROM mdl_log; > >

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-19 Thread Kenneth Marshall
On Thu, Sep 17, 2009 at 07:47:13AM -0700, rawi wrote: > > > Leo Mannhart wrote: > > > > Caveat: If you use the standard sequence generator in hibernate, it is > > not using the postgres-sequence in the "usual" manner. hibernate itself > > caches 50 ID's as sequence numbers by default. This means