Re: plpython integer types

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: plpython integer types
Дата
Msg-id 20051118050618.GA70723@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: plpython integer types  (Emiliano Amilcarelli <amiemi@tin.it>)
Список pgsql-novice
On Thu, Nov 17, 2005 at 03:46:46PM +0100, Emiliano Amilcarelli wrote:
> No, it doesn,'t work if i use int4

int4 works for me in PostgreSQL 8.1.0 and 8.0.4:

CREATE TABLE foo (
    i  integer,
    f  float8,
    n  numeric,
    t  text,
    d  date
);

CREATE FUNCTION populate() RETURNS boolean AS $$
query = 'INSERT INTO foo (i, f, n, t, d) VALUES ($1, $2, $3, $4, $5)'
types = ('int4', 'float8', 'numeric', 'text', 'date')
plan = plpy.prepare(query, types)
plpy.execute(plan, (1, 2.3, 4.56, 'test', '2005-11-17'))
return True
$$ LANGUAGE plpythonu VOLATILE;

SELECT populate();
 populate
----------
 t
(1 row)

SELECT * FROM foo;
 i |  f  |  n   |  t   |     d
---+-----+------+------+------------
 1 | 2.3 | 4.56 | test | 2005-11-17
(1 row)

--
Michael Fuhr

В списке pgsql-novice по дате отправления:

Предыдущее
От: Bernardo López
Дата:
Сообщение: Re: org.postgresql.Driver
Следующее
От: "Announce"
Дата:
Сообщение: Re: org.postgresql.Driver