On Friday, January 13, 2017 at 6:50:04 AM UTC-8, George Millo wrote:
> I'm using postgresql, and I want to set the default value of a timestamp
> column to the current time. If I was writing pure PSQL with a CREATE TABLE
> I'd do something like column_name TIMESTAMP DEFAULT clock_timestamp(). Is
> there a way I can create a table like this without having to write too much
> raw SQL?
> I've tried:
> create_table :my_table do
> DateTime :my_timestamp, default: "clock_timestamp"
> but it fails with PG::InvalidDatetimeFormat: ERROR: invalid input syntax
> for type timestamp: "clock_timestamp()"
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to firstname.lastname@example.org.
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.