[PATCH] XLogReader v2

Поиск
Список
Период
Сортировка
От Andres Freund
Тема [PATCH] XLogReader v2
Дата
Msg-id 201207191229.03948.andres@2ndquadrant.com
обсуждение исходный текст
Ответы Re: [PATCH] XLogReader v2  (Satoshi Nagayasu <snaga@uptime.jp>)
Re: [PATCH] XLogReader v2  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hi,

Attached is v2 of the patch.

Changes are:
* more comments
* significantly cleaned/simpliefied coded
* crc validation
* addition of XLogReaderReadOne

Definitely needed are:
* better validation of records
* customizable error handling

The first is just work that needs to be done, nothing complicated. 
The second is a bit more complicated:
- We could have an bool had_error and a static char that contains the error 
message, the caller can handle that as wanted
- We could have a callback for error handling

I think I prefer the callback solution.


The second attached patch is a very, very preliminary xlog dumping utility 
which currently is more of a debugging facility (as evidenced by the fact that 
it needs and existing /tmp/xlog directory for writing out data) for the 
XLogReader. It reuses the builtin xlog dumping logic and thus has to link with 
backend code. I couldn't find a really sensible way to do this:

xlogdump: $(OBJS) $(shell find ../../backend ../../timezone -name 
objfiles.txt|xargs cat|tr -s " " "\012"|grep -v /main.o|sed 's/^/..\/..\/..       $(CC) $(CFLAGS) $^ $(LDFLAGS)
$(LDFLAGS_EX)$(LIBS) -o $@$(X)
 

Perhaps somebody has a better idea? I think having an xlogdump utility in 
core/contrib would be a good idea now that it can be done without a huge 
amount of code duplication. I plan to check Satoshi-san's version of xlogdump 
whether I can crib some of the commandline interface and some code from there.

Greetings,

Andres

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services

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

Предыдущее
От: Kohei KaiGai
Дата:
Сообщение: Re: pgsql_fdw in contrib
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [PERFORM] DELETE vs TRUNCATE explanation