Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2011

    Unanswered: how to change column datatype

    Hi all,
    I have a table which is having 25 columns. I go to the properties of one column and try to change the data type from character varyfying to numeric but there is no option of numeric. How can i change its datatype from character to numeric?

    If there is another solution then please tell me in detail as i am new to postgresql.


  2. #2
    Join Date
    Oct 2011
    Hamburg, Germany
    you cant change the datatype if the table is not empty on this way.

    you need have to create new table a copy all data from old into new one.

  3. #3
    Join Date
    Aug 2011
    that is right,

    but here is what you can do

    a) add a new column say my_col as per your requirement
    b) place all new values in this col, using update
    c) delete the old column

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts