Closed bala-cg closed 3 years ago
@bala-cg The page number is missing for this issue.
Is the problem that \df+ gp_read_error_log
doesn't describe the function accurately (by making it sound as though it only works with external tables)?
Right, that's what I felt, when i first say the function description to see what input parameters it take.
Page No :
Issue: Function parameter misleading.
Statement: • Use the SEGMENT REJECT LIMIT clause of the COPY statement to set a limit for the number or percentage of rows that can have errors before the COPY FROM command is aborted. The reject limit is per segment; when any one segment exceeds the limit, the command is aborted and no rows are added. Use the LOG ERRORS clause to save error rows. If a row has errors in the formatting— for example missing or extra values, or incorrect data types—Greenplum Database stores the error information and row internally. Use the gp_read_error_log() built-in SQL function to access this stored information.
gpadmin=# \df+ gp_read_error_log List of functions Schema | Name | Result data type | Argument data types | Type | Data access | Execute on | Security | Volatility | Owner | Language | Source code | Description
------------+-------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------+--------+-------------+--------------+----------+------------+---------+----------+-------------------+---------------------------------------------------
pg_catalog | gp_read_error_log | SETOF record | exttable text, OUT cmdtime timestamp with time zone, OUT relname text, OUT filename text, OUT linenum integer, OUT bytenum integer, OUT errmsg t ext, OUT rawdata text, OUT rawbytes bytea | normal | no sql | all segments | invoker | volatile | gpadmin | internal | gp_read_error_log | read the error log for the specified external tabl e (1 row)
gpadmin=# gpadmin=# gpadmin=# gpadmin=# \d+ public.tab1 Table "public.tab1" Column | Type | Modifiers | Storage | Stats target | Description --------+---------+-----------+---------+--------------+------------- col1 | integer | | plain | | Distributed by: (col1)
gpadmin=#
gpadmin=# COPY public.tab1 FROM '/home/gpadmin/datafils/data.txt' LOG ERRORS SEGMENT REJECT LIMIT 2; NOTICE: found 1 data formatting errors (1 or more input rows), rejected related input data COPY 4 gpadmin=# select gp_read_error_log('public.tab1'); gp_read_error_log
("2021-05-18 15:22:55.239664+00",tab1,,5,,"invalid input syntax for integer: """", column col1","",)
(1 row)
gpadmin=# gpadmin=#