Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source-postgres: Discover 'citext' columns as strings #2035

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source-postgres/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func predictableColumnOrder(colType any) bool {
// Currently all textual primary key columns are considered to be 'unpredictable' so that backfills
// will default to using the 'imprecise' ordering semantics which avoids full-table sorts. Refer to
// https://github.com/estuary/connectors/issues/1343 for more details.
if colType == "varchar" || colType == "bpchar" || colType == "text" {
if colType == "varchar" || colType == "bpchar" || colType == "text" || colType == "citext" {
return false
} else if _, ok := colType.(postgresEnumType); ok {
return false
Expand Down Expand Up @@ -314,6 +314,7 @@ var postgresTypeToJSON = map[string]columnSchema{
"varchar": {jsonTypes: []string{"string"}},
"bpchar": {jsonTypes: []string{"string"}},
"text": {jsonTypes: []string{"string"}},
"citext": {jsonTypes: []string{"string"}}, // From the 'citext' extension so we don't test it by default, but it hurts nothing to support it here
"bytea": {jsonTypes: []string{"string"}, contentEncoding: "base64"},
"xml": {jsonTypes: []string{"string"}},
"bit": {jsonTypes: []string{"string"}},
Expand Down
Loading