Fixed an issue where the query tool was not treating IDENTITY columns as columns with default values when inserting new rows. #8341

pull/8432/head
Aditya Toshniwal 2025-02-10 15:05:09 +05:30 committed by GitHub
parent 2fc65589c8
commit 650a15beec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
SELECT DISTINCT att.attname as name, att.attnum as OID, pg_catalog.format_type(ty.oid,NULL) AS datatype,
att.attnotnull as not_null, att.atthasdef as has_default_val, des.description, seq.seqtypid
att.attnotnull as not_null,
CASE WHEN att.atthasdef OR att.attidentity != '' THEN True
ELSE False END as has_default_val, des.description, seq.seqtypid
FROM pg_catalog.pg_attribute att
JOIN pg_catalog.pg_type ty ON ty.oid=atttypid
JOIN pg_catalog.pg_namespace tn ON tn.oid=ty.typnamespace