Re: RES: Diferences between functions criated in pg 8.0.4 and criated in pg 7.4.8

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: "Alejandro Michelin Salomon \( Adinet \)" <alejmsg(at)adinet(dot)com(dot)uy>, "'Martijn van Oosterhout'" <kleptog(at)svana(dot)org>
Subject: Re: RES: Diferences between functions criated in pg 8.0.4 and criated in pg 7.4.8
Date: 2006-05-14 14:50:16
Message-ID: 200605140750.16283.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The first thing to check is whether the hosting service has installed PL/pgsql
as a language. If you have sufficient privileges you could try 'select
lanname from pg_languages' to see if it is installed.
On Sunday 14 May 2006 07:08 am, Alejandro Michelin Salomon ( Adinet ) wrote:
> Martijn :
>
> OK, y try to explain.
>
> First, y im using phppgAdmin for do this operations, becous my systems are
> all web based.
> My developpement plataform is windows, and this is the reason of use pg
> 8.0.4.
>
> 1) I change :
>
> CREATE OR REPLACE FUNCTION LEFT( sTexto CHARACTER VARYING, nPosFin INTEGER
> ) for :
> CREATE OR REPLACE FUNCTION LEFT( CHARACTER VARYING, INTEGER )
>
> Becouse in the online documentation of pg 7.4 does not has other syntax for
> parameters.
>
> 2)
>
> RETURNS "varchar" AS $$ --> Syntax error here.
>
>
> I change the function to
>
> CREATE OR REPLACE FUNCTION LEFT( CHARACTER VARYING, INTEGER )
> RETURNS "varchar"
> LANGUAGE plpgsql
> CALLED ON NULL INPUT
> SECURITY INVOKER
> AS '
> BEGIN
> IF sTexto IS NULL OR nPosFin IS NULL OR nPosFin <= 0 THEN
> RETURN '';
> ELSE
> RETURN SUBSTR( sTexto, 1, nPosFin );
> END IF;
> END;
> ';
>
> At this point i have sourprice. The hosting say does no exist 'plpgsql'
>
> This last syntax has error, but i can't find.
>
> Can you help me ?
>
> Alejandro MSG <alejmsg(at)adinet(dot)com(dot)uy>
> Porto Alegre
> Brasil
>
>
> -->-----Mensagem original-----
> -->De: pgsql-general-owner(at)postgresql(dot)org
> -->[mailto:pgsql-general-owner(at)postgresql(dot)org] Em nome de
> -->Martijn van Oosterhout
> -->Enviada em: domingo, 14 de maio de 2006 10:38
> -->Para: Alejandro Michelin Salomon ( Adinet )
> -->Cc: Pgsql-General
> -->Assunto: Re: [GENERAL] Diferences between functions criated
> -->in pg 8.0.4 and criated in pg 7.4.8
> -->
> -->
> -->On Sun, May 14, 2006 at 10:10:44AM -0300, Alejandro Michelin
> -->Salomon ( Adinet ) wrote:
> -->> Hi :
> -->>
> -->> I criated some function in my pg 8.0.4, they function as spected.
> -->>
> -->> But when i try tu criate this functions in my hosting that has pg
> -->> 7.4.8, i can not do. I read documentation an i see some
> -->disferences.
> -->
> --><snip>
> -->
> -->> How i need change, to get this function runing in pg 7.4.8 ?
> -->
> -->Well, since you havn't told us the error message it's hard
> -->to tell the problem. At a guess though, 7.4 doesn't
> -->understand dollar-quoting.
> -->
> -->Have a nice day,
> -->--
> -->Martijn van Oosterhout <kleptog(at)svana(dot)org>
> -->http://svana.org/kleptog/
> -->> From each according to his ability. To each according to
> -->his ability
> -->> to litigate.
> -->
> -->--
> -->No virus found in this incoming message.
> -->Checked by AVG Free Edition.
> -->Version: 7.1.392 / Virus Database: 268.5.6/339 - Release
> -->Date: 14/5/2006
> -->
> -->
> -->

--
Adrian Klaver
aklaver(at)comcast(dot)net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alejandro Michelin Salomon ( Adinet ) 2006-05-14 15:18:16 RES: RES: Diferences between functions criated in pg 8.0.4 and criated in pg 7.4.8
Previous Message Alejandro Michelin Salomon ( Adinet ) 2006-05-14 14:08:47 RES: Diferences between functions criated in pg 8.0.4 and criated in pg 7.4.8