Re: bug in substring??? - Mailing list pgsql-hackers

From scott.marlowe
Subject Re: bug in substring???
Date
Msg-id Pine.LNX.4.33.0402061647220.7563-100000@css120.ihs.com
Whole thread Raw
In response to Re: bug in substring???  (Joe Conway <mail@joeconway.com>)
Responses Re: bug in substring???  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, 6 Feb 2004, Joe Conway wrote:

> scott.marlowe wrote:
> > gives me nothing.  Shouldn't a negative offset, or even 0 offset result in 
> > an error or something here?  Or is there a special meaning to a negative 
> > offset I'm not getting?
> 
> In varlena.c there is this comment:
> 
>   * text_substr()
>   * Return a substring starting at the specified position.
>   * - thomas 1997-12-31
>   *
>   * Input:
>   *    - string
>   *    - starting position (is one-based)
>   *    - string length
>   *
>   * If the starting position is zero or less, then return from the start
>   *  of the string adjusting the length to be consistent with the
>   *  "negative start" per SQL92. If the length is less than zero, return
>   *  the remaining string.

thanks.  I just got done looking up the SQL explanation, and I think my 
head exploded.  Thanks for the heads up.



pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Why has postmaster shutdown gotten so slow?
Next
From: "Magnus Hagander"
Date:
Subject: Re: Why has postmaster shutdown gotten so slow?