Re: copy commands and linefeeds - Mailing list pgsql-novice

From Oliver Elphick
Subject Re: copy commands and linefeeds
Date
Msg-id 1190236305.7954.94.camel@linda.lfix.co.uk
Whole thread Raw
In response to Re: copy commands and linefeeds  (Mija Lee <mija@scharp.org>)
List pgsql-novice
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.


pgsql-novice by date:

Previous
From: Mija Lee
Date:
Subject: Re: copy commands and linefeeds
Next
From: "Sandeep Agarwal"
Date:
Subject: Re: Null records in pg_operator