pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
changing numeric into int
2+ messages / 2 participants
[nested] [flat]

* changing numeric into int
@ 2002-11-08 07:41 Huub <v.niekerk@freeler.nl>
  2002-11-08 19:12 ` Re: changing numeric into int Robert Treat <rtreat@webmd.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Huub @ 2002-11-08 07:41 UTC (permalink / raw)
  To: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: changing numeric into int
  2002-11-08 07:41 changing numeric into int Huub <v.niekerk@freeler.nl>
@ 2002-11-08 19:12 ` Robert Treat <rtreat@webmd.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Treat @ 2002-11-08 19:12 UTC (permalink / raw)
  To: Huub <v.niekerk@freeler.nl>; +Cc: pgsql-sql

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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-11-08 19:12 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-11-08 07:41 changing numeric into int Huub <v.niekerk@freeler.nl>
2002-11-08 19:12 ` Robert Treat <rtreat@webmd.net>

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