PostgreSQL Visual Explain: Insert executes twice with ; statement separator
1. Navigate to PostgreSQL 9.3 or higher and execute below script to create a sample table
CREATE TABLE public.doc_feb_22 (
documenttypesid int4 NULL,
type_id varchar(25) NULL
)
go
2. Enable Show Execution Plan
3. Execute the below insert statements
INSERT INTO doc_feb_22(documenttypesid, type_id)
VALUES(761, 'INVOICE')
;
INSERT INTO doc_feb_22(documenttypesid, type_id)
VALUES(764, 'CASH INV')
;
INSERT INTO doc_feb_22(documenttypesid, type_id)
VALUES(771, 'ARDEPOSITSLIP')
;
INSERT INTO doc_feb_22(documenttypesid, type_id)
VALUES(815, 'CMCINV')
;
INSERT INTO doc_feb_22(documenttypesid, type_id)
VALUES(3201, 'GLCASHSUMMARY')
;
INSERT INTO doc_feb_22(documenttypesid, type_id)
VALUES(3202, 'GLVENDORCONTRACTS')
;
INSERT INTO doc_feb_22(documenttypesid, type_id)
VALUES(769, 'ARDELIVERWAYBILL')
;
4. You can see that 13 records are inserted instead of 7. The first record is inserted once, the rest are inserted 2 times.
5. If you replace the ; statement separator with GO statement separator, then you can see that only 7 records are inserted.
6. This works fine in 17.0.0-rc-51 and Build #: 47456 with Build Date: 2015-Dec-03 06:13:54 PM
7. Broken with the change for 4904 in ADS 17.0.0-rc-52, Build #: 47493 and Build Date: 2015-Dec-04
8. File -> Options -> Scripts -> PostgreSQL is also attached