Substring result short by 1

From: David Filion <david(at)filiontech(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Substring result short by 1
Date: 2004-08-31 19:29:51
Message-ID: 4134D1AF.4010202@filiontech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a question about substring(), when I run the following query:

prepaid=# select substring('15148300', 0, 5);
substring
-----------
1514
(1 row)

I get a result with only the first 4 characters, not five. Why is
that? The documentation doesn't spend much time discussing the
substring() function and google turned up nothing. I tried
searching the archives but the site is down.

David

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ying Lu 2004-08-31 19:41:36 About "lock file postmaster.pid" Error , cannot setup postmaster
Previous Message Jerry LeVan 2004-08-31 19:23:10 Re: Types and SRF's