Re: Extract from date field

From: Thom Brown <thom(at)linux(dot)com>
To: James David Smith <james(dot)david(dot)smith(at)gmail(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Extract from date field
Date: 2011-06-18 17:23:40
Message-ID: BANLkTik5Xy52MTf8h5h0kx-fJwLw3utPxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 18 June 2011 18:02, James David Smith <james(dot)david(dot)smith(at)gmail(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Thom Brown 2011-06-18 17:54:50 Re: Extract from date field
Previous Message James David Smith 2011-06-18 17:02:14 Re: Extract from date field