From 1f653ec31ef0f88af1216c0631605e859b4794a5 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Mon, 14 Oct 2002 04:20:52 +0000
Subject: I have attached two patches as per:

1) pltcl:
Add SPI_freetuptable() calls to avoid memory leaks (Me + Neil Conway)
Change sprintf()s to snprintf()s (Neil Conway)
Remove header files included elsewhere (Neil Conway)

2)plpython:
Add SPI_freetuptable() calls to avoid memory leaks
Cosemtic change to remove a compiler warning


Notes:

I have tested pltcl.c for
 a) the original leak problem reported for the repeated call of spi_exec
in a TCL fragment
and
 b) the subsequent report resulting from the use of spi_exec -array
in a TCL
fragment.

The plpython.c patch is exactly the same as that applied to make
revision 1.23,
the plpython_schema.sql and feature.expected sections of the patch are
also the
same as last submited, applied and subsequently reversed out. It remains
untested by me (other than via make check). However, this should be safe
provided PyString_FromString() _copies_ the given string to make a
PyObject.


Nigel J. Andrews
---
 src/pl/plpython/plpython_schema.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/pl/plpython/plpython_schema.sql')

diff --git a/src/pl/plpython/plpython_schema.sql b/src/pl/plpython/plpython_schema.sql
index 28ceef5535..2f8766431f 100644
--- a/src/pl/plpython/plpython_schema.sql
+++ b/src/pl/plpython/plpython_schema.sql
@@ -20,7 +20,7 @@ CREATE TABLE taxonomy (
 
 CREATE TABLE entry (
 	accession text not null primary key,
-	eid serial,
+	eid serial unique,
 	txid int2 not null references taxonomy(id)
 	) ;
 
-- 
cgit v1.2.1

