New answers tagged

1

It's hard to predict the size of the dump file. large fields will be compressed using LZ77 so the result could be larger than the table files. integers expressed in ASCII are larger than they are on disk. Dumps don't have slack space, or indices, so the result could be smaller that file sizes of the database. If you compress the dump it could compress by 90%...


1

This can be solved with the help of the FIRST_VALUE analytical function: UPDATE things AS tgt SET duplicate_of = src.first_id FROM ( SELECT id , title , author , FIRST_VALUE(id) OVER (PARTITION BY title, author ORDER BY id ASC) as first_id FROM things ) AS src WHERE tgt.id = src.id AND tgt.id <> src.first_id ;...


Top 50 recent answers are included