Skip to content

postgres_fdw при операциях UPDATE или DELETE -- использует ctid (а про tableoid забыли) #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
antonov-impulsm opened this issue Nov 21, 2016 · 0 comments

Comments

@antonov-impulsm
Copy link

добрый день!

подробности можно почитать тут -- http://www.sql.ru/forum/1237974/bag-update-fdw

ну или вкрадце напишу что postgres_fdw -- при конструировании REMOTE-запроса --

функция deparseUpdateSql ( https://github.com/postgrespro/postgrespro/blob/PGPRO9_5/contrib/postgres_fdw/deparse.c#L943 )

подставляет только одно условие: appendStringInfoString(buf, " WHERE ctid = $1");

а нужно appendStringInfoString(buf, " WHERE ctid = $1 and tableoid = $2"); (другие части кода, поменять разумеется нужно тоже)

заранее спасибо!

напомню что ctid сам по себе не является уникальным для указания на запись в таблице (с учётом иерархии наследования). ctid and tableoid -- уже ближе к званию на уникальность :-)

glukhovn pushed a commit that referenced this issue May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant