Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a couple incompatibilities with 7.3.2 that crept in.

REVOKE EXECUTE ON FUNCTION plr_environ() FROM PUBLIC to avoid security
problems from non-priv users seeing the environment.

Updated docs for changes since 0.3.1
  • Loading branch information...
commit 9540c615cf4ea03f2309b23e31ff12afd42b5bd7 1 parent b0bf1b1
postgres authored
45 doc/plr.sgml
View
@@ -56,13 +56,11 @@
<note>
<para>
- PL/R should build cleanly with PostgreSQL 7.3.x. It was developed using libR
- from R 1.6.2 under Red Hat 7.3 & 8.0.
- </para>
-
- <para>
- PL/R has also passed its regression test with PostgreSQL 7.4devel and
- R 1.7devel under Red Hat 7.3 & 8.0.
+ PL/R should build cleanly with PostgreSQL 7.3.x, and 7.4devel. It was
+ initially developed using libR from R 1.6.2 under Red Hat 7.3 & 8.0. PL/R
+ has also passed its regression test with R 1.7.0 under Red Hat 7.3 & 8.0.
+ On Red Hat 9, the R-patched (R 1.7.0 with subsequent release 1.7.x patches)
+ distribution is required (and passes `make installcheck`).
</para>
</note>
@@ -790,7 +788,21 @@ select * from test_spi_execp('sp') as t(typeid oid, typename name);
</varlistentry>
<varlistentry>
- <term><function>array</function>
+ <term><function>reload_plr_modules</function>
+ ()
+ </term>
+ <listitem>
+ <para>
+ Force re-loading of R code from the <literal>plr_modules</literal>
+ table. It is useful after modifying the contents of
+ <literal>plr_modules</literal>, so that the change will have an
+ immediate effect.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><function>plr_singleton_array</function>
(<type>float8</type> <replaceable>first_element</replaceable>)
</term>
<listitem>
@@ -820,7 +832,7 @@ select array('hello','world');
</varlistentry>
<varlistentry>
- <term><function>array_push</function>
+ <term><function>plr_array_push</function>
(<type>float8[]</type> <replaceable>array</replaceable>,
<type>float8</type> <replaceable>next_element</replaceable>)
</term>
@@ -849,7 +861,7 @@ select array_push(array('hello','world'), 'how are you');
</varlistentry>
<varlistentry>
- <term><function>array_accum</function>
+ <term><function>plr_array_accum</function>
(<type>float8[]</type> <replaceable>state_value</replaceable>,
<type>float8</type> <replaceable>next_element</replaceable>)
</term>
@@ -896,6 +908,19 @@ select array_accum('{23,35}', 42);
</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><function>plr_environ</function>()</term>
+ <listitem>
+ <para>
+ Displays the environment under which the Postmaster is currently
+ running. This may be useful to debug issues related to R specific
+ environment variables. This function is installed with EXECUTE
+ permission revoked from PUBLIC.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</chapter>
3  pg_backend_support.c
View
@@ -182,8 +182,7 @@ void
perm_fmgr_info(Oid functionId, FmgrInfo *finfo)
{
fmgr_info_cxt(functionId, finfo, TopMemoryContext);
- finfo->fn_mcxt = thisQueryContext;
- finfo->fn_expr = (Node *) NULL;
+ INIT_AUX_FMGR_ATTS;
}
void
2  pg_userfuncs.c
View
@@ -295,7 +295,7 @@ plr_environ(PG_FUNCTION_ARGS)
rsinfo->returnMode = SFRM_Materialize;
/* initialize our tuplestore */
- tupstore = tuplestore_begin_heap(true, false, SortMem);
+ tupstore = TUPLESTORE_BEGIN_HEAP;
for (current_env = environ;
current_env != NULL && *current_env != NULL;
17 plr.h
View
@@ -194,7 +194,13 @@ extern SEXP R_ParseVector(SEXP, int, int *);
} while (0)
#define CHECK_POLYMORPHIC_TYPES
-#define thisQueryContext QueryContext
+
+#define INIT_AUX_FMGR_ATTS \
+ do { \
+ finfo->fn_mcxt = QueryContext; \
+ } while (0)
+
+#define palloc0(sz_) palloc(sz_)
#else
/*************************************************************************
@@ -251,10 +257,11 @@ extern SEXP R_ParseVector(SEXP, int, int *);
} \
} while (0)
-#define thisQueryContext MessageContext
-#undef thisQueryContext /* temporary until Tom's mcxt changes are committed */
-#define thisQueryContext QueryContext
-
+#define INIT_AUX_FMGR_ATTS \
+ do { \
+ finfo->fn_mcxt = QueryContext; \
+ finfo->fn_expr = (Node *) NULL; \
+ } while (0)
#endif /* PG_VERSION_73_COMPAT */
2  plr.sql.in
View
@@ -37,6 +37,8 @@ RETURNS SETOF plr_environ_type
AS 'MODULE_PATHNAME','plr_environ'
LANGUAGE 'C';
+REVOKE EXECUTE ON FUNCTION plr_environ() FROM PUBLIC;
+
CREATE TYPE r_typename AS (typename text, typeoid oid);
CREATE OR REPLACE FUNCTION r_typenames()
RETURNS SETOF r_typename AS '
Please sign in to comment.
Something went wrong with that request. Please try again.