Re: fetch_search_path() and elog.c

Поиск
Список
Период
Сортировка
От Ferruccio Zamuner
Тема Re: fetch_search_path() and elog.c
Дата
Msg-id 42D29CC2.90201@diff.org
обсуждение исходный текст
Ответ на Re: fetch_search_path() and elog.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: fetch_search_path() and elog.c  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
Tom Lane wrote:

>Ferruccio Zamuner <nonsolosoft@diff.org> writes:
>  
>
>>I need to have in the log_line_prefix the search_path where the query 
>>has run.
>>So last week I've started to read elog.c and I was thinking about a 
>>small patch there using a new "%S" option.
>>    
>>
>
>There's no chance of that code working when not inside a transaction;
>which means that in most of the scenarios where you really want a log
>entry to be made, it will fail.
>
>            regards, tom lane
>  
>
Now I've found a simpler solution:

case 'S':                   /* estrae il search_path */             if (namespace_search_path != NULL)
appendStringInfo(buf,"%s ", namespace_search_path);             break;
 

It seems to work.

But I would like to understand why previous code was wrong.


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Checkpoint cost, looks like it is WAL/CRC
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Hide source code