Conversation
Move functions that compare server version numbers to their own script
Created new script to contain just functions that compare server versions
Add the new script to the db-core installer
Moved test for server-version comparers to their own script
Test script for just functions that compare server versions.
Move server-version comparers to own script
Grudgingly used dynamic sql to execute CREATE INDEX IF NOT EXISTS so the script compiles with pre-pg9.5. Discarded the alternative of using just the pre-pg9.5 code for all versions to make sure the customization is easily found later.
The code to upgrade schema of table ConnectionActivity unnecessarily used IF NOT EXISTS. Removed this use and added comments to say why it is OK to remove IF NOT EXISTS. Coincidentally, and fortunately, this change avoids having to execute pg-version specific code as required in Issue #230.
Using this edit as an opportunity to say: Fixes #259
Had missed a couple more instances of Remove IF NOT EXISTS used with ADD COLUMN
Added gaurd for pg_event_trigger_ddl_commands() and updated testDDLActivityLogging.sql to support these changes
Guard CREATE INDEX IF NOT EXISTS for Postgres 9.4 or earlier
This reverts commit 9202699.
This reverts commit a1ad407.
Added triggers to prevent row deletion over tables DDLActivity and ConnectionActivity. The tables can still be truncated, still only by ClassDB role or a superuser. Fixes #176
Also fixed a bug in the part that tested existence of triggers: used to test if at least one of the triggers are defined, instead of testing if all expected triggers are defined.
Updated the function logDDLActivity to not add values to DDLAcitivity for drop statements in versions < 9.5. Also removed update to test scripts as they are now unneeded.
Reject row deletion over tables DDLActivity and ConnectionActivity
…_commands() Guard uses of pg_event_trigger_ddl_commands() for Postgres 9.4 or earlier
These guards prevent any statements in enableConnectionLoggignReco.psql and disableConnectionLoggingReco.psql from being run if the current Postgres server version is < 9.4.
Use the pre-defined role pg_signal_backend only in server versions 9.6 or later. Fixes #225 Note: Depending on server version is technically not correct because the functionality in question is determined on the existence of a specific server role which can be tested in the pg_roles table. However, testing for server version is more practical and maintainable.
Use dynamic SQL to grant a role to CURRENT_USER in pg9.4 or earlier versions. Fixes #229
Related to #229, but instead of guarding for pg9.4 or earlier, reused the helper function ClassDB.grantRole. This keeps the test script simple and maintainable.
Must use dynamic SQL for all pg versions so the script compiles in pg versions 9.4 and earlier
Guard uses of ALTER SYSTEM for pg9.3 compatability
Use machine-readable version number to determine current server's version
Adds a temp function that when given a DROP OWNED BY query it will dynmically EXECUTE the query with an attach CURRENT_USER
Guard GRANT to CURRENT_USER in pg9.4 or earlier
initalizeServerCore.sql -> initializeServerCore.sql
Add Guard for DROP OWNED BY
Fix server initialization filename
Fix removeAllFromDB.sql
Added M4 docs to repo
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.
This PR adds the M4 changes to master