vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Can unique only reference columns? Am I not able to do what I'm trying to do here, or am I just being stupid about how I'm trying to do it? create type e_mail as (address text, domain text); CREATE TYPE create table e_mail_t ( e email, unique((e).address, (e).domain) ); ERROR: syntax error at or near "(" LINE 1: create table e_mail_t ( e email, unique((e).address, (e).dom... ^ create table e_mail_t ( e email, unique(e)); ERROR: data type email has no default operator class for access method "btree" HINT: You must specify an operator class for the index or define a default operator class for the data type. ERROR: syntax error at or near ")" LINE 1: ) __________________________________________________ __________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| ||||
| Andrew Winkler <the_andrew_winkler@yahoo.com> writes: > Can unique only reference columns? Yup, that's what the SQL spec syntax says. Instead, use CREATE UNIQUE INDEX. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |