Обсуждение: 8.3beta bug or feature?

Поиск
Список
Период
Сортировка

8.3beta bug or feature?

От
marcelo Cortez
Дата:
folks

 the follow queries work in postgres 8.2 but
 in  8.3beta don't work


SELECT c.* FROM c WHERE  c.numero LIKE '1%';

i think automatic conversion of  numeber to text is
the problem , in 8.3beta don't work
numero field is  integer type
any ideas?

 best regards
 mdc

ps:"PostgreSQL 8.3beta3 on i686-pc-linux-gnu, compiled
by GCC gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.1)"


ERROR:  operator does not exist: integer ~~ unknown
LINE 2:  c.numero LIKE '1%')

      ^
HINT:  No operator matches the given name and argument
type(s). You might need to add explicit type casts.

********** Error **********

ERROR: operator does not exist: integer ~~ unknown
Estado SQL:42883
Sugerencias:No operator matches the given name and
argument type(s). You might need to add explicit type
casts.
Caracter: 141





      Tarjeta de crédito Yahoo! de Banco Supervielle.
Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. www.tuprimeratarjeta.com.ar

Re: 8.3beta bug or feature?

От
"Pavel Stehule"
Дата:
Hello,

it isn't bug. You have to cast to string before.

http://www.postgresql.org/docs/8.3/static/release-8-3.html
E.1.2.1. General

Regards
Pavel Stehule


On 10/01/2008, marcelo Cortez <jmdc_marcelo@yahoo.com.ar> wrote:
> folks
>
>  the follow queries work in postgres 8.2 but
>  in  8.3beta don't work
>
>
> SELECT c.* FROM c WHERE  c.numero LIKE '1%';
>
> i think automatic conversion of  numeber to text is
> the problem , in 8.3beta don't work
> numero field is  integer type
> any ideas?
>
>  best regards
>  mdc
>
> ps:"PostgreSQL 8.3beta3 on i686-pc-linux-gnu, compiled
> by GCC gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.1)"
>
>
> ERROR:  operator does not exist: integer ~~ unknown
> LINE 2:  c.numero LIKE '1%')
>
>       ^
> HINT:  No operator matches the given name and argument
> type(s). You might need to add explicit type casts.
>
> ********** Error **********
>
> ERROR: operator does not exist: integer ~~ unknown
> Estado SQL:42883
> Sugerencias:No operator matches the given name and
> argument type(s). You might need to add explicit type
> casts.
> Caracter: 141
>
>
>
>
>
>       Tarjeta de crédito Yahoo! de Banco Supervielle.
> Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. www.tuprimeratarjeta.com.ar
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org/
>

Re: 8.3beta bug or feature?

От
Alvaro Herrera
Дата:
marcelo Cortez escribió:
> folks
>
>  the follow queries work in postgres 8.2 but
>  in  8.3beta don't work
>
>
> SELECT c.* FROM c WHERE  c.numero LIKE '1%';
>
> i think automatic conversion of  numeber to text is
> the problem , in 8.3beta don't work
> numero field is  integer type

This is regarded as a feature by some, bug by others.  It's an
intentional change either way.  You can work around it:

SELECT c.* FROM c WHERE  c.numero::text LIKE '1%';


--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: 8.3beta bug or feature?

От
marcelo Cortez
Дата:
Pavel


--- Pavel Stehule <pavel.stehule@gmail.com> escribió:

> Hello,
>
> it isn't bug. You have to cast to string before.
>
>
http://www.postgresql.org/docs/8.3/static/release-8-3.html
> E.1.2.1. General

 Yes you are right, but my queries was generated for
one mapper ,explicit cast is not an option ( not
manual code here).
there any way simulate previous behavior? (automatic
conversion), create cast can help?
best regards.

mdc


>
> Regards
> Pavel Stehule
>
>
> On 10/01/2008, marcelo Cortez
> <jmdc_marcelo@yahoo.com.ar> wrote:
> > folks
> >
> >  the follow queries work in postgres 8.2 but
> >  in  8.3beta don't work
> >
> >
> > SELECT c.* FROM c WHERE  c.numero LIKE '1%';
> >
> > i think automatic conversion of  numeber to text
> is
> > the problem , in 8.3beta don't work
> > numero field is  integer type
> > any ideas?
> >
> >  best regards
> >  mdc
> >
> > ps:"PostgreSQL 8.3beta3 on i686-pc-linux-gnu,
> compiled
> > by GCC gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.1)"
> >
> >
> > ERROR:  operator does not exist: integer ~~
> unknown
> > LINE 2:  c.numero LIKE '1%')
> >
> >       ^
> > HINT:  No operator matches the given name and
> argument
> > type(s). You might need to add explicit type
> casts.
> >
> > ********** Error **********
> >
> > ERROR: operator does not exist: integer ~~ unknown
> > Estado SQL:42883
> > Sugerencias:No operator matches the given name and
> > argument type(s). You might need to add explicit
> type
> > casts.
> > Caracter: 141
> >
> >
> >
> >
> >
> >       Tarjeta de crédito Yahoo! de Banco
> Supervielle.
> > Solicitá tu nueva Tarjeta de crédito. De tu PC
> directo a tu casa. www.tuprimeratarjeta.com.ar
> >
> > ---------------------------(end of
> broadcast)---------------------------
> > TIP 4: Have you searched our list archives?
> >
> >                http://archives.postgresql.org/
> >
>



      Los referentes más importantes en compra/ venta de autos se juntaron:
Demotores y Yahoo!
Ahora comprar o vender tu auto es más fácil. Vistá ar.autos.yahoo.com/

Re: 8.3beta bug or feature?

От
Erik Jones
Дата:
On Jan 10, 2008, at 10:47 AM, marcelo Cortez wrote:

> folks
>
>  the follow queries work in postgres 8.2 but
>  in  8.3beta don't work
>
>
> SELECT c.* FROM c WHERE  c.numero LIKE '1%';
>
> i think automatic conversion of  numeber to text is
> the problem , in 8.3beta don't work
> numero field is  integer type
> any ideas?


Read the release notes :)  Implicit casts from non-text types to text
have been removed.  The easiest solution is to use an explicit cast:

SELECT c.* FROM c WHERE c.numero::text LIKE '1%';

I can definitely see this being an 8.3 faq.

Erik Jones

DBA | Emma®
erik@myemma.com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com




Re: 8.3beta bug or feature?

От
Alvaro Herrera
Дата:
marcelo Cortez escribió:
> Pavel
>
>
> --- Pavel Stehule <pavel.stehule@gmail.com> escribió:
>
> > Hello,
> >
> > it isn't bug. You have to cast to string before.
> >
> >
> http://www.postgresql.org/docs/8.3/static/release-8-3.html
> > E.1.2.1. General
>
>  Yes you are right, but my queries was generated for
> one mapper ,explicit cast is not an option ( not
> manual code here).
> there any way simulate previous behavior? (automatic
> conversion), create cast can help?

The cast already exist; I think you could change its context (from
"explicit" to "assignment" IIRC).  This is, of course, not recommended.

The operation you show is a pretty stupid thing for a mapper to do
anyway ... I suggest you fix it.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: 8.3beta bug or feature?

От
marcelo Cortez
Дата:
Alvaro


--- Alvaro Herrera <alvherre@commandprompt.com>
escribió:

> marcelo Cortez escribió:
> > Pavel
> >
> >
> > --- Pavel Stehule <pavel.stehule@gmail.com>
> escribió:
> >
> > > Hello,
> > >
> > > it isn't bug. You have to cast to string before.
> > >
> > >
> >
>
http://www.postgresql.org/docs/8.3/static/release-8-3.html
> > > E.1.2.1. General
> >
> >  Yes you are right, but my queries was generated
> for
> > one mapper ,explicit cast is not an option ( not
> > manual code here).
> > there any way simulate previous behavior?
> (automatic
> > conversion), create cast can help?
>
> The cast already exist; I think you could change its
> context (from
> "explicit" to "assignment" IIRC).  This is, of
> course, not recommended.
>
> The operation you show is a pretty stupid thing for
> a mapper to do
> anyway ... I suggest you fix it.

 yeap i know , but it's third part component,fix it is
not an option this time, previous version of my
application works fine in 8.2, but i need  8.3
features like fts and others.

best regards.
mdc


>
> --
> Alvaro Herrera
> http://www.CommandPrompt.com/
> PostgreSQL Replication, Consulting, Custom
> Development, 24x7 support
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please
> send an appropriate
>        subscribe-nomail command to
> majordomo@postgresql.org so that your
>        message can get through to the mailing list
> cleanly
>



      Los referentes más importantes en compra/ venta de autos se juntaron:
