Question about serial vs. int datatypes
От
Lynna Landstreet
Тема
Question about serial vs. int datatypes
Дата
Msg-id
BB051AE1.107%lynna@gallery44.org
Список
Дерево обсуждения
Re: Question about serial vs. int datatypes Lynna Landstreet <lynna@gallery44.org>
Not sure if the lists are currently working - I just joined both this one and pgsql-novice, and posted a message to that one earlier in the day, but I haven't received either any replies or even my own message back, so I don't know if it's working. I know there was some kind of hardware failure with regard to the lists, but I don't know how severe. Anyway: I'm converting a FileMaker Pro database into PostgreSQL, and have a question (actually, tons of questions, but I'll stick to one for now). Each of the three major database files in FMP (equivalent to tables in PostgreSQL) has a number field as a primary key which is incremented serially as new records are added. Nice and simple, and the same thing a lot of PostgreSQL databases use. But... when converting an existing database that already has several hundred records in it, I can't make that field serial in PostgreSQL, can I? Because I don't want the existing records renumbered - that would break the links between the different tables. But if I make the id number just a smallint field, then I'm stuck incrementing it manually after the conversion. Is there any way around this? Any way to import the existing records with their id number intact, and then have it switch to serial after that for new records? Any advice would be appreciated... Lynna -- Resource Centre Database Coordinator Gallery 44 www.gallery44.org
В списке pgsql-general по дате отправления
От: Robert Treat
Дата: