Re: substr

From: Jeff MacDonald <jeff(at)pgsql(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff MacDonald <jeff(at)hub(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: substr
Date: 2000-10-19 16:05:34
Message-ID: Pine.BSF.4.21.0010191154400.9479-100000@rage.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


> Jeff MacDonald <jeff(at)hub(dot)org> writes:
> > i noticed that substr behaves a bit different in pgsql than perl
> > ie select foo from table where substr(foo,1,1) = 'X';
>
> > just wondering on the reasoning for this offset ?
>
> Larry Wall and the SQL92 authors didn't talk to each other...

bastards :) now we gotta decide who to kill, larry or the sql folk.
i'd say the sql folk, 0 is just more inututive for computer counting.

but that's just me.. :) anyway thanks.

>
> We are implementing SQL around here, not Perl, so we have to follow
> the SQL spec's definition of substr().
>
> regards, tom lane
>

Jeff MacDonald,

-----------------------------------------------------
PostgreSQL Inc | Hub.Org Networking Services
jeff(at)pgsql(dot)com | jeff(at)hub(dot)org
www.pgsql.com | www.hub.org
1-902-542-0713 | 1-902-542-3657
-----------------------------------------------------
Facsimile : 1 902 542 5386
IRC Nick : bignose

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Frank Bax 2000-10-19 18:05:25 Re: COUNT
Previous Message Tom Lane 2000-10-19 14:50:12 Re: substr