PostgreSQL: Bug reports and feature requests

rasmush's profile image rasmush posted 8 years ago in Feature discussion Permalink
First of all, thank you very much for a fantastic piece of software! I have used it for a while with MySQL, but have now been "forced" to work with PostgreSQL instead, and therefore I am trying to use HeidiSQL with PostgreSQL for the first time... Unfortunately, the transition wasn't as smooth as I hoped...
Here is a list of some of my initial findings:

1) Clicking the "Processes" tab under the "Host: domain.com" tab crashes the program.
2) After logging in and viewing tables, comments on tables and columns seem to disappear and be blank.
3) Foreign keys are not listed at all and cannot be set, even though the database supports them.
4) The "SERIAL" datatype doesn't work. I am aware that this is in fact simply a postgresql "shorthand" for "INTEGER connected to a sequence that auto-increments", but when loaded there is no indication if a column is a SERIAL (it simply says INTEGER) and there is no indication that it is auto-incrementing. Also, when editing the column (like adding a comment, results in an SQL error).
5) Related to 4: Sequences are not listed anywhere.

I'm using HeidiSQL 9.3.0.5009 and I'm connection to a PostgreSQL 8.4.18 server.
rasmush's profile image rasmush posted 8 years ago Permalink
An additional issue:

5) The ALTER TABLE code generated by HeidiSQL is not valid for PostgreSQL
An example is the code generated by HeidiSQL:
ALTER TABLE "downloadlog"
ALTER COLUMN  "downloadtime" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;


which according to the documentation should be:

ALTER TABLE "downloadlog"
ALTER COLUMN "downloadtime" TYPE TIMESTAMP,
ALTER COLUMN "downloadtime" SET NOT NULL,
ALTER COLUMN "downloadtime" SET DEFAULT CURRENT_TIMESTAMP;

ansgar's profile image ansgar posted 8 years ago Permalink
Yes, there are several PG things not yet working in Heidi, which is mostly due to my limited knowledge about PostgreSQL. Heidi was originally a MySQL only client, PG and MSSQL was introduced much later.

However, it's good to get some hints on how to fix internal queries for PG. I'll check the ALTER TABLE stuff you posted.
rasmush's profile image rasmush posted 8 years ago Permalink
The full documentation to the ALTER TABLE syntax for PG can be found here:
http://www.postgresql.org/docs/current/static/sql-altertable.html
rasmush's profile image rasmush posted 8 years ago Permalink
My experience with the inner-workings of PostgreSQL is also limited, but you can obtain a list of the current FOREIGN KEYs by a query like the following. May this is one of the pieces you need to implement it in HeidiSQL:
SELECT
conname,
pg_catalog.pg_get_constraintdef(r.oid, true) as condef
FROM
pg_catalog.pg_constraint r
WHERE
r.contype = 'f';


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