aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plperl/plperl_helpers.h
Commit message (Collapse)AuthorAge
* PL/Perl portability fix: avoid including XSUB.h in plperl.c.Tom Lane2017-07-31
| | | | | | | | | Back-patch of commit bebe174bb4462ef079a1d7eeafb82ff969f160a4, which see for more info. Patch by me, with some help from Ashutosh Sharma Discussion: https://postgr.es/m/CANFyU97OVQ3+Mzfmt3MhuUm5NwPU=-FtbNH5Eb7nZL9ua8=rcA@mail.gmail.com
* Fix plperl to handle non-ASCII error message texts correctly.Tom Lane2015-09-29
| | | | | | | | | | | | | | | | | We were passing error message texts to croak() verbatim, which turns out not to work if the text contains non-ASCII characters; Perl mangles their encoding, as reported in bug #13638 from Michal Leinweber. To fix, convert the text into a UTF8-encoded SV first. It's hard to test this without risking failures in different database encodings; but we can follow the lead of plpython, which is already assuming that no-break space (U+00A0) has an equivalent in all encodings we care about running the regression tests in (cf commit 2dfa15de5). Back-patch to 9.1. The code is quite different in 9.0, and anyway it seems too risky to put something like this into 9.0's final minor release. Alex Hunsaker, with suggestions from Tim Bunce and Tom Lane
* Add transforms featurePeter Eisentraut2015-04-26
| | | | | | | | This provides a mechanism for specifying conversions between SQL data types and procedural languages. As examples, there are transforms for hstore and ltree for PL/Perl and PL/Python. reviews by Pavel Stěhule and Andres Freund
* Prefer pg_any_to_server/pg_server_to_any over pg_do_encoding_conversion.Tom Lane2014-02-23
| | | | | | | | | | | | | | | | | | | | A large majority of the callers of pg_do_encoding_conversion were specifying the database encoding as either source or target of the conversion, meaning that we can use the less general functions pg_any_to_server/pg_server_to_any instead. The main advantage of using the latter functions is that they can make use of a cached conversion-function lookup in the common case that the other encoding is the current client_encoding. It's notationally cleaner too in most cases, not least because of the historical artifact that the latter functions use "char *" rather than "unsigned char *" in their APIs. Note that pg_any_to_server will apply an encoding verification step in some cases where pg_do_encoding_conversion would have just done nothing. This seems to me to be a good idea at most of these call sites, though it partially negates the performance benefit. Per discussion of bug #9210.
* pgindent run for release 9.3Bruce Momjian2013-05-29
| | | | | This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
* plperl: Skip setting UTF8 flag when in SQL_ASCII encodingAlvaro Herrera2012-07-10
| | | | | | | | | | | | | | | | When in SQL_ASCII encoding, strings passed around are not necessarily UTF8-safe. We had already fixed this in some places, but it looks like we missed some. I had to backpatch Peter Eisentraut's a8b92b60 to 9.1 in order for this patch to cherry-pick more cleanly. Patch from Alex Hunsaker, tweaked by Kyotaro HORIGUCHI and myself. Some desultory cleanup and comment addition by me, during patch review. Per bug report from Christoph Berg in 20120209102116.GA14429@msgid.df7cb.de
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-10
| | | | commit-fest.
* PL/Perl: Avoid compiler warning from clangPeter Eisentraut2012-05-27
| | | | | Use SvREFCNT_inc_simple_void() instead of SvREFCNT_inc() to avoid warning about unused return value.
* Fix misleading commentsPeter Eisentraut2012-05-08
| | | | Josh Kupershmidt
* Improve efficiency of recent changes to plperl's sv2cstr().Andrew Dunstan2012-01-15
| | | | | | Along the way, add a missing dependency in the GNUmakefile. Alex Hunsaker, with a slight adjustment by me.
* Fix breakage from earlier plperl fix.Andrew Dunstan2012-01-05
| | | | | Apparently the perl garbage collector was a bit too eager, so here we control when the new SV is garbage collected.
* Work around perl bug in SvPVutf8().Andrew Dunstan2012-01-05
| | | | | | | | | | | Certain things like typeglobs or readonly things like $^V cause perl's SvPVutf8() to die nastily and crash the backend. To avoid that bug we make a copy of the object, which will subsequently be garbage collected. Back patched to 9.1 where we first started using SvPVutf8(). Per -hackers discussion. Original problem reported by David Wheeler.
* Ensure plperl strings are always correctly UTF8 encoded.Andrew Dunstan2011-11-26
| | | | | | Amit Khandekar and Alex Hunsaker. Backpatched to 9.1 where the problem first occurred.
* pgindent run before PG 9.1 beta 1.Bruce Momjian2011-04-10
|
* Force strings passed to and from plperl to be in UTF8 encoding.Andrew Dunstan2011-02-06
String are converted to UTF8 on the way into perl and to the database encoding on the way back. This avoids a number of observed anomalies, and ensures Perl a consistent view of the world. Some minor code cleanups are also accomplished. Alex Hunsaker, reviewed by Andy Colson.