|
Re: MySQL comparable syntax for PostgreSQL: msg#00207db.postgresql.novice
On Mon, Feb 17, 2003 at 14:47:01 +0000, Ben Clewett <B.Clewett@xxxxxxxxxxxxxxxxx> wrote: > > An UNSIGNED number. Is this 'field INTEGER CHECK (field >= 0)', or is > there a direct UNSIGNED reference I have missed? There is no unsigned type. You can use a check constraint to enforce this. > The AUTO_INREMENT extension to a Primary Key, as used in MuSQL. What is > the official method for auto-incrementing fields? I have found the > 'DEFAULT NEXTVAL('...'), but I am not sure whether/how/if this can be > used to auto-increment a primary field? Yes, you want to use sequences as they are a lightweight way to generate unique keys. The Serial types provide a simple way to do this. They create a sequence, set the default to use nextval and add a not null constraint. They don't create a unique index, but a primary key constraint will do that. ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: How to remove old pg RPMs?: 00207, Josh Trutwin |
|---|---|
| Next by Date: | Dynamic IP - pg_hba: 00207, Dirk Hamstra |
| Previous by Thread: | MySQL comparable syntax for PostgreSQLi: 00207, Ben Clewett |
| Next by Thread: | Re: MySQL comparable syntax for PostgreSQL: 00207, Andrew McMillan |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |