开发者

What's wrong with my CREATE TABLE command?

开发者 https://www.devze.com 2023-04-12 04:22 出处:网络
I\'m following the instructions from this document. My exact version is 8.4.4. This is what I try to do

I'm following the instructions from this document. My exact version is 8.4.4.

This is what I try to do

CREATE TABLE testInfo (
               testNo integer PRIMARY KEY,
               product varchar(15),
             开发者_Go百科  firmware varchar(15),
               startDate date,
               eta date
);

NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "testinfo_pkey" for table "testinfo"

It totally ignores my PRIMARY KEY constraint. I don't see whay this isn't essentially the same as the example in the docs.

CREATE TABLE products (
product_no integer PRIMARY KEY,
name text,
price numeric

)

I'm sure the obvious is staring me right in the face. Nevertheless I would appreciate any help offered.

Update: I just tried the example from the documentation, returns the same message. So may I conclude the documentation is in error, or that 8.4.4 is buggy?


I'm no Postgresql expert, but it appears the message is simply to inform you that an INDEX is being created to assist in the implementation of the PRIMARY KEY that you defined.


It's not ignoring your primary key, it's telling you the mechanism it will use to enforce it. This message can be disabled with client_min_messages (warning).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号