Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Postgres Megaissue TODO | GoodFirstPicks

Postgres Megaissue TODO

frappe/frappe 1 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeTest focusedFrappe / ERPNextPython

Why this is a good first issue

Postgres-specific type handling and test adjustments needed with some upstream dependencies.

AI Summary

The issue involves fixing Postgres-specific type comparisons and test behaviors, with some upstream fixes required. It requires understanding of database type handling and test decorators. Blockers include CI inconsistencies and upstream dependencies.

Issue Description

TODO (Related to #21613) This issue is meant to track progress of Postgres Support (as part of a multi-db feat.)

  • Adding Postgres Support for clear_log_table (works locally, but test seems to fail on CI (cache issue probably)?...fix needed here! (This is an upstream fix!)
  • Enabling test_unique_index_on_alter to run on Postgres (works locally, fails CI?...fix needed here! -> UPDATE: It's an implementation problem causing unnecessary performance drag, PR fixes that by adding a single unique index)
  • Unnecessary schema migrations are being triggered in PostgreSQL due to literal type comparison instead of semantic equivalence checks, this is particularly because of the way some of these "types" are stored in Postgres, an ALIAS problem to be precise, this means a form of normalization is required. (This is an upstream fix!)

The identified Aliases are:

decimal(21,9) -(stored as)-> numeric(21,9) int -(stored as)-> integer varchar -(stored as)-> character varying

Doc Link : Postgres Data Types

This results in redundant ALTER TABLE operations:

if current_def["type"] != column_type and not (
# XXX: MariaDB JSON is same as longtext and information schema still returns longtext
current_def["type"] == "longtext" and column_type == "json" and frappe.db.db_type == "mariadb"):
			self.table.change_type.append(self)

This causes false-positive migrations and failing sanity tests like: TestDBUpdateSanityChecks.test_no_unnecessary_migrates.

Possible Solution: Write a def normalize_type_for_diff util that handles this comparison for Postgres too.

  • Add a custom decorator like unimplemented macro (Rust) that handles skipping test for postgres but specifically in cases where it makes no sense to run (i.e. MariaDB behavior specific test) or because of lack of proper implementation with respect to postgres behavior.
  • Need to fix postgres behavior for `test_ha

GitHub Labels

postgres

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • upstream fixes needed
  • CI inconsistencies
  • database-specific behavior
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedyes