Re: alter column to varchar without view drop/re-creation - Mailing list pgsql-general

From Emi Lu
Subject Re: alter column to varchar without view drop/re-creation
Date
Msg-id 5400CFD4.9050502@encs.concordia.ca
Whole thread Raw
In response to alter column to varchar without view drop/re-creation  (Emi Lu <emilu@encs.concordia.ca>)
Responses Re: alter column to varchar without view drop/re-creation  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
<meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">





      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      Hello list,

      May I know is there a way to "alter column type to varchar"
      (previous is varchar(***)) without view drop/re-creation?

      Basically, looking for a way to change column without have to
      drop/re-create dependent views.

      varchar(***) to varchar and no date/numeric changes.


    I saw docs mention about: update pg_attribute. May I know:

    . will dependent views updated automatically or there might be
    potential problems?
    . If it's fine, will the following SQL enough to change column from
    varchar(***) to varchar?

      update pg_attribute set atttypmod =-1
      where  attrelid = 'oid' ;

    Thanks a lot!


      ---
      PostgreSQL 8.3.18 on x86_64

pgsql-general by date:

Previous
From: Emi Lu
Date:
Subject: alter column to varchar without view drop/re-creation
Next
From: Adrian Klaver
Date:
Subject: Re: alter column to varchar without view drop/re-creation