From: | Andre Lopes <lopes80andre(at)gmail(dot)com> |
---|---|
To: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: [SOLVED] Error in Trigger function. How to correct? |
Date: | 2010-04-14 13:41:32 |
Message-ID: | x2g18f98e681004140641re431f8c3y88be5a085e5b350f@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thanks a lot, it works!
I'am using Postgres Plus Advanced Server 8.3R2 in development.In production
I user PostreSQL 8.3.9.
Best Regards,
On Wed, Apr 14, 2010 at 2:19 PM, A. Kretschmer <
andreas(dot)kretschmer(at)schollglas(dot)com> wrote:
> In response to Andre Lopes :
> > Hi,
> >
> > I have a trigger that runs in my Development machine but not in my
> Production
> > machine. the code is the following:
> > SQL Error:
> >
> > ERROR: function replace(text, unknown, integer) does not exist
> > LINE 1: select replace(replace(replace(replace(replace(replace( $1 ,...
> > ^
>
> Let me guess: you have 8.2 on your Development machine and 8.3 or 8.4 on
> your production machine, right?
>
> I think you need to add explicit casts, let me explain:
>
>
>
>
> > HINT: No function matches the given name and argument types. You might
> need to
> > add explicit type casts.
> > QUERY: select replace(replace(replace(replace(replace(replace( $1 ,
> > '@numero_anuncio@', a.id_anuncio_externo), '@nome_anuncio@',
> a.n_anuncio),
> > '@idade@', EXTRACT(year from AGE(NOW(), a.dat_nasc))),
> '@telefone_anuncio@',
>
> EXTRACT(year ...) returns an INT, but replace(...) expects a TEXT or a
> similar type. Try to add a ::TEXT after the EXTRACT(...) - function:
>
> extract (year from ...)::text
>
> Maybe there are more occurrences ...
>
>
> Greetings from saxony, germany.
> --
> Andreas Kretschmer
> Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
> GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
From | Date | Subject | |
---|---|---|---|
Next Message | Bill Moran | 2010-04-14 13:42:03 | Re: Query is stuck |
Previous Message | Satish Burnwal (sburnwal) | 2010-04-14 13:20:13 | Re: Query is stuck |