You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "Lukas Eder (Jira)" <ji...@apache.org> on 2021/01/21 13:20:00 UTC
[jira] [Created] (IGNITE-14029) Inconsistent handling of tables
with non primary key columns
Lukas Eder created IGNITE-14029:
-----------------------------------
Summary: Inconsistent handling of tables with non primary key columns
Key: IGNITE-14029
URL: https://issues.apache.org/jira/browse/IGNITE-14029
Project: Ignite
Issue Type: Bug
Components: sql
Affects Versions: 2.9.1
Reporter: Lukas Eder
This doesn't work:
{code:java}
CREATE TABLE t (i int);{code}
I'm getting this error
{noformat}
SQL Error [1001] [42000]: No PRIMARY KEY defined for CREATE TABLE{noformat}
However, this works perfectly fine:
{code:java}
CREATE TABLE t (i int PRIMARY KEY, dummy int);
ALTER TABLE t DROP dummy;{code}
I must say, I don't fully understand this arbitrary restriction. There are good reasons for tables to consist only of a primary key, when a schema is properly normalised. In any case, if there are good reasons to prevent tables without non primary key columns, then the ALTER TABLE statement must ensure this state is not achievable.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)