Bug in CREATE FUNCTION with character type

Поиск
Список
Период
Сортировка
От Pavel Golub
Тема Bug in CREATE FUNCTION with character type
Дата
Msg-id 864494396.20100412155128@gf.microolap.com
обсуждение исходный текст
Ответы Re: Bug in CREATE FUNCTION with character type (CONFIRMED BUG)  (Craig Ringer <craig@postnewspapers.com.au>)
Re: Bug in CREATE FUNCTION with character type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Hello, Pgsql-bugs.

PostgreSQL version: 8.4.x
Operating system:   All

If RETURNS TABLE clause of CREATE FUNCTION contain column of character type (withou
length specifier) it should be treated as character(1) according to
manual, but it look like text.
(http://www.postgresql.org/docs/8.4/static/datatype-character.html)

Example:

CREATE OR REPLACE FUNCTION test_char_function()
  RETURNS TABLE(id int, salesourcecode character) AS
$BODY$
VALUES (1, 'one'), (2, 'two'), (3, 'three');
$BODY$
  LANGUAGE 'sql'

pqfmod function from libpq library for salesourcecode column returns
0, which is wrong. Who can ever imagine bpchar of length 0? :)
(http://www.postgresql.org/docs/8.4/static/libpq-exec.html#LIBPQ-EXEC-SELECT-INFO)

--
With best wishes,
 Pavel                          mailto:pavel@gf.microolap.com

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

Предыдущее
От: Martin von Gagern
Дата:
Сообщение: build error: strlcat/strlcpy used from heimdal libroken.so
Следующее
От: Robert Haas
Дата:
Сообщение: Re: initdb stores default client_encoding from environment-variable