- Nov 23, 2004
-
-
Tom Lane authored
data returned from Perl. Consolidate multiple bits of code to convert a Perl hash to a tuple, and drive the conversion off the keys present in the hash rather than the tuple column names, so we detect error if the hash contains keys it shouldn't. (This means keys not in the hash will silently default to NULL, which seems ok to me.) Fix a bunch of reference-count leaks too.
-
- Nov 22, 2004
-
-
Tom Lane authored
Get rid of static variables for SETOF result, don't crash when called from non-FROM context, eliminate dead code, etc.
-
- Nov 21, 2004
-
-
Tom Lane authored
it's not really broken. Andrew Dunstan
-
Tom Lane authored
operations are now run as subtransactions, so that errors in them can be reported as ordinary Perl or Tcl errors and caught by the normal error handling convention of those languages. Also do some minor code cleanup in pltcl.c: extract a large chunk of duplicated code in pltcl_SPI_execute and pltcl_SPI_execute_plan into a shared subroutine.
-
- Nov 20, 2004
-
-
Tom Lane authored
rather than longjmp'ing clear out of Perl and thereby leaving Perl in a broken state. Also some minor prettification of error messages. Still need to do something with spi_exec_query() error handling.
-
- Nov 18, 2004
-
-
Tom Lane authored
may expand the Perl stack, therefore we must SPAGAIN to reload the local stack pointer after calling it. Also a couple other marginal readability improvements.
-
- Nov 17, 2004
-
-
Tom Lane authored
some of the bugs exposed thereby. The remaining 'might be used uninitialized' warnings look like live bugs, but I am not familiar enough with Perl/C hacking to tell how to fix them.
-
- Nov 16, 2004
-
-
Tom Lane authored
patch, but allow srand and disallow sprintf as per subsequent discussion.
-
- Oct 15, 2004
-
-
Bruce Momjian authored
1. Two minor cleanups: - We don't need to call hv_exists+hv_fetch; we should just check the return value of hv_fetch. - newSVpv("undef",0) is the string "undef", not a real undef. 2. This should fix the bug Andrew Dunstan described in a recent -hackers post. It replaces three bogus "eval_pv(key, 0)" calls with newSVpv, and eliminates another redundant hv_exists+hv_fetch pair. 3. plperl_build_tuple_argument builds up a string of Perl code to create a hash representing the tuple. This patch creates the hash directly. 4. Another minor cleanup: replace a couple of av_store()s with av_push. 5. Analogous to #3 for plperl_trigger_build_args. This patch removes the static sv_add_tuple_value function, which does much the same as two other utility functions defined later, and merges the functionality into plperl_hash_from_tuple. I have tested the patches to the best of my limited ability, but I would appreciate it very much if someone else could review and test them too. (Thanks to Andrew and David Fetter for their help with some testing.) Abhijit Menon-Sen
-
- Oct 07, 2004
-
-
Bruce Momjian authored
-
Bruce Momjian authored
-
- Oct 06, 2004
-
-
Bruce Momjian authored
uid_t/gid_t too.
-
- Sep 13, 2004
-
-
Tom Lane authored
mode see a fresh snapshot for each command in the function, rather than using the latest interactive command's snapshot. Also, suppress fresh snapshots as well as CommandCounterIncrement inside STABLE and IMMUTABLE functions, instead using the snapshot taken for the most closely nested regular query. (This behavior is only sane for read-only functions, so the patch also enforces that such functions contain only SELECT commands.) As per my proposal of 6-Sep-2004; I note that I floated essentially the same proposal on 19-Jun-2002, but that discussion tailed off without any action. Since 8.0 seems like the right place to be taking possibly nontrivial backwards compatibility hits, let's get it done now.
-
- Aug 30, 2004
-
-
Bruce Momjian authored
-
- Aug 29, 2004
-
-
Bruce Momjian authored
-
- Jul 31, 2004
-
-
Tom Lane authored
possible to trap an error inside a function rather than letting it propagate out to PostgresMain. You still have to use AbortCurrentTransaction to clean up, but at least the error handling itself will cooperate.
-
- Jul 21, 2004
-
-
Bruce Momjian authored
foo()' where foo() is a plperl function that returns a single composite. Andrew Dunstan
-
- Jul 12, 2004
-
-
Bruce Momjian authored
currently unapplied regarding spi_internal.c, makes some additional fixes relating to return types, and also contains the fix for preventing the use of insecure versions of Safe.pm. There is one remaing return case that does not appear to work, namely return of a composite directly in a select, i.e. if foo returns some composite type, 'select * from foo()' works but 'select foo()' doesn't. We will either fix that or document it as a limitation. The function plperl_func_handler is a mess - I will try to get it cleaned up (and split up) in a subsequent patch, time permitting. Also, reiterating previous advice - this changes slightly the API for spi_exec_query - the returned object has either 2 or 3 members: 'status' (string) and 'proceesed' (int,- number of rows) and, if rows are returned, 'rows' (array of tuple hashes). Andrew Dunstan
-
- Jul 01, 2004
-
-
Joe Conway authored
plperlNG. Review and minor cleanup/improvements by Joe Conway. Summary of new functionality: - Shared data space and namespace. There is a new global variable %_SHARED that functions can use to store and save data between invocations of a function, or between different functions. Also, all trusted plperl function now share a common Safe container (this is an optimization, also), which they can use for storing non-lexical variables, functions, etc. - Triggers are now supported - Records can now be returned (as a hash reference) - Sets of records can now be returned (as a reference to an array of hash references). - New function spi_exec_query() provided for performing db functions or getting data from db. - Optimization for counting hash keys (Abhijit Menon-Sen) - Allow return of 'record' and 'setof record'
-
- Jun 06, 2004
-
-
Tom Lane authored
of a composite type to get that type's OID as their second parameter, in place of typelem which is useless. The actual changes are mostly centralized in getTypeInputInfo and siblings, but I had to fix a few places that were fetching pg_type.typelem for themselves instead of using the lsyscache.c routines. Also, I renamed all the related variables from 'typelem' to 'typioparam' to discourage people from assuming that they necessarily contain array element types.
-
- Apr 01, 2004
-
-
Tom Lane authored
results with tuples as ordinary varlena Datums. This commit does not in itself do much for us, except eliminate the horrid memory leak associated with evaluation of whole-row variables. However, it lays the groundwork for allowing composite types as table columns, and perhaps some other useful features as well. Per my proposal of a few days ago.
-
- Jan 07, 2004
-
-
Tom Lane authored
parameters to be declared with names. pg_proc has a column to store names, and CREATE FUNCTION can insert data into it, but that's all as yet. I need to do more work on the pg_dump and plpgsql portions of the patch before committing those, but I thought I'd get the bulky changes in before the tree drifts under me. initdb forced due to pg_proc change.
-
- Nov 29, 2003
-
-
PostgreSQL Daemon authored
$Header: -> $PostgreSQL Changes ...
-
- Sep 04, 2003
-
-
Tom Lane authored
-
- Aug 04, 2003
-
-
Bruce Momjian authored
-
- Jul 31, 2003
-
-
Tom Lane authored
function is not found. Also, make all the PL libraries have initialization functions with standard names. Patch from Joe Conway.
-
- Jul 26, 2003
-
-
Tom Lane authored
look ... I'm not real certain which errors are strictly internal and which are likely to be provoked by users.
-
- Apr 20, 2003
-
-
Tom Lane authored
-
- Sep 21, 2002
-
-
Tom Lane authored
with OPAQUE. CREATE LANGUAGE, CREATE TRIGGER, and CREATE TYPE will all accept references to functions declared with OPAQUE --- but they will issue a NOTICE, and will modify the function entries in pg_proc to have the preferred type-safe argument or result types instead of OPAQUE. Per recent pghackers discussions.
-
- Sep 05, 2002
-
-
Tom Lane authored
remove unnecessary inclusions.
-
- Sep 04, 2002
-
-
Bruce Momjian authored
-
- Aug 22, 2002
-
-
Tom Lane authored
with OPAQUE, as per recent pghackers discussion. I still want to do some more work on the 'cstring' pseudo-type, but I'm going to commit the bulk of the changes now before the tree starts shifting under me ...
-
- Jun 15, 2002
-
-
Bruce Momjian authored
HeapTupleHeaderData in setter and getter macros called HeapTupleHeaderGetXmin, HeapTupleHeaderSetXmin etc. It also introduces a "virtual" field xvac by defining HeapTupleHeaderGetXvac and HeapTupleHeaderSetXvac. Xvac is used by VACUUM, in fact it is stored in t_cmin. Manfred Koizar
-
- May 05, 2002
-
-
Tom Lane authored
As proof of concept, provide an alternate implementation based on POSIX semaphores. Also push the SysV shared-memory implementation into a separate file so that it can be replaced conveniently.
-
- Mar 06, 2002
-
-
Bruce Momjian authored
still needed because only removed in 7.4.
-
- Jan 24, 2002
- Nov 05, 2001
-
-
Bruce Momjian authored
initdb/regression tests pass.
-
- Oct 25, 2001
-
-
Bruce Momjian authored
tests pass.
-
- Oct 20, 2001
-
-
Tom Lane authored
REPLACE FUNCTION. Clean up typlen/typmod errors inherited from pltcl.
-