Add PostgreSQL equivalent of onprc_ehr-26.003-26.004 cleanup script - #1871
Merged
Conversation
The sqlserver onprc_ehr-26.003-26.004.sql script landed in "26.3 fb stored procedure cleanup" (#1803) without a matching postgresql script, so the temp tables and stored procedures it retires are still present on PostgreSQL deployments. This adds the postgresql counterpart. Each stored procedure the sqlserver script retires is a zero-argument plpgsql function on this platform, so the fn_dropifexists calls become the equivalent conditional drops against onprc_ehr. Six of the sqlserver statements have no PostgreSQL counterpart and are recorded as comments rather than executed. Five target the sqlserver 'dbo' schema (sp_RpSLASummaryCensus, Rpt_SLaCensus, RptMergeChargetypeUpdateSP, Rpt_Labwork_MergeUpdate, Rpt_Labwork_MergeUpdatelog) and are created by no script on either platform; the sixth targets onprc_ehr_compliancedb, which has no postgresql dbscripts directory at all. Mapping 'dbo' onto 'public' was considered and rejected: across the whole enlistment the only PostgreSQL objects in 'public' are LabKey's four global domain types, so no module owns anything there. Every remaining drop targets an object that a postgresql script in this module actually creates, in onprc_ehr-0.000-25.000.sql, 25.003-25.004, 25.004-25.005, and 26.001-26.002.
labkey-jeckels
approved these changes
Aug 28, 2026
labkey-jeckels
left a comment
Contributor
There was a problem hiding this comment.
Comments feel more verbose than really needed but not doing much harm.
Contributor
Author
Yup. Normally I’d shorten comments like this, but one thing I’ve noticed working with Claude is that if we’re going to use it as part of development, the extra context can be useful for Claude going forward, not just for developers. I’ve had a few recent cases where a brief one-line comment or commit message wasn’t enough for it to understand why something was done. |
labkey-martyp
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
The sqlserver
onprc_ehr-26.003-26.004.sqlscript landed in "26.3 fb stored procedure cleanup" (#1803) without a matching postgresql script. The temp tables and stored procedures it retires are therefore still present on PostgreSQL deployments, leaving the two platforms out of sync at schema version 26.004.Related Pull Requests
Changes
onprc_ehr/resources/schemas/dbscripts/postgresql/onprc_ehr-26.003-26.004.sql.Note for review
Five objects the sqlserver script drops out of
dboare created by no script in this repo on either platform, so they appear to have been created out-of-band in the ONPRC database. If they are real there, a parallel out-of-band cleanup may still be needed on PostgreSQL that this script cannot cover — worth confirming with the author of #1803 before the 26.3 upgrade runs.