Search Postgresql Archives

Setting a serial column with serial object that has a name that is built dynamically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How do I set a serial column with the next value when the serial object has a name that is built dynamically?

EXECUTE 'CREATE SEQUENCE '|| t_name || 'id_seq' || ' OWNED BY '|| t_name || '_cdc'||'.table_id'; 
           
    EXECUTE 'ALTER TABLE ' || quote_ident(t_name || '_cdc') || ' ALTER COLUMN table_id SET DEFAULT nextval(''tab_id_seq'');';

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux