Help in Parsing PG log usings CSV format

Поиск
Список
Период
Сортировка
От Arvind Singh
Тема Help in Parsing PG log usings CSV format
Дата
Msg-id BLU164-W207CCEC30BE1593142EBD1CA410@phx.gbl
обсуждение исходный текст
Ответы Re: Help in Parsing PG log usings CSV format  (Martin Gregorie <martin@gregorie.org>)
Re: Help in Parsing PG log usings CSV format  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Список pgsql-general
Help needed in parsing PostgreSQL CSV Log
Hello friends,
I am working an a section of application which needs to Parse CSV Logs generated by PostgreSql server.
- The Logs are stored C:\Program Files\PostgreSQL\9.0\data\pg_log
- The Server version in 9.0.4
- The application is developed in C Sharp
    * The basic utility after Parse the Log is to show contents in a DataGridView.
    * There are other filter options like to view log contents for a particular range of Time for a Day.
 
**However the main problem that is, the Log format is not readable**
 
 
A Sample Log data line
> 2012-03-21 11:59:20.640 IST,"postgres","stock_apals",3276,"localhost:1639",4f697540.ccc,10,"idle",2012-03-21 11:59:20 IST,2/163,0,LOG,00000,"statement: SELECT version()",,,,,,,,"exec_simple_query, .\src\backend\tcop\postgres.c:900",""
 
As you can see the columns in the Log are comma separated , But however individual values  are not Quote Enclosed.
 
For instance the 1st,4rth,6th .. columns
 
**Is there a setting in PostgreSQL configuration to place quotes around all columns in a Logfili
 
 
I just want to update the columns so that all are within Quotes
 
what happens wrong is when it reaches the column where sql statement is place. it also has commas set for table columns. The log line is a mix bunch of quote-enclosed and non-quote-enclosed column. is there is a configuration or utility to convert the non-quoted column to quoted column
 
PS : the copy utility or any other utility cannot be used , as we have to parse the log within a C Sharp application

Thanks for any advice and help

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

Предыдущее
От: Alexander Reichstadt
Дата:
Сообщение: Re: Cannot store special chars using c lib
Следующее
От: Heiko Wundram
Дата:
Сообщение: Very high memory usage on restoring dump (with plain pqsl) on pg 9.1.2