postgresql custom types (nested composite, enum) not supported in various editor functions
See original GitHub issueDBeaver 21.2.3
Recent DBeaver versions have improved composite type support for Postgresql quite a bit, but there are still broken things unfortunately. The following features in the editor do not work for nested composite types:
- ‘Generate SQL -> INSERT’
- ‘Duplicate Row’ In previous versions, this didn’t work for any composite type, so there’s definitely been an improvement here already (#13351, #13102) but the nested composite types seem to have been overlooked in these improvements.
To reproduce:
create schema test;
create type test.ct as (a int, b int);
create type test.ct2 as (a test.ct, b int);
create table test.t1 (a int, b test.ct2);
insert into test.t1 (a, b.a.a) (values (1, 1));
-- now disconnect and connect so that dbeaver refreshes the metadata cache
select * from test.t1;
-- now right click on a row and choose 'Generate SQL -> INSERT'
This still generates incorrect syntax (array syntax for a composite type):
INSERT INTO test.t1
(a, b)
VALUES(1, '("[1, null]",)');
A second problem arises when using enums inside a schema. Consider the following:
create type test.en as enum ('ab', 'bc');
create table test.t3 (a int, b test.en);
insert into test.t3 (values (1, 'ab'));
-- now disconnect and connect so that dbeaver refreshes the metadata cache
select * from test.t3;
-- now right click on a row and choose 'Generate SQL -> INSERT'
This generates the following SQL (note the missing schema qualifier before en
):
INSERT INTO test.t3
(a, b)
VALUES(1, 'ab'::en);
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Documentation: 15: 8.16. Composite Types - PostgreSQL
A composite type represents the structure of a row or record; it is essentially just a list of field names and their data...
Read more >Unsupported PostgreSQL functions - Amazon Redshift
Lists the PostgreSQL functions that are not supported in Amazon Redshift.
Read more >Data model (Reference) - Prisma
Learn about the concepts for building your data model with Prisma: Models, scalar types, enums, attributes, functions, IDs, default values and more.
Read more >更新记录 - OpenXava
Driver versions in doc and new projects upgraded for MySQL, PostgreSQL, ... Fix: Upload editor property (like @Files) does not fill all width...
Read more >SQl Server to Aurora PostgreSQL Migration Playbook - Awsstatic
Migrate to: Aurora PostgreSQL User Defined Types ... Note that not all SQL Server features are fully compatible with Aurora PostgreSQL, ... Nested...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hmmm, let me re-install tomorrow (it’s 8:30pm and I’m tired). I upgraded from a very old version of DBeaver. Maybe it’s just bunged.
Will let you know. Thanks for checking.
Verified