Re: PL/Perl Does not Like vstrings - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: PL/Perl Does not Like vstrings
Date
Msg-id 6A6DE41F-234A-4D4A-A095-C0E4D454C915@justatheory.com
Whole thread Raw
In response to Re: PL/Perl Does not Like vstrings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Jan 5, 2012, at 9:41 AM, Tom Lane wrote:

> I would imagine you could reproduce it by returning the same kinds of
> objects as function results, since the actual problem is in utf8 to
> database-encoding conversion.
>
>> No segfault, at least, though that‚s a rather bizarre error message. AFAIK, $^V isn‚t a hash. This works, though:
>>    spi_query_prepared($plan, v1);
>
> Is that actually a vstring?  I confess I'd never heard of the things
> before this thread, but I remember reading somewhere that you need
> multiple dots in a string before it's considered a vstring and not
> something else.

Yes, it is. You can declare v-strings either by prepending a "v" to one or more dot-separated integers, or just 3 or
moredotted integers. 
 http://austin.pm.org/presentations/march2000/raty/vstrings.html

I believe the latter syntax is deprecated, though; it turned out to be confusing and pretty roundly hated. It's
preferredto use the v syntax. 

Best,

David



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: PL/Perl Does not Like vstrings
Next
From: "David E. Wheeler"
Date:
Subject: Re: PL/Perl Does not Like vstrings