The postgresql table column has no comments

[expired user #10437]'s profile image [expired user #10437] posted 7 years ago in Installation Permalink

i create table with comment,but i can't see comment in heidisql

Revision 9.4.0.5146

fleduc's profile image fleduc posted 7 years ago Permalink

Yes, I have the same problem on rev 9.4.0.5173(64bit). When you look in Create code tab I see:

... COMMENT ON COLUMN "res_country_state"."code" IS E''; ...

In this example, [E''] is supposed to be ['State Code']

If I open this table with pgAdminIII, I can see the comment

Thanks

mavar's profile image mavar posted 5 years ago Permalink

The problem unfortunately persist in rev 10.2.0.5678 also. Do you plan to fix it? Thanks for your job

ansgar's profile image ansgar posted 5 years ago Permalink

This is issue #62. I am going to check the cause of it.

ansgar's profile image ansgar posted 5 years ago Permalink

I just refactored the string escaping logic for Postgres mode, so this should be fixed.

Instead, HeidiSQL now escapes less than before, as follows:

  • ' => ''
  • for LIKE strings:
    • % => \%
    • _ => \_

For these 2 backslash usages, PostgreSQL does not seem to require that E prefix.

See it in action here:

Description

And please shout if the above logic is wrong for some reason.

mavar's profile image mavar posted 5 years ago Permalink

Thank you very much for so fast reaction. Now the result looks much better. But some comments are still invisible. The problem can be connected with datatype timestamp. All comments on these lines (timestamp datatype) are still invisible. I tested this theory in this example:

Description

Result:

Description

ansgar's profile image ansgar posted 5 years ago Permalink

Could it be that TIMESTAMP data type was silently converted by the server to "TIMESTAMP WITHOUT TIMEZONE"? At least this was the case for me here. In that case I have to add such data types with spaces in their names.

ansgar's profile image ansgar posted 5 years ago Permalink

See the documentation for date/time types: https://www.postgresql.org/docs/current/datatype-datetime.html

mavar's profile image mavar posted 5 years ago Permalink

yeap, It can by a reason. I created this table:

Description

Next I checked datatypes directly in database:

Description

So datatype "timestamp without time zone" is used internaly, when I create table/column with only timestamp option....

Code modification/commit 64c43ae from Ansgar Becker <anse@heidisql.com>, 5 years ago, revision 10.2.0.5707
Issue #62: distinct between TIMEZONE (without time zone) and TIMEZONETZ (with time zone). And modify GetDatatypeByName() so it deletes the longest detected datatype string PostgreSQLDatatypes.Names . This solves empty/undetected column comments in ParseTableStructure(). See https://www.heidisql.com/forum.php?t=23211#p34709
ansgar's profile image ansgar posted 5 years ago Permalink

Should also be fixed in the next build.

Please post in ticket #62 for further stuff.

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