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

Re: [pgsql-performance] Large databases, performance

From: "Shridhar Daithankar" <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: pgsql-hackers(at)postgresql(dot)org,pgsql-general <pgsql-general(at)postgresql(dot)org>,pgsql-performance(at)postgresql(dot)org
Subject: Re: [pgsql-performance] Large databases, performance
Date: 2002-10-09 13:41:09
Message-ID: 3DA47F4D.12909.1AAA876E@localhost (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-performancepgsql-sql
On 9 Oct 2002 at 9:32, Tom Lane wrote:

> Manfred Koizar <mkoi-pg(at)aon(dot)at> writes:
> > here is an implementation of a set of user types: char3, char4,
> > char10.
> 
> Coupla quick comments on these:
> 
> > CREATE FUNCTION charNN_lt(charNN, charNN)
> >     RETURNS boolean
> >     AS '$libdir/fixchar'
> >     LANGUAGE 'c';
> 
> > bool
> > charNN_lt(char *a, char *b)
> > {
> > 	return (strncmp(a, b, NN) < 0);
> > }/*charNN_lt*/
> 
> These functions are dangerous as written, because they will crash on
> null inputs.  I'd suggest marking them strict in the function
> declarations.  Some attention to volatility declarations (isCachable
> or isImmutable) would be a good idea too.

Let me add something. Using char* is bad idea. I had faced a situation recently 
on HP-UX 11 that with a libc patch, isspace collapsed for char>127. Fix was to 
use unsigned char. There are other places also where the input character is 
used as index to an array internally and can cause weird behaviour for values 
>127

I will apply both the correction here. Will post the final stuff soon.

Bye
 Shridhar

--
Hacker's Quicky #313:	Sour Cream -n- Onion Potato Chips	Microwave Egg Roll	
Chocolate Milk


In response to

pgsql-performance by date

Next:From: Robert TreatDate: 2002-10-09 13:57:18
Subject: Re: What does this tell me?
Previous:From: Tom LaneDate: 2002-10-09 13:32:50
Subject: Re: [pgsql-performance] Large databases, performance

pgsql-hackers by date

Next:From: Sandeep ChadhaDate: 2002-10-09 13:42:56
Subject: Re: [GENERAL] Hot Backup
Previous:From: Tom LaneDate: 2002-10-09 13:32:50
Subject: Re: [pgsql-performance] Large databases, performance

pgsql-sql by date

Next:From: Tom LaneDate: 2002-10-09 13:47:22
Subject: Re: Complex SQL query and performance strategy
Previous:From: Tom LaneDate: 2002-10-09 13:32:50
Subject: Re: [pgsql-performance] Large databases, performance

pgsql-general by date

Next:From: Sandeep ChadhaDate: 2002-10-09 13:42:56
Subject: Re: [GENERAL] Hot Backup
Previous:From: Tom LaneDate: 2002-10-09 13:38:01
Subject: Re: Installing PL/Python (progress!)

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