Start a new topic

Disable syntax highlighting for Postgresql cast abbreviation

[This topic is migrated from our old forums. The original author name has been removed]
[Attachment has been removed.]

In Postgresql cast ( var as type ) can be abbreviated as var::type [1]. The abbreviated syntax highlights the var:: part in bold pink. Could the highlightning pattern be adjusted to show this syntax in line with the traditional cast syntax, at least for Postgresql connections. [1] http://www.postgresql.org/docs/9.3/static/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS

[This reply is migrated from our old forums. The original author name has been removed]

Re: Disable syntax highlighting for Postgresql cast abbreviation
Hi Hans, that's great! Regards, Jonas
[This reply is migrated from our old forums.]

Re: Disable syntax highlighting for Postgresql cast abbreviation
Hi Jonas, Point taken. I have opened a ticket to look into this. Consider changing the label highlight color as a work-around until the label detection is improved. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Disable syntax highlighting for Postgresql cast abbreviation
Hi Hans, it is true that i can disable the label highlightning by adjusting the color scheme. I tried to have a look at the lables syntax for different sql dialects and as far as I find rerefences it seems that the label is an identifier followed by exactly one colon and white space. Currently dbvis highlights any number of colons, and any text preceding them which is not a reserved word, also if there is white space, and regardless of what is after the colon. This makes, besides from the Postgresql cast shorthand, also at least procedural variable assingment (pl/sql and pl/pgslq) is incorrectly highlihted, eg a := b + 1; where 'a :' is highlighted. Even a single colon is highlighed when the preceding text is a reserved word as in eg a int := b + 1;. Also, two (or any number of) colons will be highlighted, which as far as I understand, are not valid in lablels. My suggestion would be that the label highlightning pattern would be refined to match an identifier followed by one and only one colon followed by white space. Thank you for a great product! Regards, Jonas SQL Server GOTO [https://msdn.microsoft.com/en-us/library/ms180188.aspx] DB2 GOTO [https://www-01.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/com.ibm.db2z10.doc.apsg/src/tpc/db2z_ stmtlabelsnestedcompoundstmt.dita] MySQL GOTO [https://dev.mysql.com/doc/refman/5.7/en/statement-labels.html] Edited by: Hans Bergsten on Mar 1, 2016 7:08 PM
[This reply is migrated from our old forums.]

Re: Disable syntax highlighting for Postgresql cast abbreviation
Hi Jonas, The editor interprets the PostgreSQL-specific type cast syntax as a "label". You can change the color for this in Tools->Tool Properties, under General/Appearance/Fonts. Best Regards, Hans