mirror of
https://github.com/zebrajr/postgres.git
synced 2025-12-07 12:20:31 +01:00
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
43 lines
921 B
SQL
43 lines
921 B
SQL
|
|
CREATE TABLE users (
|
|
fname text not null,
|
|
lname text not null,
|
|
username text,
|
|
userid serial,
|
|
PRIMARY KEY(lname, fname)
|
|
) ;
|
|
|
|
CREATE INDEX users_username_idx ON users(username);
|
|
CREATE INDEX users_fname_idx ON users(fname);
|
|
CREATE INDEX users_lname_idx ON users(lname);
|
|
CREATE INDEX users_userid_idx ON users(userid);
|
|
|
|
|
|
CREATE TABLE taxonomy (
|
|
id serial primary key,
|
|
name text unique
|
|
) ;
|
|
|
|
CREATE TABLE entry (
|
|
accession text not null primary key,
|
|
eid serial unique,
|
|
txid int2 not null references taxonomy(id)
|
|
) ;
|
|
|
|
CREATE TABLE sequences (
|
|
eid int4 not null references entry(eid),
|
|
pid serial primary key,
|
|
product text not null,
|
|
sequence text not null,
|
|
multipart bool default 'false'
|
|
) ;
|
|
CREATE INDEX sequences_product_idx ON sequences(product) ;
|
|
|
|
CREATE TABLE xsequences (
|
|
pid int4 not null references sequences(pid),
|
|
sequence text not null
|
|
) ;
|
|
CREATE INDEX xsequences_pid_idx ON xsequences(pid) ;
|
|
|
|
|