Re: psql can't subtract - Mailing list pgsql-general

From Richard Huxton
Subject Re: psql can't subtract
Date
Msg-id 4D8CBB64.1060408@archonet.com
Whole thread Raw
In response to psql can't subtract  (Rob Sargent <robjsargent@gmail.com>)
Responses Re: psql can't subtract  (Rob Sargent <robjsargent@gmail.com>)
List pgsql-general
On 25/03/11 15:29, Rob Sargent wrote:
> Running 9.0.3 (client and server)

> select distinct
> substring(
...
> position( 'xmlns=' in substring(xml_text,1,300)) + length('xmlns="'),
> 100))) -1
...
> gives
> ERROR: negative substring length not allowed.

If there is no match the initial position will be zero. Minus one will
give you a negative substring length.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: psql can't subtract
Next
From: Rob Sargent
Date:
Subject: Re: psql can't subtract