Re: Moving from MySQL to PGSQL....some questions (multilevel

From: Paulovič Michal <michal(at)paulovic(dot)sk>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Michael Chaney <mdchaney(at)michaelchaney(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Moving from MySQL to PGSQL....some questions (multilevel
Date: 2004-03-02 19:18:07
Message-ID: 4044DDEF.1050402@paulovic.sk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

how you solve the problem with multilevel autoicrement?

In MySQL you create table with col1, col2. Col 2 is AUTOICREMENT and you
have to create UNIQUE INDEX (Col1, Col2). If you insert to this table
for col1 volume 1, col2 automaticaly increase by one.

Example:
Insert into table values (1);
Insert into table values (1);
Insert into table values (2);
Insert into table values (1);
Insert into table values (2);

Result is:
1,1
1,2
2,1
1,3
2,2

How you convert this functionality from MySQL to PgSQL???

--------------------------------------
Bruce Momjian wrote:

>Michael Chaney wrote:
>
>
>>One other note, for those converting a database from MySQL to
>>PostgreSQL, I have a table creation conversion script here:
>>
>>http://www.michaelchaney.com/downloads/m2p.pl
>>
>>I know that two come with PostgreSQL in the contrib directory, but I
>>wrote this because those two didn't do what I needed. With this, you
>>should be able to take the MySQL table creation scripts (as created by
>>mysqldump --tab=x) and directly build the tables and load the data into
>>a PostgreSQL db with little effort.
>>
>>
>
>Please share what yours does that the /contrib doesn't, and ideally,
>send in a patch or let us add your version to /contrib.
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paulovič Michal 2004-03-02 19:45:27 Re: max table size
Previous Message Bruce Momjian 2004-03-02 18:57:40 Re: Moving from MySQL to PGSQL....some questions