Migration of records to the table with different column names I have two databases, and I need to move data from one to another. The catch is they have a table with different set of columns. Here is how I need to rename columns in migration:

NULL -&gt; ID (should be generated as I add records normally)
NULL -&gt; category_id (should be fixed, e.g. 3)
date_art -&gt; created_at
title_art -&gt; title
short_art -&gt; promo
full_art -&gt; content


Is it possible to accomplish by a single query?
The SQL would be like:

insert into tab1 (category_id, created_at, title, promo, content)
as
select 3, date_art, title_art, short_art, full_art
from   tab2


The ID column will get it's value during the insert.