Re: substr negative indexes - Mailing list pgsql-general

From Guy Rouillier
Subject Re: substr negative indexes
Date
Msg-id 45AC0A2F.2020109@burntmail.com
Whole thread Raw
In response to Re: substr negative indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> and unless I'm mistaken, our behavior conforms to the spec and Oracle's
> doesn't.
>
> Strictly speaking, the spec doesn't define the behavior of "SUBSTR" at
> all, only "SUBSTRING" with this weird FROM/FOR argument syntax.  But
> PG treats SUBSTR(x,y,z), SUBSTRING(x,y,z) and SUBSTRING(x FROM y FOR z)
> all the same.  Possibly Oracle conforms to spec for SUBSTRING but
> their SUBSTR acts differently?

Thanks, Tom, I agree that PG's substr() appears to be following the spec
(thank goodness I don't have to read that whole thing ;).  Oracle does
not implement substring() at all (up through release 9.2, the latest I
have to work with.  Just checked the online documentation for 10g
Release 2 (latest available) and it doesn't have it either.  Says this
under conformance: "E021-06, SUBSTRING function: use SUBSTR function
instead". Sigh...

--
Guy Rouillier

pgsql-general by date:

Previous
From: "Albert"
Date:
Subject: Re: Reserve a value in a serial type field
Next
From: Steve Martin
Date:
Subject: Re: PQexec does not return.