From: Daniel CAUNE <d.caune@free.fr>
To: Kenneth Gonsalves <lawgon@thenilgiris.com>
To: pgsql-sql@postgresql.org
Subject: Re: migrating numeric to serial from MSSQL to postgres
Date: Sun, 15 Oct 2006 09:49:55 -0400
Message-ID: <000f01c6f060$cbd505e0$0b00a8c0@tedy> (raw)
In-Reply-To: <56210BFF-763D-4FC2-AA43-D514C19DB37F@thenilgiris.com>
> hi,
>
> am migrating a database from MSSQL to postgres. How would i migrate
> this:
>
> [Id] [numerc](18, 0) IDENTITY (1, 1)
>
You might want to create a sequence first, such as with more or less
options:
CREATE SEQUENCE my_sequence
INCREMENT BY 1
MINVALUE 1
NO MAXVALUE
START WITH 1
CACHE 1
NO CYCLE;
Then you should be able to migrate your code to something like:
Id INTEGER NOT NULL DEFAULT NEXTVAL(my_sequence')
--
Daniel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: d.caune@free.fr, lawgon@thenilgiris.com
Subject: Re: migrating numeric to serial from MSSQL to postgres
In-Reply-To: <000f01c6f060$cbd505e0$0b00a8c0@tedy>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox