Re: PostgreSQL logical decoder output plugin - unchanged toast data

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: PostgreSQL logical decoder output plugin - unchanged toast data
Дата
Msg-id 20180904164240.mehuqs6ghkapqgw5@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: PostgreSQL logical decoder output plugin - unchanged toast data  (Georgy Buranov <gburanov@gmail.com>)
Список pgsql-hackers
Hi,

On 2018-09-04 11:45:10 +0200, Georgy Buranov wrote:
> Hi Andres. Thank you very much for your help.
> 
> I tried the following solution and I have some problems.
> 
> * I have 9.6 postgres and I do not have separate field for rd_pkindex
> * All I have is rd_replidindex field. Usually (when REPLICA IDENTITY
> is NOT FULL), it still contains the primary key
> * But in the case of REPLICA IDENTITY FULL - rd_replidindex is NULL
> and rd_pkindex does not exist
> 
> So, is there a way to get the primary key on 9.6 postgres?

You have to to query the syscache yourself, in that case.  I know
nothing about what you're doing in your output plugin.  In the ones I
wrote there's a side-cache for per-relation output plugin specific data,
do you have something like that?  You can probably just crib the code
for the lookup from dblink.c:get_pkey_attnames().  If you have a cache,
itmight be worth caching the results.

Greetings,

Andres Freund


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

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: Bug fix for glibc broke freebsd build in REL_11_STABLE
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: pointless check in RelationBuildPartitionDesc