Re: operator varchar = integer

From: Daniel Schuchardt <daniel_schuchardt(at)web(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: operator varchar = integer
Date: 2008-05-05 16:32:37
Message-ID: fvncr7$1bke$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tino Wildenhain schrieb:
> Hi,
>
> Daniel Schuchardt wrote:
>> David Fetter schrieb:
>>> That technical debt is a risk to your whole project, and you need to
>>> dedicate resources to paying it down.
>>>
>>> <http://en.wikipedia.org/wiki/Technical_debt>
>>>
>>> There are ways to get those automated casts, but they will only make
>>> your situation worse in the long run.
>>>
>>> Cheers,
>>> David.
>>>
>>
>> *g* interesting standpoint and your right but:
>>
>> it is impossible for us to find all the points where the new 8.3
>> behavoir would crash at the first time. so our next versions would be
>> very buggy and our customers wouldn't be happy ;-)
>> the next problem is that our service personal has to be traineed too;
>> they dont know much about casting, 81 does it automatically; problems
>> problems problems.
>>
>> if it is not possible (i know it is) ;-) to recreate automatic casts
>> in 83 we would not be able to upgrade to 83 the next years. the next
>> possible date would be in about 3-4 years with the next major release.
>>
>> PS:
>> our db has about 500 functions, 300 tables, 1000 indexes, 1200 Views
>> that all use implicit casting.
>> and: everything is working fine ;-) :-P
>>
>> so we have to choose another way.
>
> Well err... implicit table joining is also off per default I believe.
> So if you had used it a lot you would have a similar problem.
>
> Comparing int with text in general does not sound like a very good
> idea to me. It should be quite easy to write a script to identify
> such places so you can either change the datatypes (preferred) or
> add the cast. Then rerun your automated regression tests...
>
> Cheers
> T.
it is not possible to do this. we also used automatic casting as a feature:
if a user starts a search, we never check the data type he puts in. in
81 postgresql automatically casts the user input in dependece of the
column. so all our search masks has to be checked to, edit fields need
to get a data type and so on.

example:

user types 1 -> our application automatically starts a search "LIKE '1%'"
user types 12 -> our application automatically starts a search "LIKE
'12%'"

and so on. and it doenst matter if the searchfield is char or integer,
81 does it automatically.
if it is a good or bad thing to do it is another question. it works in
81 and so we used this feature.

cheers.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Schuchardt 2008-05-05 16:43:37 operator is not unique: integer || integer
Previous Message David Fetter 2008-05-05 15:52:54 Re: operator varchar = integer