Re: [NOVICE] copy commands and linefeeds
On Wed, 2007-09-19 at 11:19 -0700, Mija Lee wrote:
> Oliver: > > 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... > > Mija > >
--
Oliver Elphick olly@lfix.co.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.
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
Received on Wed Sep 19 17:14:02 2007
This archive was generated by hypermail 2.1.8
: Mon Oct 08 2007 - 17:49:38 EDT
|