DODS Project
About DODS
Project Mail Lists
FAQs




DODS FAQs - Can I use any column as a Primary Key?
dods.gif (11357 bytes)In release 6.x, only OID columns can be primary keys.

For example, generated create_tables.sql file looks like this: 

create table person (
    login VARCHAR(32) DEFAULT "" NOT NULL   ,
    password VARCHAR(32) DEFAULT "" NOT NULL   ,
    firstname VARCHAR(32) DEFAULT "" NOT NULL   ,
    lastname VARCHAR(32) DEFAULT "" NOT NULL   ,
    oid DECIMAL(19,0) NOT NULL PRIMARY KEY,
    version INTEGER NOT NULL
);
 
create table Disc (
    title VARCHAR(32) DEFAULT "" NOT NULL   ,
    artist VARCHAR(32) DEFAULT "" NOT NULL   ,
    genre VARCHAR(32) DEFAULT "" NOT NULL   ,
    owner DECIMAL(19,0)  NOT NULL  REFERENCES person ( oid ) ,
    isLiked INTEGER DEFAULT 0 NOT NULL   ,
    oid DECIMAL(19,0) NOT NULL PRIMARY KEY,
    version INTEGER NOT NULL
);

Due to new DODS 6.0 improvements (caching, query caching, transactions, global cache, table and cache statisics and administration, security,...),  non oid primary keys are not currently supported. The DODS team is working on this implementation, and it would be soon released. 

 

For all the latest information on DODS, please refer to http://dods.enhydra.org/
Questions, comments, feedback? Let us know...