Re: Fault when return strings over 256 characters in PLpgSQL

From: Neil Conway <neilc(at)samurai(dot)com>
To: cathy(dot)hemsley(at)powerconv(dot)alstom(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Fault when return strings over 256 characters in PLpgSQL
Date: 2005-03-09 11:56:20
Message-ID: 422EE464.8060804@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

cathy(dot)hemsley(at)powerconv(dot)alstom(dot)com wrote:
> I have a PLpgSQL function that returns a string (varchar): if this string
> is over 256 characters long then the last three characters are corrupted:
> replaced by the string ' (.'

I'm skeptical: there is nothing special about 256 characters as far as
the varchar implementation is concerned, nor is the string ' (.' of any
significance.

Running your function (albeit on Linux) yields:

neilc=# select testconverttousername();

testconverttousername

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567888
(1 row)

i.e. what one would expect.

-Neil

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Josh Berkus 2005-03-09 17:49:30 Re: [pgsql-bugs] Daily digest v1.1387 (8 messages)
Previous Message cathy.hemsley 2005-03-09 11:11:46 Fault when return strings over 256 characters in PLpgSQL function