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

From Alex Hunsaker
Subject Re: PL/Perl Does not Like vstrings
Date
Msg-id CAFaPBrTk4ZxNd9ygu_bDgN-vD20bmFtefwTpBON-DkjdZyT-zQ@mail.gmail.com
Whole thread Raw
In response to Re: PL/Perl Does not Like vstrings  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Wed, Jan 4, 2012 at 13:13, Andrew Dunstan <andrew@dunslane.net> wrote:
>
>
> On 01/04/2012 12:56 PM, Tom Lane wrote:

>> I looked at that last night but it appeared that SvOK would be perfectly
>> happy.  (Didn't actually try it, though, I was just eyeballing the flags
>> in gdb.)

>
> I tested it and you're right, it doesn't help. I don't see what else we can
> do about it. There doesn't appear to be any test for an SV in the API.

I think about the best we can do is something along the lines of:

sv2cstr()
{
... if (Perl_vverify(sv))  return utf_u2e(SvPV(sv));
...
}

I dont the the utf_u2e is strictly needed (other than that it strdups)
as I don't think versions can have utf8 chars, or at least that $^V
will not have utf8 chars (and even if it did it would only cause
problems if they had codepoints in >128  <255).

We would still have issues with typeglobs...


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Avoid FK validations for no-rewrite ALTER TABLE ALTER TYPE
Next
From: Robert Haas
Date:
Subject: Re: Page Checksums + Double Writes