Re: quote_literal(integer) does not exist - Mailing list pgsql-hackers

From Michael Paesold
Subject Re: quote_literal(integer) does not exist
Date
Msg-id 474E7EEF.7010109@gmx.at
Whole thread Raw
In response to Re: quote_literal(integer) does not exist  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> I don't offhand see anything else I'd consider weakening the casting
> rules for.  If anyone else is interested, I took
...
>  substring(text,integer)                                   | 
>  substring(text,integer,integer)                           | 
>  substring(text,text)                                      | 
>  substring(text,text,text)                                 | 
>  texticlike(text,text)                                     | ~~*
>  texticnlike(text,text)                                    | !~~*
>  texticregexeq(text,text)                                  | ~*
>  texticregexne(text,text)                                  | !~*
>  textlike(text,text)                                       | ~~
>  textnlike(text,text)                                      | !~~
>  textregexeq(text,text)                                    | ~
>  textregexne(text,text)                                    | !~
>  upper(text)                                               | 
> 
> 
> Thoughts?

In one of our applications, we have some "numbers" (e.g. product 
numbers) that have meaning attached to individual digits. Product 
numbers usually contain letters, too, but for historical reasons they do 
not in this application. So we put them into integer columns for 
efficiency. We still want to run queries like product_no LIKE '51%' on them.

Well, for the application, I don't see much of a problem here. This will 
probably cost 3-5 lines of code in the whole application. It will just 
cause some inconvenience when working with psql interactively.

And I have not yet seen another DBMS that does not accept almost any 
input type for the typical string operations such as substring or LIKE. 
It feels a little bit strange that I will have to do all that 
typecasting now.

Just my $0.02.

Best Regards
Michael Paesold



pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [pgsql-www] Time to update list of contributors
Next
From: "Guillaume Smet"
Date:
Subject: Re: 8.3devel slower than 8.2 under read-only load