Re: Boolean casting in 7.3 -> changed?

From: David Wheeler <david(at)wheeler(dot)net>
To: David Walker <pgsql(at)grax(dot)com>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Boolean casting in 7.3 -> changed?
Date: 2002-11-30 20:18:23
Message-ID: E01E5FB4-04A0-11D7-8D38-0003931A964A@wheeler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday, November 27, 2002, at 04:34 PM, David Walker wrote:

> Does this mean that in the future '342' may not be valid as an insert
> into a
> numeric field and that we should be using 342 instead?

I didn't see an answer to this question, but I sincerely hope that the
answer is
"no." Otherwise, dynamic interfaces are going to have a much harder
time.

Take DBI (and DBD::Pg), for example. Most DBI users don't specify a
data type when using placeholders. Therefore, DBD::Pg (and other DBDs,
including DBD::Oracle) assume that the data types are strings. So it's
not unusual for DBD::Pg to execute a query like this:

INSERT INTO foo (numtype, varchartype, datetime, inttype)
VALUES ('23.4', 'string', '2002-11-30 00:00:00', '12');

In order to allow the flexibility to remain, AFAICT PostgreSQL has to
continue to allow strings to be converted to numbers on the back end.

Regards,

David

--
David Wheeler AIM: dwTheory
david(at)wheeler(dot)net ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory(at)jabber(dot)org

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dan Langille 2002-11-30 20:19:09 Re: 7.4 Wishlist
Previous Message Rod Taylor 2002-11-30 20:13:48 Re: 7.4 Wishlist