Demotores y Yahoo!
Ahora comprar o vender tu auto es más fácil. Vistá ar.autos.yahoo.com/

Re: 8.3beta bug or feature?

От
Tom Lane
Дата:
marcelo Cortez <jmdc_marcelo@yahoo.com.ar> writes:
> --- Alvaro Herrera <alvherre@commandprompt.com>
> escribi�:
>> The operation you show is a pretty stupid thing for
>> a mapper to do anyway ... I suggest you fix it.

>  yeap i know , but it's third part component,fix it is
> not an option this time,

Well, then the third party had better be fixing it, and PDQ too.
Unless they plan to abandon their product when 8.3 comes out.

            regards, tom lane

Re: 8.3beta bug or feature?

От
marcelo Cortez
Дата:
Alvaro

--- Alvaro Herrera <alvherre@commandprompt.com>
escribió:

> marcelo Cortez escribió:
> > Pavel
> >
> >
> > --- Pavel Stehule <pavel.stehule@gmail.com>
> escribió:
> >
> > > Hello,
> > >
> > > it isn't bug. You have to cast to string before.
> > >
> > >
> >
>
http://www.postgresql.org/docs/8.3/static/release-8-3.html
> > > E.1.2.1. General
> >
> >  Yes you are right, but my queries was generated
> for
> > one mapper ,explicit cast is not an option ( not
> > manual code here).
> > there any way simulate previous behavior?
> (automatic
> > conversion), create cast can help?
>
> The cast already exist; I think you could change its
> context (from
> "explicit" to "assignment" IIRC).  This is, of
> course, not recommended.


   I've created cast with  assignment from in4 to text

 but
select 23  LIKE '2%'  fail.
ERROR:  operator does not exist: integer ~~ unknown
LINE 1: select 23  LIKE '2%'
                   ^
HINT:  No operator matches the given name and argument
type(s). You might need to add explicit type casts.

********** Error **********

ERROR: operator does not exist: integer ~~ unknown
Estado SQL:42883
Sugerencias:No operator matches the given name and
argument type(s). You might need to add explicit type
casts.
Caracter: 12

and i try with

select 23 ::int4  LIKE '2%' text

added explicit cast thinking in .. 'integer ~~
unknown'  unknow word .. confuse to me.

nothing is working
any ideas?
is posible to locate changes  ( into sources) to
revert behavior to previous 2.8x version?
best regards
mdc




>
> The operation you show is a pretty stupid thing for
> a mapper to do
> anyway ... I suggest you fix it.
>
> --
> Alvaro Herrera
> http://www.CommandPrompt.com/
> PostgreSQL Replication, Consulting, Custom
> Development, 24x7 support
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please
> send an appropriate
>        subscribe-nomail command to
> majordomo@postgresql.org so that your
>        message can get through to the mailing list
> cleanly
>



      Tarjeta de crédito Yahoo! de Banco Supervielle.
Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. www.tuprimeratarjeta.com.ar

Re: 8.3beta bug or feature?

От
Jeff Davis
Дата:
On Thu, 2008-01-10 at 16:19 -0300, marcelo Cortez wrote:
> > The cast already exist; I think you could change its
> > context (from
> > "explicit" to "assignment" IIRC).  This is, of
> > course, not recommended.
>
>
>    I've created cast with  assignment from in4 to text
>
>  but
> select 23  LIKE '2%'  fail.
> ERROR:  operator does not exist: integer ~~ unknown
> LINE 1: select 23  LIKE '2%'
>                    ^
> HINT:  No operator matches the given name and argument
> type(s). You might need to add explicit type casts.

First of all, I think Alvaro meant "change to implicit", I don't think
"assignment" will help.

Second, assuming that works for that specific case (which it may or may
not, I haven't tried it), it's still not a good solution for you.
Implicit type coercion causes all kinds of subtle problems that are hard
to see, which is why the change was made in 8.3.

And if I understand correctly, just changing a few casts to "implicit"
will not result in behavior the same as 8.2, so it's likely to break
other parts of the application.

I don't think there's any way around fixing the application. You can
still use 8.2 with tsearch2 (which still work great) until the mapper is
fixed.

What is the name of the third-party product?

Regards,
    Jeff Davis