artifact_id;status_id;status_name;priority;submitter_id;submitter_name;assigned_to_id;assigned_to_name;open_date;close_date;last_modified_date;summary;details;"Category";"Group"
1010848;1;"Open";3;148521;"Luca Ferrari";100;"Nobody";"2010-06-23 07:54";"";"2012-09-24 02:14";"Cancelling a Trigger operation";"This patch can be used to cancel a trigger operation using the TriggerData Java object. The idea is that, since the method that will receive the TriggerData object can interact with the backend only with such object, the cancel request must be performed thru the TriggerData interface/object itself. So I've added methods to set and get the status of a ""aborted"" flag for the current request. If the trigger data object has the aborted flag set, than the getResultTrigger method will return a (long) 0, to indicate that the current operation has been aborted. The backend, in the functions.c file, will manage such zero as an abort and discard the current operation.

I've tested the patch against the following system:
- PostgreSQL 8.4.4 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real 
(Ubuntu 4.4.3-4ubuntu5) 4.4.3, 64-bit
- the latest version of the pljava sources
- jdk 1.5.0_22 on Ubuntu 64 bit
- gcc 4.4.3

Step by step the patch works as follows:
1) the internal/TriggerData class now implements such methods using a simple 
boolean flag to indicate if the current statement must be cancelled or not. 
Please note that there is a utility method to check the conditions on which a 
statement can be aborted.
2) the internal/TriggerData class when returning the tuple to apply, simply 
returns 0 if the statement has been cancelled. Such 0 is interpreted as a NULL 
result in the backend code (Functions.c) and therefore the trigger aborts the 
current operation.
3) when asking for a newResultSet on TriggerData, the system checks if the 
trigger has already been marked for cancelling the current statement, so that 
the returned result set is set read-only. This is not the optimal solution, 
since one can get the result set before cancelling the trigger, but in any 
case the getTriggerResultTuple will avoid insertions/updates.";"None";"None"
1011103;1;"Open";3;115502;"Nathan Egge";100;"Nobody";"2011-10-13 21:28";"";"2012-09-24 02:14";"SPIDatabaseMetaData.getSchemas(String catalog,String schemaPattern) patch";"Adding support for the JDBC4 (Java 1.6) DatabaseMetaData interface method:

ReslutSet getSchemas(String catalog,String schemaPattern) throws SQLException;";"None";"None"
1011104;1;"Open";3;115502;"Nathan Egge";100;"Nobody";"2011-10-13 21:31";"";"2012-09-24 02:14";"SPIResultSetMetaData.getColumnLabel(int column) bug fix";"The toUpperCase() on the column name in SPIResultSetMetaData.getColumnLabel() is out of line with how the postgresql-jdbc driver works and is the cause of NPEs in my application.";"None";"None"
1011105;1;"Open";3;115502;"Nathan Egge";100;"Nobody";"2011-10-13 23:19";"";"2012-09-24 02:14";"SPIDatabaseMetaData.getPrimaryKeys updated to 8.1+ jdbc code";"The current getPrimaryKeys method appears to use an older 7.3+ style of retrieving the primary keys from the pg_catalog table.  This older code does not work when the tables have been altered.

Attaching a patch to upgrade to the 8.1+ style of retrieving the meta data.

NOTE: Unlike the official JDBC driver, pl/Java does not appear to use the DB version internally to craft the different metadata queries.  This may become an issue as postgresql continues to evolve and / or the inclusion of a JDBC5 spec.";"None";"None"
1011111;1;"Open";3;115502;"Nathan Egge";100;"Nobody";"2011-11-04 12:29";"";"2012-09-24 02:14";"postmaster hangs if JVM does not close nicely in windows";"I came across an issue where the postmaster process was not shutting down after a client disconnected because there were resources and threads still running in the Java Virtual Machine.  This only happens in Windows because in Linux the JVM is forcefully destroyed.

In order to fix this, I added a BackendListener class which can receive events about the JVM being destroyed before it happens and cleanly shutdown any resources its holding.  Patch is attached.

I have tested this in Windows and Linux and works well.";"None";"None"