Skip site navigation (1) Skip section navigation (2)

Re: quote_literal(integer) does not exist

From: Michael Paesold <mpaesold(at)gmx(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Brendan Jurd <direvus(at)gmail(dot)com>, Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: quote_literal(integer) does not exist
Date: 2007-11-29 08:57:19
Message-ID: 474E7EEF.7010109@gmx.at (view raw or flat)
Thread:
Lists: 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


In response to

pgsql-hackers by date

Next:From: Guillaume SmetDate: 2007-11-29 09:00:08
Subject: Re: 8.3devel slower than 8.2 under read-only load
Previous:From: Magnus HaganderDate: 2007-11-29 08:45:38
Subject: Re: [HACKERS] Time to update list of contributors

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group