pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Neil Conway <neilc@samurai.com>
Cc: Bjorn T Johansen <btj@havleik.no>
Cc: PostgreSQL General <pgsql-general@postgresql.org>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: [PERFORM] Seq scan of table?
Date: Fri, 5 Sep 2003 20:37:12 +0100
Message-ID: <200309052037.12689.dev@archonet.com> (raw)
In-Reply-To: <1062786017.447.1.camel@tokyo>
References: <58940.193.212.14.12.1062742087.squirrel@www.havleik.no>
	<200309051107.12756.dev@archonet.com>
	<1062786017.447.1.camel@tokyo>

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



view thread (11+ messages)  latest in thread

Message-ID: <200309052037.12689.dev@archonet.com>
Permalink:  ../200309052037.12689.dev@archonet.com/
Also on:    postgresql.org/message-id/200309052037.12689.dev@archonet.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: dev@archonet.com, neilc@samurai.com, btj@havleik.no, pgsql-general@postgresql.org
  Subject: Re: [PERFORM] Seq scan of table?
  In-Reply-To: <200309052037.12689.dev@archonet.com>
  References: <58940.193.212.14.12.1062742087.squirrel@www.havleik.no> <200309051107.12756.dev@archonet.com> <1062786017.447.1.camel@tokyo> <200309052037.12689.dev@archonet.com>

* 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