Skip to content

Commit b385498

Browse files
authored
Merge pull request #1462 from beonode/psql-partial-unique-index-fix
Do not treat columns with partial unique indexes as unique in psql driver
2 parents 3dcc359 + 5f0bad9 commit b385498

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
44
and this project adheres to [Semantic
55
Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
9+
### Fixed
10+
11+
- Do not treat columns with partial unique indexes as unique in psql driver.
12+
713
## [4.19.1] - 2025-05-20
814

915
### Fixed

drivers/sqlboiler-psql/driver/psql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ method_b as (
365365
inner join pg_class pgc on pgix.indexname = pgc.relname and pgc.relkind = 'i' and pgc.relnatts = 1
366366
inner join pg_index pgi on pgi.indexrelid = pgc.oid
367367
inner join pg_attribute pga on pga.attrelid = pgi.indrelid and pga.attnum = ANY(pgi.indkey)
368-
where pgi.indisunique = true
368+
where pgi.indisunique = true and pgi.indpred is null
369369
),
370370
results as (
371371
select * from method_a

0 commit comments

Comments
 (0)