Re: Extract from date field - Mailing list pgsql-novice

From Thom Brown
Subject Re: Extract from date field
Date
Msg-id BANLkTik5Xy52MTf8h5h0kx-fJwLw3utPxg@mail.gmail.com
Whole thread Raw
In response to Re: Extract from date field  (James David Smith <james.david.smith@gmail.com>)
List pgsql-novice
On 18 June 2011 18:02, James David Smith <james.david.smith@gmail.com> wrote:
> Thanks Thom.
>
> What does the ' ::int  ' bit do at the end?

That casts the whole lot to an int value so that it can be assigned to
the column you're updating.  Otherwise you could end up with an error
message saying the types don't match.

So ::int is equivalent to cast(column as int).

Thom

pgsql-novice by date:

Previous
From: James David Smith
Date:
Subject: Re: Extract from date field
Next
From: Thom Brown
Date:
Subject: Re: Extract from date field