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

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 (view raw or flat)
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

pgsql-bugs by date

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

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