Skip site navigation (1) Skip section navigation (2)

substr

From: Jeff MacDonald <jeff(at)hub(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: substr
Date: 2000-10-19 13:19:10
Message-ID: Pine.BSF.4.21.0010191017510.9479-100000@rage.hub.org (view raw or flat)
Thread:
Lists: pgsql-sql
i noticed that substr behaves a bit different in pgsql than perl

ie select foo from table where substr(foo,1,1) = 'X';

initially i thought it should be substr(foo,0,1) 

just wondering on the reasoning for this offset ?

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


Responses

pgsql-sql by date

Next:From: Tom LaneDate: 2000-10-19 14:50:12
Subject: Re: substr
Previous:From: Tom LaneDate: 2000-10-18 16:32:43
Subject: Re: Function that returns a tuple.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group