Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Unable to export Postgres database to another server (syntax error)

Mogzol's profile image Mogzol posted 3 months ago in General Permalink

I'm trying to export some tables to another Postgres server. When I used to use MySQL, I could do this by right clicking the desired table/database in the sidebar, choosing "Export Database as SQL", and choosing my target server as the output.

With two Postgres servers though, when I try to run the export, I get a syntax error:

ERROR:  syntax error at or near "USE"
LINE 1: USE "public"
        ^

Exporting to a SQL file first and then running that file in the new server works, but is less convenient, would be nice if this issue could be fixed.

1 attachment(s):
  • export-error
Mogzol's profile image Mogzol posted 2 months ago Permalink

Still getting this on the latest nightly (11.0.0.5995), any help would be greatly appreciated. My postgres version is 11 by the way, didn't mention that in my initial post.

ansgar's profile image ansgar posted 2 months ago Permalink

I suppose the CREATE statements generated in the exports are anyway incompatible to PG? But this particular USE ... is probably hardcoded, I should make that server specific, so PG gets a SET search_path TO ... instead.

Please login to leave a reply, or register at first.




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.