Invalid byte sequence

From: Yambu <hyambu(at)gmail(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Invalid byte sequence
Date: 2021-07-01 07:29:58
Message-ID: CALhHtcC1zP2ADshm_Qo=RHHsTyqhR0jErAydPBZf2-ZbUrFLWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello

How do i get past the error below. I have created a foreign table which
points to a csv file and when i try to create another table it gives error
below

The csv file has funny characters, how do i bypass those characters.

create foreign table table1
(
id int,
name text
)
SERVER local_file
OPTIONS (filename '/outputfile.csv' ,
format 'csv',
header 'TRUE',
delimiter ';'
);

create table2 as select * from table1;

ERROR: invalid byte sequence for encoding "UTF8": 0x00
CONTEXT: COPY table1, line 377617

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2021-07-01 07:37:26 Re: Invalid byte sequence
Previous Message Laurenz Albe 2021-06-30 14:27:49 Re: Check if installed extension is in use