On Wed, 2007-09-19 at 11:19 -0700, Mija Lee wrote:
> thanks so much for the help. Just for folks who might be looking on the list,
> Oliver's suggestion works with 8.1 and above:
> alter table mytable add check (mycolumn !~ E'[\n\r]');
> whereas this works on 8.0:
> alter table mytable add check (mycolumn !~ '\\r\\n');
But don't forget the square brackets: '[\\r\\n]'
otherwise you would match only a return followed by a linefeed rather
than either by itself.
> Maybe everyone already knows this...
Oliver Elphick olly(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
Do you want to know God? http://www.lfix.co.uk/knowing_god.html
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
In response to
pgsql-novice by date
|Next:||From: Chris Browne||Date: 2007-09-19 21:51:19|
|Subject: Re: ON INSERT => execute AWK/SH/EXE?|
|Previous:||From: Mija Lee||Date: 2007-09-19 18:19:43|
|Subject: Re: copy commands and linefeeds|