pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ross J. Reedstrom <reedstrm@rice.edu>
To: Craig Longman <craigl@begeek.com>
Cc: PostgreSQL SQL List <pgsql-sql@postgresql.org>
Subject: Re: casts and conversions
Date: Sun, 17 Jun 2001 21:02:03 -0500
Message-ID: <20010617210203.A10168@rice.edu> (raw)
In-Reply-To: <992668049.2128.5.camel@jigra.begeek.com>
References: <992668049.2128.5.camel@jigra.begeek.com>

On Sat, Jun 16, 2001 at 01:07:29AM -0400, Craig Longman wrote:

<problem wiuth no automatic float8<->numeric casts>

Tom Lane has already addressed the 'why is it this way' question. I'll
address your proposed work arounds.

> 
> the only solution i can think of, if it is possible, is to have a script
> that the client would need to run to declare the missing parameter
> combinations for the standard operators.  this isn't very desireable,
> but it is the only real solution i can see so far. any other
> suggestions?

Yup, that's pretty much the only way to do this. Either run scripts as
part of the install, or (if there's a logical place for it in the workflow)
you could much around to see if the declarations are already there, and only
run the script if their missing.

> 
> why does this happen?  i have run into this before, and was able to
> perform the explicit cast (the code was postgresql only), but it seems
> like this is always going to be a problem, unless i'm missing something.
> are there plans for more thorough dynamic-casting logic, or does one

Check the HACKERS archives: there've been _long_ discussions about how to
do dynimic casting correctly, in the face of a user extensible type system.
Not trivial, at all.

> just need to go through all the combinations of datatypes and make sure
> that every combination is entered in the operator mapping tables?  i
> guess it would need to be entered both ways also ( int*float8,
> float8*int )?

I'd test with all the combinations of types you need, then only add
enough new mappings to get everything working.

Ross



view thread (9+ messages)  latest in thread

Message-ID: <20010617210203.A10168@rice.edu>
Permalink:  ../20010617210203.A10168@rice.edu/
Also on:    postgresql.org/message-id/20010617210203.A10168@rice.edu

 · 

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: reedstrm@rice.edu, craigl@begeek.com
  Subject: Re: casts and conversions
  In-Reply-To: <20010617210203.A10168@rice.edu>

* 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