I am migrating a huge chunk of PostgreSQL script to work in Snowflake. The problem that stopped me is on conflict
syntax and specifically when you use on conflict do nothing
.
insert into table1
select
user_id
, something_else
from table2
on conflict do nothing;
Some propose the "equivalent" of on conflict
from Postgres is using merge into
, some are not happy about it. However when you use merge into
you have to specify an on <CONDITION>
clause, e.g. merge into t1 using t2 on t1.id = t2.id ...
.
But in case of on conflict do nothing
what should be the alternative?
When using merge into
is there a less verbose syntax than specifying every column in these cases? (Imagine you have 15 columns and you have to write every one of them).