Pq: command is too large

HI. ALL

create table SEQ_TEST2 as select * from reservation_pg;
pq: command is too large: 354891199 bytes (max: 67108864)

reservation_pg table size 1G

please guide me.

thanks

Hi @jubong,

Welcome to the Cockroach Forum!

To better assist you, would you be able to tell me what version of CockroachDB you are using?
In version 19.2.0, there were significant improvements for CREATE TABLE AS.

Regards,
Florence

Hi @jubong,

If you are not able to upgrade to 19.2+, a workaround would be to EXPORT table reservation_pg and then IMPORT it into table SEQ_TEST2.

Also for reference, this is the original GitHub issue and this was the fix.

Regards,
Florence

thank you. i will try export/import data

Please let us know if the export/import worked for you.

My version is

select * from version();
version
±----------------------------------------------------------------------------------------+
CockroachDB CCL v19.1.4 (x86_64-unknown-linux-gnu, built 2019/08/06 15:34:13, go1.11.6)
(1 row)