Re: Help with slow table update

Поиск
Список
Период
Сортировка
От Pawel Veselov
Тема Re: Help with slow table update
Дата
Msg-id CAMnJ+BdPtxBP9ChgvU+GSV0EV-zAMEQhjO3k3kr8YFWi5Cdsqg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Help with slow table update  (Igor Neyman <ineyman@perceptron.com>)
Список pgsql-general

[skipped]

 

This is where using sets becomes really tedious, as Postgres severely lacks an upsert-like statement.

I don't think there are joins allowed in UPDATE statement, so I will need to use WITH query, right?

Also, I'm not sure how LEFT JOIN will help me isolate and insert "missed" entries...

 

[skipped]

 

Yes, you can do UPDATE with joins (http://www.postgresql.org/docs/9.4/static/sql-update.html) like this:

 

UPDATE table1 A SET col1 = B.col2

  FROM table2 B

  WHERE A.col3 = B.col4;



I meant using JOIN operator in the update. But it's still possible, though through WITH query.

В списке pgsql-general по дате отправления:

Предыдущее
От: Andreas Joseph Krogh
Дата:
Сообщение: Re: How to keep pg_largeobject from growing endlessly
Следующее
От: Filip Lyncker
Дата:
Сообщение: Best way to migrate a 200 GB database from PG 2.7 to 3.6