AW: Get the name of the target Relation from Query struct? SOLVED!

Поиск
Список
Период
Сортировка
От Ernst-Georg Schmid
Тема AW: Get the name of the target Relation from Query struct? SOLVED!
Дата
Msg-id 9a79484538f64bb0be94beaa327c94bb@BYEX19.de.bayer.cnb
обсуждение исходный текст
Ответы Re: Get the name of the target Relation from Query struct? SOLVED!  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Список pgsql-hackers
Hello David,

actually Query->resultRelation is one based and Query->rtable is zero based.

So the correct call to list_nth is: list_nth(Query->rtable, Query->resultRelation - 1)

The comment "rtable index of target relation for INSERT/UPDATE/DELETE/MERGE; 0 for SELECT" on resultRelation in
parsenodes.h,Line 120 is misleading. It is _not_ a direct index into rtable, you have to subtract 1 first!
 

And now it works...checked against 9.6.8 and 10.3.

Best regards,

Ernst-Georg


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

Предыдущее
От: Suhal Vemu
Дата:
Сообщение: ERROR: invalid memory alloc request size 1073741824
Следующее
От: John Naylor
Дата:
Сообщение: Re: WIP: a way forward on bootstrap data