Skip to content

feat: Check partition existence and health in divider before executing table creation#17

Merged
soniapi merged 1 commit intopropfrom
jules-divider-partition-check-13430159607150436215
Mar 24, 2026
Merged

feat: Check partition existence and health in divider before executing table creation#17
soniapi merged 1 commit intopropfrom
jules-divider-partition-check-13430159607150436215

Conversation

@soniapi
Copy link
Owner

@soniapi soniapi commented Mar 24, 2026

When divider is called to create partition tables based on the divider_value, it currently blindly executes the CREATE TABLE queries which will fail if the tables were previously created (e.g. by manual migration). This change queries pg_tables in the public schema to verify if both tables (objects_s_below_... and objects_s_above_...) exist, runs a quick SELECT 1 FROM <partition> LIMIT 1; health check to ensure they are queryable, and if everything is correct, logs an informative message and bypasses the CREATE TABLE statement execution.


PR created automatically by Jules for task 13430159607150436215 started by @soniapi

@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Added logic inside `divider` to check if `partition_name_below` and `partition_name_above` already exist via `pg_tables`. If they do, they are verified with a simple `SELECT 1` health check query. If they are both present and healthy, the `CREATE TABLE` queries are bypassed and the function safely returns early with an informative log message.

Co-authored-by: soniapi <396009+soniapi@users.noreply.github.com>
@soniapi soniapi force-pushed the jules-divider-partition-check-13430159607150436215 branch from 0041177 to 6b36f9d Compare March 24, 2026 17:58
@soniapi soniapi merged commit 56822c9 into prop Mar 24, 2026
1 check passed
@soniapi soniapi deleted the jules-divider-partition-check-13430159607150436215 branch March 24, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant