change data type int4 to serial

Поиск
Список
Период
Сортировка
От Seb
Тема change data type int4 to serial
Дата
Msg-id 87zm77ctqx.fsf@patagonia.sebmags.homelinux.org
обсуждение исходный текст
Ответы Re: change data type int4 to serial  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
Hi,

I am experimenting a migration of an M$ Access database to postgresql in a
Debian GNU/Linux system.  Based on some reading, I've approached it as
follows:

1. Using mdbtools, export the tables from Access to *.csv files,
   sanitizing file names and column names.

2. Using unixodbc and GNU R's package RODBC, import the tables to an empty
   database in postgresql; i.e. create a database in postgresql, read the
   tables into R for cleaning up mbdbtools' job and let RODBC import the
   tables into postgresql, specifying the data type for
   date/time/timestamp columns.

Checking the results in pgadmin, this proceeded fine, but now that I want
to specify the primary and foreign keys in the tables, I see that the
columns needed for this were imported as int4 data type.  I would like
these to be automatically sequenced, so need them to be 'serial'.  Going
into "properties" for these columns in pgadmin, the 'serial' option is not
available in the "data type" pull-down menu.  Is this not possible?  Can
the 'serial' data type be specified during import.  Thanks in advance.


Cheers,

--
Seb

В списке pgsql-general по дате отправления:

Предыдущее
От: "hubert depesz lubaczewski"
Дата:
Сообщение: Re: Odd behaviour of timestamptz
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Odd behaviour of timestamptz