Re: issue with an assembled date field - Mailing list pgsql-general

From Tom Lane
Subject Re: issue with an assembled date field
Date
Msg-id 10264.1204310860@sss.pgh.pa.us
Whole thread Raw
In response to issue with an assembled date field  (Chris Bowlby <excalibur@accesswave.ca>)
Responses Re: issue with an assembled date field
List pgsql-general
Chris Bowlby <excalibur@accesswave.ca> writes:
>  I am converting an encoded field (lot_id) into a date field, the 5
> character of every lot_id is always the year and as such I need to
> extract the year using the following function:
>  substring(ilch.lot_id::text, 5, 1)

Well, I'd say that the failure proves that some of your data does
*not* have the year in the fifth character.

> ERROR:  invalid input syntax for type date: "01/01/0W"

Time for some data sanitizing?

            regards, tom lane

pgsql-general by date:

Previous
From: "Shane Wright"
Date:
Subject: Upgrade to 8.3.0?
Next
From: brian
Date:
Subject: Re: issue with an assembled date field