Re: substr negative indexes

From: Guy Rouillier <guyr-ml1(at)burntmail(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: substr negative indexes
Date: 2007-01-15 23:11:43
Message-ID: 45AC0A2F.2020109@burntmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Martin 2007-01-15 23:51:52 Re: PQexec does not return.
Previous Message Albert 2007-01-15 20:44:57 Re: Reserve a value in a serial type field