query by partial timestamp - Mailing list pgsql-general

From Kirk Wythers
Subject query by partial timestamp
Date
Msg-id E24A44B2-52D8-43A7-9F24-3D56F65AA901@umn.edu
Whole thread Raw
Responses Re: query by partial timestamp  (Raymond O'Donnell <rod@iol.ie>)
Re: query by partial timestamp  (Steve Crawford <scrawford@pinpointresearch.com>)
Re: query by partial timestamp  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-general
I have a column of type TIMESTAMP, I'd like to query all records from 2011. If it were text I could use a partial such
as:

WHERE
    text ~ '2011'

There must be a simple way to pull the year part out of a timestamp format. Thanks in advance.




pgsql-general by date:

Previous
From: Todd Kover
Date:
Subject: Discerning when functions had execute revoked from public
Next
From: Raymond O'Donnell
Date:
Subject: Re: query by partial timestamp