Home > database >  About greenplum log use the external table embedded database query code error problem
About greenplum log use the external table embedded database query code error problem

Time:02-19

Select * from gp_toolkit. Gp_log_system

(Err) ERROR: invalid byte sequence for encoding UTF8 ": 0 x22 xe5 0 0 x2c
CONTEXT: the External table __gp_log_master_ext, line 238997 of the file the execute: cat $GP_SEG_DATADIR pg_log/*. CSV

At present I have set the postgresql. Conf configuration file some of the configuration is as follows:

Client_encoding='utf8'

Default_text_search_config='pg_catalog. Simple'

Linux system language environment is en_US utf8

The overall database language is as follows:



Now there are two problems:
1. After the above Settings, delete all gp_log log again after restarting physical server performs the select * from gp_toolkit. Gp_log_system can succeed, after a few months later, the server restart again after this error again,

2. When is not an error, because of the very large amount of log, the query efficiency is very low, a query may need more than ten hours, pay the query SQL

 
SELECT * FROM
Gp_toolkit. Gp_log_system
WHERE
To_char (logtime, 'yyyy - mm - dd HH24: MI: SS') & gt;=(to_char (now (), '- dd yyyy - mm) | |' 14:00:00 ')
AND
To_char (logtime, 'yyyy - mm - dd HH24: MI: SS') & lt; (=to_char (now) + INTERVAL '14 hour', '- dd yyyy - mm HH24: MI: SS'
)
The ORDER BY logtime DESC
LIMIT of 100


For help

CodePudding user response:

There are a great god?
  • Related