Skip site navigation (1) Skip section navigation (2)

Bug in CREATE FUNCTION with character type

From: Pavel Golub <pavel(at)microolap(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug in CREATE FUNCTION with character type
Date: 2010-04-12 12:51:28
Message-ID: (view raw or whole thread)
Lists: 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.


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

pqfmod function from libpq library for salesourcecode column returns
0, which is wrong. Who can ever imagine bpchar of length 0? :)

With best wishes,
 Pavel                          mailto:pavel(at)gf(dot)microolap(dot)com


pgsql-bugs by date

Next:From: Robert HaasDate: 2010-04-12 13:23:56
Subject: Re: initdb stores default client_encoding from environment-variable
Previous:From: Martin von GagernDate: 2010-04-12 12:15:45
Subject: build error: strlcat/strlcpy used from heimdal

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group