Strange Bug with Comments and PGScript

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dschuch
Posts: 73
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

Strange Bug with Comments and PGScript

Post by dschuch » Tue 08 Oct 2019 11:30

Hi,

if u use a code like this, the PGScript will just do nothing. The reason is that the last comment is before the ";" (which is also the Default Delimiter)

Code: Select all

INSERT INTO a VALUES
 ('A'), -- Comment
 ('B')  -- Comment Last line
 ;
 
-Attached you find a TestApplication.-

* unable to find a button to upload an example. just execute this SQL Statement in a simple PGScript and you will see: nothing happens

Question: is there is any way to prevent the PGScripter from splitting the Statement? We want to execute the Script as one statement (with comments, which are also thrown away)
Actually i made it with typing "NEVER FIND THIS DELIMITER" in the Delimited Property.

dschuch
Posts: 73
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

Re: Strange Bug with Comments and PGScript

Post by dschuch » Tue 08 Oct 2019 13:45

Another Example: try to execute this statement in a PGScript. (With comment Lines at the end)

Code: Select all

-- Info: "WITHOUT TIME ZONE" nicht mehr nötig - TIMESTAMP wurde mit Postgre 7.3 dem SQL-Standard angepasst und ist jetzt standardmäßig ohne TIMEZONE
CREATE OR REPLACE FUNCTION currenttime() 
RETURNS timestamp AS $$
  SELECT date_trunc(
      'second', 
      transaction_timestamp()::timestamp
  )
$$ LANGUAGE sql --
--

dschuch
Posts: 73
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

Re: Strange Bug with Comments and PGScript

Post by dschuch » Tue 08 Oct 2019 17:34

PS: Ver 6.0.1

Post Reply