Re: plpython integer types - Mailing list pgsql-novice

From Emiliano Amilcarelli
Subject Re: plpython integer types
Date
Msg-id 437C97D6.8070801@tin.it
Whole thread Raw
In response to Re: plpython integer types  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: plpython integer types  (Michael Fuhr <mike@fuhr.org>)
List pgsql-novice
No, it doesn,'t work if i use int4
I solved the problem casting the type:

plan=plpy.prepare("INSERT INTO
\"tmp_test\"(\"AGENT\",\"ERRORE\",\"PROVE_FALLITE\",\"DATA_ORA_ACCESSO\")
values($1,$2,$3::int,$4)",["text","text","text","text"])

Thanks for help....

Regards.

Emil


Tom Lane ha scritto:
> Emiliano Amilcarelli <amiemi@tin.it> writes:
>
>> a plpython function i'm writing fail with a strange ( to me ) message error:
>>
>
>
>> .....
>> plan=ply.prepare("intert into text,text1,integer1,text"
>> values($1,$2,$3,$4)",["text","text","integer","text"])
>> ply.execute(plan,[var1,var2,var3,var4])
>> .....
>>
>
>
>> The backend raise an errore saying:
>>     ERROR: type integer does not exist...
>>
>
> Does it work if you say "int4" instead?
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpython integer types
Next
From: George Weaver
Date:
Subject: Re: Problem getting xml2 contrib module working with 8.1