DEV Community

Fazlı Akça
Fazlı Akça

Posted on • Updated on

PostgreSQL Create Table With Dynamic Table Name

DO
$$
BEGIN
    EXECUTE 'create table zz_find_entity'  ||  TO_CHAR(CURRENT_TIMESTAMP,'YYYYMMDD_HH24MISS') || ' AS  select * from find_entity';
END
$$;

Enter fullscreen mode Exit fullscreen mode

Top comments (0)