Menu

#2 Why has PostgreSQL 'weak ALTER TABLE support'?

open-accepted
5
2004-02-06
2003-09-30
No

I might sound a bit stupid, but I read this phrase a
few times now, and I would love to know what exactly
makes it harder to do this on PostgreSQL compared to
e.g. MySQL.

Could you explain it to me? Or give some pointers to
documentation?

Thanks, and by the way: Great piece of software!
Karsten

Discussion

  • Richard Tango-Lowy

    • status: open --> pending-accepted
     
  • Richard Tango-Lowy

    Logged In: YES
    user_id=302293

    Never answered this. Sorry Karsten! MySQL and Oracle can
    rename columns, change field types, etc. Postgres' ALTER
    TABLE functionality is rather more limited.

    One day soon, I'll finish the code to use table replacement
    rather than ALTERing to upgrade the schema in a postgres DB.

    Rich

     
  • Karsten Dambekalns

    Logged In: YES
    user_id=105527

    No problem...
    I'd like to help with this, but I guess it should be done in
    ADODB itself rather than in axmls, no?

     
  • Karsten Dambekalns

    • status: pending-accepted --> open-accepted
     
  • Richard Tango-Lowy

    Logged In: YES
    user_id=302293

    I suggested such to John Lim at adodb. He said it would be
    non-trivial, but he knows it needs to be done.

     
  • Richard Tango-Lowy

    • assigned_to: nobody --> richtl
     
  • Richard Tango-Lowy

    Logged In: YES
    user_id=302293

    We can use the create-copy-drop method to change a table.
    The issue is whether or not sequences will get broken during
    the upgrade. I think there are some ways to work around this.

     
  • Karsten Dambekalns

    Logged In: YES
    user_id=105527

    Create-Copy-Drop sounds good, but we should probably try to
    check if we really need to do this. As far as I can see, on
    upgrading a table (on MySQL at least), the whole structure
    is 'touched'.
    This isn't a problem on MySQL, as it knows to do changes
    only when it's needed.
    If we create-copy-drop manually, and there is a lot of data
    in a table, this might be error-prone and take potentially a
    lot of time, so we should do it only if needed...
    Do you have any plans already on how to do all this? If (and
    if not as well), this should be taken to the mailing list :)

     

Log in to post a comment.