Re: How to add month.year column validation

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Andrus <kobruleht2(at)hot(dot)ee>
Cc: Andy Shellam <andy-lists(at)networkmail(dot)eu>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to add month.year column validation
Date: 2009-12-25 00:59:26
Message-ID: dcc563d10912241659g5349c706ne5019d551c688638@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Dec 24, 2009 at 4:47 PM, Andrus <kobruleht2(at)hot(dot)ee> wrote:
> Scott,
>
>> You can use the regex I posted to get rid of the data easily, then go
>> back to the substr one for  a check constraint after that.
>
> regex is non-standard.
> How to implement this in standard SQL ?

I take it you need a way to scrub your data in various databases, not
just pgsql? I'm not sure there is a simple SQL standard way. It's
likely that this one time job might require various non-standard ways
of scrubbing your data this one time. You're gonna have to figure
out how to make databases other than pgsql happy without me, the only
one I'm even a little familiar with is Oracle, and my oracle-fu is
rather rusty after a three year or so lay off from it.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2009-12-25 01:47:04 Re: date_trunc on date is immutable?
Previous Message Scott Marlowe 2009-12-25 00:56:26 Re: date_trunc on date is immutable?