Persistent "FLUSH PRIVILEGES" error in PostgreSQL session after reinstalling HeidiSQL

Cotar's profile image Cotar posted 4 weeks ago in General Permalink

Title: Persistent "FLUSH PRIVILEGES" error in PostgreSQL session after reinstalling HeidiSQL

Message:

Hello,

I'm experiencing a persistent issue when connecting to a PostgreSQL session in HeidiSQL. Every time I open the session, the following command is automatically executed:

SHOW ALL; FLUSH PRIVILEGES;

This results in the error:

ERROR: syntax error at or near "FLUSH" LINE 1: FLUSH PRIVILEGES ^

As you know, FLUSH PRIVILEGES is a MySQL-specific command and not valid in PostgreSQL.

I’ve already tried the following steps:

Uninstalled HeidiSQL completely

Deleted configuration files from %APPDATA%\HeidiSQL

Removed leftover folders from Program Files

Rebooted the system

Reinstalled HeidiSQL from scratch

Deleted old sessions and created a new PostgreSQL session with no startup script

Despite all this, the FLUSH PRIVILEGES command keeps appearing automatically when I connect to PostgreSQL. I’ve confirmed that no script file is selected in the “Startup script” field under the Advanced tab.

Is there any hidden configuration or default behavior that could be causing this? How can I prevent HeidiSQL from injecting this invalid command into PostgreSQL sessions?

Thanks in advance for your help!

ansgar's profile image ansgar posted 4 weeks ago Permalink

So you are 100% sure the HeidiSQL session has no startup script on the "Advanced" tab?

That SHOW ALL is normal - HeidiSQL retrieves session variables through that query.

But the FLUSH PRIVILEGES is only fired when you open the user manager - which can only be done by the user through mouse or keyboard strokes, not automatically.

Does the PostgreSQL server maybe have a wrong configuration (like the "init_connect" variable on MySQL)?

Cotar's profile image Cotar posted 4 weeks ago Permalink

Hello, I'm experiencing two issues related to my development environment, as shown in the attached screenshots:

  • Runtime error in Dev-C++ The first image shows a runtime error message: “This application has requested the Runtime to terminate it in an unusual way.” This occurs when I run the project in Dev-C++, and may be related to a misconfiguration or environment issue.
  • PostgreSQL session in HeidiSQL The second image shows my PostgreSQL session setup in HeidiSQL. I successfully created the database named bancodedados and the user usuario with the password senha using manual SQL commands. However, neither the database nor the user appear in the HeidiSQL interface, even though the creation was successful. I’d like to know if there’s a limitation in HeidiSQL’s PostgreSQL support, or if there’s an additional configuration required to make these objects visible. Thank you in advance for your help!
2 attachment(s):
  • telainicialdoheidisql
  • adicionandousuarionoicone
ansgar's profile image ansgar posted 4 weeks ago Permalink

In a PG session in HeidiSQL, you enter the wanted database in the "Database" field of the session manager to see it:

grafik.png

The "Advanced" tab shows you if you have a "Startup script" defined - please check that.

Please also check if you have a keyboard shortcut for Tools > Flush > Privileges set:

grafik.png

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