Re: MySQl and PostgreSQL
| From: | Chris | Date: | Wed, 01 Nov 2000 21:41:44 +0000 |
| Subject: | Re: MySQl and PostgreSQL | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-4105@lists.php.net to get a copy of this message | ||
Postgresql doesn't have an autoincrement field as such, it uses a "serial" type instead.
http://www.postgresql.org/users-lounge/docs/7.0/postgres/datatype.htm
From this page : "The serial type is a special-case type constructed by Postgres from other existing components. It is typically used to create unique identifiers for table entries."
You can use it the same as auto_increment in mysql, except that you have to tell it to use the next value (use the syntax nextval('fieldname').).
Hope that helps.
Is it ok to do the following in any of the databases Systems mentioned in the Subject: create table docs ( id integer unsigned not null autoincrement primary key, ........... ) I mean, is ok the way I created the primary key, because when I try to do that I get an error... Thanks a lot, Nicolas------------------------ Chris Smith http://www.squiz.net