pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.43k stars 638 forks source link

Incorrect SQL generated for create script of domain type interval with precision. ERROR: syntax error at or near "[" (RM #3853) #2232

Closed dpage closed 2 years ago

dpage commented 5 years ago

Issue migrated from Redmine: https://redmine.postgresql.org/issues/3853 Originally created by Réal Carbonneau at 2019-01-06 18:08:26 UTC.

Incorrect SQL generated for create script of domain type interval with precision. ERROR: syntax error at or near "["

Steps to reproduce: 1) Create database


-- Database: d
-- DROP DATABASE d;
CREATE DATABASE d
    WITH 
    OWNER = postgres
    ENCODING = 'UTF8'
    LC_COLLATE = 'C'
    LC_CTYPE = 'C'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;

2) Create schema


-- SCHEMA: s
-- DROP SCHEMA s ;
CREATE SCHEMA s
    AUTHORIZATION postgres;

3) Create domain of type interval with precision 6


-- DOMAIN: s.my_interval
-- DROP DOMAIN s.my_interval;
CREATE DOMAIN s.my_interval
    AS interval(6);
ALTER DOMAIN s.my_interval OWNER TO postgres;

4) Right-click servers and choose refresh just in case

5) Right-click domain my_interval and choose CREATE Script

6) Click execute. ERROR: syntax error at or near "[". See attached screenshot.

7) Incorrect SQL is generated. Correct and working SQL is already presented here in step 3). See attached screenshot.

dpage commented 5 years ago

Image migrated from Redmine: https://redmine.postgresql.org/attachments/download/3523 Originally created by Réal Carbonneau at 2019-01-06 18:05:45 UTC.

SQL_error_for_generated_create_SQL_for_domain_interval_with_precision.png

Filename: SQL_error_for_generated_create_SQL_for_domain_interval_with_precision.png

Description: SQL error for generated create SQL for domain interval with precision

dpage commented 5 years ago

Image migrated from Redmine: https://redmine.postgresql.org/attachments/download/3524 Originally created by Réal Carbonneau at 2019-01-06 18:07:46 UTC.

Correct_SQL_for_domain_interval_with_precision.png

Filename: Correct_SQL_for_domain_interval_with_precision.png

Description: Correct SQL for domain interval with precision

dpage commented 5 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/3853#note-3 Originally created by Khushboo Vashi at 2019-01-11 10:33:54 UTC.

Redmine ticket header update:

Name Old Value New Value
Sprint changed Ready
dpage commented 5 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/3853#note-4 Originally created by Akshay Joshi at 2019-01-16 10:46:02 UTC.

Redmine ticket header update:

Name Old Value New Value
Sprint changed Ready EDB Sprint 32
dpage commented 5 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/3853#note-5 Originally created by Khushboo Vashi at 2019-01-17 06:14:49 UTC.

Redmine ticket header update:

Name Old Value New Value
Status changed New In Progress
Assigned To changed Khushboo Vashi
dpage commented 5 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/3853#note-6 Originally created by Khushboo Vashi at 2019-01-21 08:43:15 UTC.

Patch sent. https://www.postgresql.org/message-id/CAFOhELeOFhg9izkcnWgmpXBy4nc3vCj6XNnMaJYx8Cx+c0nT8g@mail.gmail.com

dpage commented 5 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/3853#note-7 Originally created by Khushboo Vashi at 2019-01-22 12:23:48 UTC.

Applied in changeset commit:c6bae69b6f71ee68886aae5db895952af067fff1.

Redmine ticket header update:

Name Old Value New Value
Status changed In Progress In Testing
Done Ratio changed 0 90
dpage commented 5 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/3853#note-8 Originally created by Fahar Abbas at 2019-01-23 04:41:56 UTC.

This is already resolved in latest Build and tested on Windows 64:

https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2019-01-23/

Redmine ticket header update:

Name Old Value New Value
Status changed In Testing Resolved
Done Ratio changed 90 100
dpage commented 5 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/3853#note-9 Originally created by Akshay Joshi at 2019-01-28 07:07:59 UTC.

Redmine ticket header update:

Name Old Value New Value
Fixed Version changed 4.2
dpage commented 2 years ago

Issue closed on Redmine.