Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unrecognized configuration parameter "default table access method" google cloud

I try to import some files to a PostgreSQL database but I get this error:

Falha Importar: 
SET 
SET 
SET 
SET 
SET 
set_config ------------ 
(1 row) 
SET 
SET 
SET 
SET 
SET 
Import error: exit status 3 ERROR: unrecognized configuration parameter "default_table_access_method"
like image 771
Mauricio Crispim Avatar asked Mar 03 '20 19:03

Mauricio Crispim


2 Answers

You are importing a PostgreSQL v12 pg_dump into something that is obviously based on an earlier version of PostgreSQL.

This error is harmless (the parameter default_table_access_method was introduced in v12), but you may have more interesting problems with other new v12 features. If the rest of the import works without error, you are probably fine, but keep in mind that downgrading PostgreSQL is not supported.

You would be best off using the same version throughout. If you cannot have that locally because the hosted database is a closed source fork, that is a good point against using it.

like image 132
Laurenz Albe Avatar answered Oct 16 '22 12:10

Laurenz Albe


Here is my workaround:

  1. Dump using pdAdmin, set as SQL, Plain, and "Only schema", and save to a local folder.
  2. Edit the SQL file, (text format)
  3. comment out "-- error from V 12 : SET default_table_access_method = heap;"
  4. run the SQL scripts file using pgAdmin or other tools.
  5. Dump the source database again, with "Only Data", "backup" options
  6. Restore the data-only dump file.

It works for me.

like image 21
vfyang Avatar answered Oct 16 '22 12:10

vfyang