pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Changing the type of a column ?
3+ messages / 3 participants
[nested] [flat]

* Changing the type of a column ?
@ 2001-03-01 03:05  Bayet Richard <bayet@enseirb.fr>
  0 siblings, 1 reply; 3+ messages in thread

From: Bayet Richard @ 2001-03-01 03:05 UTC (permalink / raw)
  To: pgsql-admin

Is it possible to directly change the type of a column (eg: from int4 to
date) or does one have to first add a column of the desired type, copy
the first column's content, then drop this first column ?



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

* Re: Changing the type of a column ?
@ 2001-03-01 05:38  Grant <grant@conprojan.com.au>
  parent: Bayet Richard <bayet@enseirb.fr>
  0 siblings, 1 reply; 3+ messages in thread

From: Grant @ 2001-03-01 05:38 UTC (permalink / raw)
  To: pgsql-admin

> Is it possible to directly change the type of a column (eg: from int4 to
> date) or does one have to first add a column of the desired type, copy
> the first column's content, then drop this first column ?

No it's not possible. Your solution is correct.




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

* Re: Changing the type of a column ?
@ 2001-03-01 05:55  Richard Bayet <bayet@enseirb.fr>
  parent: Grant <grant@conprojan.com.au>
  0 siblings, 0 replies; 3+ messages in thread

From: Richard Bayet @ 2001-03-01 05:55 UTC (permalink / raw)
  To: pgsql-admin

Thanks, I finally found that ALTER TABLE didn't permit any kind of type
change...

Grant a écrit :

> > Is it possible to directly change the type of a column (eg: from int4 to
> > date) or does one have to first add a column of the desired type, copy
> > the first column's content, then drop this first column ?
>
> No it's not possible. Your solution is correct.




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


end of thread, other threads:[~2001-03-01 05:55 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-01 03:05 Changing the type of a column ? Bayet Richard <bayet@enseirb.fr>
2001-03-01 05:38 ` Grant <grant@conprojan.com.au>
2001-03-01 05:55   ` Richard Bayet <bayet@enseirb.fr>

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