postgresql.sql

text/plain

Filename: postgresql.sql
Type: text/plain
Part: 1
Message: Table corruption on drop
/*
 * Cmail schema
 */

/*
 * The ux table  provides the basis for application driven unique ID
 * generation. Each instance of the application  obtains a 'session'
 * and assigns id's consecutively in that session. When it terminates,
 * the session id and next available id in that session are written
 *  back to the DB.
 */

drop table unique_id;
create table unique_id (
       session  integer,
       id  integer
);

create unique index unique_id_index on unique_id(session, id);

drop table domain;
create table domain(
       id    integer,
       name  varchar(128),
       primary key(name)
);