Re: [sqlite] Does sqlite3 support alter table add primary key?

2019-04-10 Thread Keith Medcalf

CREATE UNIQUE INDEX  on H1 (...the unique columns...).

Primary key is (except for the INTEGER PRIMARY KEY in a rowid table) and in 
WITHOUT ROWID tables where it is the key of the b-tree, just semantic sugar for 
a UNIQUE index ...

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.


>-Original Message-
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of Peng Yu
>Sent: Wednesday, 10 April, 2019 06:11
>To: SQLite mailing list
>Subject: [sqlite] Does sqlite3 support alter table add primary key?
>
>Hi,
>
>I got the following error. Does sqlite3 support alter table add
>primary key?
>
>sqlite> alter table mytab add primary key (h1);
>Error: near "primary": syntax error
>
>https://www.tutorialspoint.com/sqlite/sqlite_primary_key.htm
>
>--
>Regards,
>Peng
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Does sqlite3 support alter table add primary key?

2019-04-10 Thread Shawn Wagner
I don't think I've ever seen a decent sqlite page on tutorialspoint. Some,
like this one, appear to have been written by people who have never
actually used it.

On Wed, Apr 10, 2019, 5:11 AM Peng Yu  wrote:

> Hi,
>
> I got the following error. Does sqlite3 support alter table add primary
> key?
>
> sqlite> alter table mytab add primary key (h1);
> Error: near "primary": syntax error
>
> https://www.tutorialspoint.com/sqlite/sqlite_primary_key.htm
>
> --
> Regards,
> Peng
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Does sqlite3 support alter table add primary key?

2019-04-10 Thread David Raymond
Nope.

Here's the doc page with what SQLite supports: https://www.sqlite.org/lang.html
And here's the alter table page: https://www.sqlite.org/lang_altertable.html


-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Peng Yu
Sent: Wednesday, April 10, 2019 8:11 AM
To: SQLite mailing list
Subject: [sqlite] Does sqlite3 support alter table add primary key?

Hi,

I got the following error. Does sqlite3 support alter table add primary key?

sqlite> alter table mytab add primary key (h1);
Error: near "primary": syntax error

https://www.tutorialspoint.com/sqlite/sqlite_primary_key.htm

-- 
Regards,
Peng
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Does sqlite3 support alter table add primary key?

2019-04-10 Thread Peng Yu
Hi,

I got the following error. Does sqlite3 support alter table add primary key?

sqlite> alter table mytab add primary key (h1);
Error: near "primary": syntax error

https://www.tutorialspoint.com/sqlite/sqlite_primary_key.htm

-- 
Regards,
Peng
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users