Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #5492 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] microsecond precision support for *times using postgresql

Reported by: alex@msgpad.com Assigned to: David
Priority: normal Milestone:
Component: ActiveRecord Version:
Severity: normal Keywords: postgresql
Cc:

Description

The finest time resolution without this patch is seconds. I needed microseconds, so here you go!

Patch summary:

  • The postgresql adapter will write with microsecond precision.
  • The string_to_[dummy_time|time] methods in schema_definitions incorporate a microsecond component. If Date._parse can't find a fractional second, then microseconds is set to 0. This affects all adapters but the new method is basically doing what the old ParseDate.parse method was doing implicitly, so other adapters should be fine.
  • Test case included.

I tested using both postgresql and mysql (which doesn't really support sub-second resolution) on revision 4487 before sending.

Alex.

Attachments

microsecond_precision.diff (3.9 kB) - added by alex@msgpad.com on 06/24/06 04:49:20.
microsecond precision for times. especially for postgresql.

Change History

06/24/06 04:49:20 changed by alex@msgpad.com

  • attachment microsecond_precision.diff added.

microsecond precision for times. especially for postgresql.

06/25/06 18:04:07 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.

(In [4494]) PostgreSQL: support microsecond time resolution. Closes #5492.