Re: [SQL] substr or char_length problem

2005-06-17 Thread Michael Fuhr
On Fri, Jun 17, 2005 at 12:25:28PM +0200, Andreas Kretschmer wrote: > am 17.06.2005, um 13:01:15 +0300 mailte Fatih Cerit folgendes: > > > > I have a problem with function substr or char_length or both. I guery A2 > > and it works fine. But sometimes gives 'ERROR: negative substring length > >

Re: [despammed] [SQL] substr or char_length problem

2005-06-17 Thread Andreas Kretschmer
am 17.06.2005, um 13:01:15 +0300 mailte Fatih Cerit folgendes: > Dear ALL > > I have a problem with function substr or char_length or both. I guery A2 > and it works fine. But sometimes gives 'ERROR: negative substring length > not allowed'. When I test many many times with diffrent values, ne

[SQL] substr or char_length problem

2005-06-17 Thread Fatih Cerit
Dear ALL I have a problem with function substr or char_length or both. I guery A2 and it works fine. But sometimes gives 'ERROR: negative substring length not allowed'. When I test many many times with diffrent values, never gives error. Sample table and query below. A1 A2 --

Re: [SQL] substr

2000-10-19 Thread Jeff MacDonald
> Jeff MacDonald <[EMAIL PROTECTED]> 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...

Re: [SQL] substr

2000-10-19 Thread Tom Lane
Jeff MacDonald <[EMAIL PROTECTED]> 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... We are implemen

[SQL] substr

2000-10-19 Thread Jeff MacDonald
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, - Post