Hmmm...works for me...


On Windows:

SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table test(a text primary key);
sqlite> insert into test values('1');
sqlite> insert into test values('1');
Error: column a is not unique

On Linux:

SQLite version 3.7.10 2012-01-16 13:28:40
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table test (a text primary key);
sqlite> insert into test values('1');
sqlite> insert into test values('1');
Error: column a is not unique



Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems

________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Oliver Peters [oliver....@web.de]
Sent: Friday, March 02, 2012 4:13 AM
To: sqlite-users@sqlite.org
Subject: EXT :Re: [sqlite] TEXT PRIMARY KEY

Am 02.03.2012 11:03, schrieb Oliver Peters:


sorry I meant

CREATE TABLE test(
a TEXT PRIMARY KEY
);

(without INTEGER, usually I write INTEGER and not TEXT :-) )

> Am 02.03.2012 10:44, schrieb Christoph P.U. Kukulies:
>> When defining a column TEXT PRIMARY KEY (is that possible on TEXT?),
>
> yes
>
>> would this imply uniqueness?
>
> yes
>
>> Or would I have to write something like TEXT PRIMARY KEY UNIQUE ?
>
> no and that doesn't make sense I'd say
>
>>
>
> [...]
>
>
> simply try (untested)
>
> CREATE TABLE test(
> a TEXT INTEGER PRIMARY KEY
> );
>
> INSERT INTO test(a) VALUES('1');
> INSERT INTO test(a) VALUES('1');
>
>
>
> oliver
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to