pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Treat <rtreat@webmd.net>
To: Huub <v.niekerk@freeler.nl>
Cc: pgsql-sql@postgresql.org
Subject: Re: changing numeric into int
Date: 08 Nov 2002 14:12:57 -0500
Message-ID: <1036782777.12692.12.camel@camel> (raw)
In-Reply-To: <aqfpql$gr$1@news.hub.org>
References: <aqfpql$gr$1@news.hub.org>

There is no way to do this short of maybe hacking at the system tables,
and even then thats likely to cause problems. If you cant recreate the
table, your best bet is to create two new columns and copy the data in,
delete the data from the old columns, rename the columns accordingly,
and perhaps add a rule to always set the old columns to NULL.

Robert Treat

On Fri, 2002-11-08 at 02:41, Huub wrote:
> Hi,
> 
> I want to change 2 columns in the same table from numeric into int. Can 
> I do this without deleting the old table and creating a new one? Data 
> stays the same..
> 
> Thanks
> 
> Huub
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html





view thread (2+ messages)

Message-ID: <1036782777.12692.12.camel@camel>
Permalink:  ../1036782777.12692.12.camel@camel/
Also on:    postgresql.org/message-id/1036782777.12692.12.camel@camel

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rtreat@webmd.net, v.niekerk@freeler.nl
  Subject: Re: changing numeric into int
  In-Reply-To: <1036782777.12692.12.camel@camel>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox