Re: pg_get_triggerdef in pg_dump

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_get_triggerdef in pg_dump
Date: 2003-06-18 14:35:37
Message-ID: 20030618143537.GB2460@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 18, 2003 at 12:59:36PM +0200, Andreas Pflug wrote:

> What I need again and again, is changing the size of a column (rarely
> the type). For pgsql, I'd have to drop the column, and need to recreate
> all views. For MSSQL, it won't matter if the column is dropped/recreated
> or just resized, the view won't notice until it's used again.

If that's what you need you can always change the system catalogs
manually. For CHAR(n) and VARCHAR(n) you change pg_attribute.atttypmod
to (n+4). For NUMERIC(n,m) it's something like (n<<16) + m + 4 or maybe
(m<<16) + n + 4, don't remember right now.

Be sure to check that your data is in a safe place before you do this,
and double check before you commit the transaction if you do it
manually.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Porque Kim no hacia nada, pero, eso si,
con extraordinario exito" ("Kim", Kipling)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2003-06-18 14:42:04 Re: information Windows - PostgreSQL
Previous Message Bruce Momjian 2003-06-18 14:05:34 Re: O_DIRECT in freebsd