Re: [PERFORM] Seq scan of table?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Bjorn T Johansen <btj(at)havleik(dot)no>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>, PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: [PERFORM] Seq scan of table?
Date: 2003-09-05 19:37:12
Message-ID: 200309052037.12689.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

On Friday 05 September 2003 19:20, Neil Conway wrote:
> On Fri, 2003-09-05 at 06:07, Richard Huxton wrote:
> > PG's parser will assume an explicit number is an int4 - if you need an
> > int8 etc you'll need to cast it, yes.
>
> Or enclose the integer literal in single quotes.
>
> > You should find plenty of discussion of why in the archives, but the
> > short reason is that PG's type structure is quite flexible which means it
> > can't afford to make too many assumptions.
>
> Well, it's definitely a bug in PG, it's "quite flexible" type structure
> notwithstanding.

It certainly catches out a lot of people. I'd guess it's in the top three
issues in the general/sql lists. I'd guess part of the problem is it's so
silent. In some ways it would be better to issue a NOTICE every time a
typecast is forced in a comparison - irritating as that would be.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Franco Bruno Borghesi 2003-09-05 19:56:54 C functions
Previous Message Richard Huxton 2003-09-05 19:28:06 Re: Panic Index!!!!

Browse pgsql-performance by date

  From Date Subject
Next Message Bruce Momjian 2003-09-05 20:49:11 Re: [GENERAL] how to get accurate values in pg_statistic
Previous Message Tom Lane 2003-09-05 18:38:15 Re: [GENERAL] how to get accurate values in pg_statistic (continued)