Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

STL_REPLACEMENTS

Displays a log that records when invalid UTF-8 characters were replaced by the COPY command with the ACCEPTINVCHARS option. A log entry is added to STL_REPLACEMENTS for each of the first 100 rows on each node slice that required at least one replacement.

This table is visible to all users. Superusers can see all rows; regular users can see only their own data. For more information, see Visibility of Data in System Tables and Views.

Table Columns

Column Name Data Type Description
userid integer ID of the user who generated the entry.
query integer Query ID. The query column can be used to join other system tables and views.
slice integer Node slice number where the replacement occurred.
tbl integer Table ID.
starttime timestamp Start time in UTC for the COPY command.
session integer Session ID for the session performing the COPY command.
filename character(256) Complete path to the input file for the COPY command.
line_number bigint Line number in the input data file that contained an invalid UTF-8 character.
colname character(127) First field that contained an invalid UTF-8 character.
raw_line character(1024) Raw load data that contained an invalid UTF-8 character.

Sample Queries

The following example returns replacements for the most recent COPY operation.

Copy
select query, session, filename, line_number, colname from stl_replacements where query = pg_last_copy_id(); query | session | filename | line_number | colname ------+---------+-----------------------------------+-------------+-------- 96 | 6314 | s3://mybucket/allusers_pipe.txt | 251 | city 96 | 6314 | s3://mybucket/allusers_pipe.txt | 317 | city 96 | 6314 | s3://mybucket/allusers_pipe.txt | 569 | city 96 | 6314 | s3://mybucket/allusers_pipe.txt | 623 | city 96 | 6314 | s3://mybucket/allusers_pipe.txt | 694 | city ...