Error when creating a char column as primary key
От | Gavin Reade |
---|---|
Тема | Error when creating a char column as primary key |
Дата | |
Msg-id | B8FEA14EC151D511A88600A02455038F0D1383@han2601.natpower.co.uk обсуждение исходный текст |
Список | pgsql-novice |
Hi folks, Complete novice here! I am trying to create a table as; CREATE TABLE table (serial_no VARCHAR[16] PRIMARY KEY, date date DEFAULT current_date) when I issue this command postgres returns an error saying; ERROR: Can't find a default operator class for type 1015 I tried this as well; CREATE TABLE table (serial_no VARCHAR[16] PRIMARY KEY NOT NULL, date date DEFAULT current_date) but I get the same error. I guess that postgres is telling me that if there is no default value then you can't assign a primary key to the column. Is this the case or is there a work around that I can use without assigning a SERIAL type to another column as the primary key? Thanks, greadey **************************************************************************** The information contained in this email is intended only for the use of the intended recipient at the email address to which it has been addressed. If the reader of this message is not an intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination or copying of the message or associated attachments is strictly prohibited. If you have received this email in error, please contact the sender by return email or call 01793 877777 and ask for the sender and then delete it immediately from your system. Please note that neither Innogy nor the sender accepts any responsibility for viruses and it is your responsibility to scan attachments (if any). *****************************************************************************
В списке pgsql-novice по дате отправления: