On 2020-08-04 19:36, Konstantin Knizhnik wrote:
Yes, generated columns are also using implicitly generated sequences. So them areĀ very similar with SERIAL/BIGSERIAL columns. This actually make we wonder why we can not handle them in the same way in CREATE TABLE LIKE.
The current specification of serial is a parse-time expansion of integer column, sequence, and column default. The behavior of column defaults in CREATE TABLE LIKE does not currently include rewriting the default expression or creating additional schema objects. If you want to introduce these concepts, it should be done in a general way, not just hard-coded for a particular case.
-- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services