Re: Converting char to varchar automatically

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, hari(dot)fuchs(at)gmail(dot)com, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Converting char to varchar automatically
Date: 2014-10-06 23:20:31
Message-ID: 27509.1412637631@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Melvin Davidson <melvin6925(at)gmail(dot)com> writes:
> Also, don't forget to test for relkind = 'r'. My bad from before.

In principle you need to ignore attisdropped columns as well.

Thinking about Jim's point about speed: it'd be wise to collapse any
updates for multiple columns in the same table into one ALTER command,
so that you only rewrite the table once, not once per column.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Mickelson 2014-10-07 06:29:48 Re: Really strange foreign key constraint problem blocking delete
Previous Message Tom Lane 2014-10-06 23:16:56 Re: Converting char to varchar automatically