Do I need a primary key for my table, which has a UNIQUE (composite 4-columns), one of which can be NULL?
问题 I have the following table (PostgreSQL 8.3) which stores prices of some products. The prices are synchronised with another database, basically most of the fields below (apart from one) are not updated by our client - but instead dropped and refreshed every once-in-a-while to sync with another stock database: CREATE TABLE product_pricebands ( template_sku varchar(20) NOT NULL, colourid integer REFERENCES colour (colourid) ON DELETE CASCADE, currencyid integer NOT NULL REFERENCES currency