+1
На рассмотрении

SQL import for postgres fails to infer NOT NULL for PRIMARY KEY

Tomasz Traczyk 9 лет назад обновлен anonymous 9 лет назад 1

For the following CREATE statement

CREATE TABLE tst (
     id int,
     primary key (id)
);

postgres infers, that since id is primary key, it should be not null and ends up creating following table:

| Column |  Type   | Modifiers 
|--------+---------+----------- | id | integer | not null

In vertabelo, while importing model form SQL, the not null modifier is not added and I get "Primary key column can't be null" error.


Сервис поддержки клиентов работает на платформе UserEcho