Tag Info

New answers tagged


at least MySQL 5.6 - support auto increment column as part of composite index CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL, `rid` int(11) DEFAULT NULL, `int1` int(11) DEFAULT NULL, `test` varchar(255) NOT NULL, PRIMARY KEY (`id`,`uid`,`test`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; perfect ...


If you want to do this in PGAdmin, it is much easier than using the command line. It seems in PostgreSQL, to add a auto increment to a column, we first need to create a auto increment sequence and add it to the required column. I did like this. 1) Firstly you need to make sure there is a primary key for your table. Also keep the data type of the primary ...

Top 50 recent answers are included