Re: date question - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: date question
Date
Msg-id Pine.LNX.4.44.0306171934390.2043-100000@peter.localdomain
Whole thread Raw
In response to date question  (javier garcia - CEBAS <rn001@cebas.csic.es>)
Responses Re: date question
List pgsql-sql
javier garcia - CEBAS writes:

> Is there a way to create a table from this table, directly in Postgres in
> which a date field is created based in the values of "year", "month", "day"
> in this table?

year * interval '1 year' + month * interval '1 month' + day * interval '1 day'

This results in a timestamp value that you can compare to or assign to a
date value.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-sql by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Our FLOAT(p) precision does not conform to spec
Next
From:
Date:
Subject: Re: disabling triggers