pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: pgsql-hackers@postgresql.org, pgsql-general <pgsql-general@postgresql.org>
To: pgsql-performance@postgresql.org
Subject: Re: [pgsql-performance] Large databases, performance
Date: Wed, 09 Oct 2002 19:11:09 +0530
Message-ID: <3DA47F4D.12909.1AAA876E@localhost> (raw)
In-Reply-To: <19697.1034170370@sss.pgh.pa.us>
References: <a2n7qu0qen2ne1chalomdgt5n1etgb4uk3@4ax.com>

On 9 Oct 2002 at 9:32, Tom Lane wrote:

> Manfred Koizar <mkoi-pg@aon.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




view thread (48+ messages)  latest in thread

Message-ID: <3DA47F4D.12909.1AAA876E@localhost>
Permalink:  ../3DA47F4D.12909.1AAA876E@localhost/
Also on:    postgresql.org/message-id/3DA47F4D.12909.1AAA876E@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: shridhar_daithankar@persistent.co.in, pgsql-general@postgresql.org, pgsql-performance@postgresql.org
  Subject: Re: [pgsql-performance] Large databases, performance
  In-Reply-To: <3DA47F4D.12909.1AAA876E@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox