Re: Altering a CHAR(4) column CHAR(5) changing

Поиск
Список
Период
Сортировка
От Denis Gasparin
Тема Re: Altering a CHAR(4) column CHAR(5) changing
Дата
Msg-id 1017216666.2115.3.camel@edspctec12
обсуждение исходный текст
Ответ на Re: Altering a CHAR(4) column CHAR(5) changing pg_attribute  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I have done my tests too and it worked... I think this is a thing to put
in the FAQ or in some other place... This will help all persons who have
to convert "textual" types between them without dropping and recreating
tables, indexes, etc...

Thank you for your help...

--
Doct. Eng. Denis Gasparin: denis@edistar.com
---------------------------
Programmer & System Administrator - Edistar srl


Il mar, 2002-03-26 alle 18:29, Tom Lane ha scritto:
> Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> > If you were using varchar, this would be fine. With char, you have
> > issues with the padding spaces if you ever convert them to text
> > (for example using lower or upper).
>
> But you could do
>     update foo set mycol = mycol || '';
> after tweaking the atttypmod as Stephan illustrates.  That should force
> all the values to the correct length.  (The dummy concatenation is just
> to prevent the system from optimizing away the length coercion step.)
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)



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

Предыдущее
От: Rnd@gatewaynet.com
Дата:
Сообщение: Re: C Function with Arrays Question
Следующее
От: Dominique ROUSSEAU
Дата:
Сообщение: Re: INSERTs slow