Re: best practice transitioning from one datatype to another

Поиск
Список
Период
Сортировка
От Andreas Wenk
Тема Re: best practice transitioning from one datatype to another
Дата
Msg-id 4A5EE8F0.7070404@netzmeister-st-pauli.de
обсуждение исходный текст
Ответ на Re: best practice transitioning from one datatype to another  (Arndt Lehmann <arndt.lehmann@gmail.com>)
Список pgsql-general
Arndt Lehmann schrieb:
> On Jul 16, 8:05 am, t...@sss.pgh.pa.us (Tom Lane) wrote:
>> CG <cgg...@yahoo.com> writes:
>>> While transitioning from 8.1 to 8.4, I need to transition to the internal UUID type in place of the
contrib/uniqueidentifiermodule. I've built the database around uniqueidentifier, so nearly every table has one column
ofthat data type. It's going to be tedious to 
>>> ALTER TABLE foo ALTER COLUMN bar SET DATA TYPE uuid;
>>> ...repeat 600 times...
>>> I'll also have to drop and reload the views and the rules on tables. It'll be tedious even if the tables have no
datain them. 
>>> Can anyone recommend a better/faster way to make the transition?
>> Couldn't you rename the type to uuid in the 8.1 database before you
>> dump?
>>
>>                         regards, tom lane
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-gene...@postgresql.org)
>> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general
>
> Just an idea - don't know if it works, first try on a test server:
> 1. Dump the complete database into text format (pg_dump --format=t)
> 2. Do a search and replace from "uniqueidentifier" to "uuid"
> 3. Reimport
>
> Best Regards,
>   Arndt Lehmann
>
uh - --format=t means tar format. --format=p means plain text ...

Or am I missing something?

$pg_dump --help
Usage:
   pg_dump [OPTION]... [DBNAME]

General options:
...
   -F, --format=c|t|p       output file format (custom, tar, plain text)
...

Cheers

Andy

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

Предыдущее
От: Andreas Wenk
Дата:
Сообщение: Re: psql \du
Следующее
От: Marek Lewczuk
Дата:
Сообщение: Getting list of tables used within a query