Menu

Adding column on cached table not working ?

Help
2015-07-07
2015-07-07
  • Mignane Diouf

    Mignane Diouf - 2015-07-07

    Hello everyone,

    For search optimization purposes, we are trying to add a column to duplicate the mail entry on upper case.

    Here is the request : alter table public.abonnement add column MAIL_RECHERCHE VARCHAR(255) generated always as (UPPER(MAIL));

    After request execution on sqltools, the column is added with correct values but after closing the database it's lost. When we open it againt, GONE : no new column.
    We have added a COMMIT after the request but the behaviour remains the same. Same with the SHUTDOWN. When re opening the database, the new column disappears.

    We have executed the same instruction on a MEMORY table and it works fine. As the initial table is CACHED type, we were wondering if our problem wasn't related to it. No hint supposing this analysis in the documentation.

    Any ideas ?

    Thanks in advance.

    Regards,

     
  • Fred Toussi

    Fred Toussi - 2015-07-07

    This works fine in the latest version. After adding the column, it's a good idea to perform a checkpoint. If the table is very large, you should perform SHUTDOWN COMPACT or SHUTDOWN SCRIPT to compact the database.

     

Log in to post a comment.