LP2023418: Ignore system and user psqlrc settings when determining Pg version Ignore any settings in the system or user .psqlrc files when determining postgres version as some combinations can confuse cut. Passing -A also means that the call to xargs to trim spaces is no longer necessary. Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org> Signed-off-by: Jane Sandberg <js7389@princeton.edu>
LP#1730721: future proof build-db.sh (followup) For PostgreSQL 10+, the versioning scheme has changed. We only want the top number for those versions and up. So, grab only the first two numbers for the variable... 9.6.5 = 96 10.0 = 10, etc. Signed-off-by: Ben Shum <ben@evergreener.net> Signed-off-by: Jason Stephenson <jason@sigio.com>
LP#1730721: future proof build-db.sh Use the same logic we've got in eg_db_config for build-db.sh to determine PostgreSQL version installed on server. Signed-off-by: Ben Shum <ben@evergreener.net> Signed-off-by: Jason Stephenson <jason@sigio.com>
fix the new deps stuff git-svn-id: svn://svn.open-ils.org/ILS/trunk@20351 dcc99617-32d9-48b4-a31d-7c20da2025e4
script to update DB object comments New script, update-db-comments.sh, to be run as part of upgrades to refresh comments on database schema objects. Usage is: update-db-comments.sh db-host db-port db-name db-user db-pass The helper script grab-db-comment.pl is what actually parses out the comment statements. To avoid repetition, the list of default SQL scripts to use when initializing an Evergreen database has been moved to a new file called sql_file_manifest. Signed-off-by: Galen Charlton <gmc@esilibrary.com> git-svn-id: svn://svn.open-ils.org/ILS/trunk@20161 dcc99617-32d9-48b4-a31d-7c20da2025e4
Set default db schema search path to public,pg_catalog With the addition of the 'evergreen' schema, we discovered that all of the unqualified database objects were being created in the 'evergreen' schema if the database user name was 'evergreen' (as the default search path is "$user",public we started matching "$user"). Thomas Berezansky proposed a variation of the function provided here for changing database settings. By creating the function in the first schema file, the subsequent connections pick up the new default search path and all works blissfully as it once did. Long term, we should probably move towards explicitly qualified database objects. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19759 dcc99617-32d9-48b4-a31d-7c20da2025e4
Clean up build errors when creating/recreating database schema Dropping the evergreen schema cascaded and wiped out some previously defined functions, so move it ahead of the other functions. (And maybe we can start moving those public functions into the evergreen schema?) DROP AGGREGATE IF EXISTS exists on any version of PostgreSQL that we care about for Evergreen 2.0, so we can use it to avoid false errors during schema creation. FTS config was complaining about public.english_nostop in the ALTER statement, so remove the schema qualification. This seems to have been there for a long time? Use IF EXISTS when dropping the unapi schema to avoid an error. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19723 dcc99617-32d9-48b4-a31d-7c20da2025e4
Resolve inconsistent results when invoking LOWER() in C vs. UTF8 locale databases As reported by the Fundamental Science Library of Armenia, patron searches were not retrieving patrons who were known to be part of the patron database. While the initial approach to solve this problem used an encode_utf8() call to encode the data before passing it on to the database, this turned out to break the patron search function in other environments. Testing by Dan Wells confirmed that the LOWER() function returned different results when invoked against text in a database created with LC_CTYPE=C vs a database created with LC_CTYPE=*.UTF-8. As the patron search function used a Perl lc() function call to convert the incoming data to lowercase, the success of the call depended on the LC_CTYPE value of the database. To avoid this problem in the future, we define our own evergreen.lowercase() function that can reliably produce lowercase text for characters outside the Latin1 range, and we convert our indexes and function calls to use that function consistently. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19715 dcc99617-32d9-48b4-a31d-7c20da2025e4
Merging in unAPI v2, the bono edition * Add unapi schema, functions and initial transform setup * General purpose tag URI parser * upgrade script and build-db.pl integration git-svn-id: svn://svn.open-ils.org/ILS/trunk@19506 dcc99617-32d9-48b4-a31d-7c20da2025e4
Patch from Thomas Berezansky addressing logical importance of various circulation and hold matrix matchpoint components. Previous to this commit, INDB circ and holds use a pre-defined weighting set for rule ordering. This can be changed via replacing the relevant "find" functions in the database, but this is not easily done for most people. The weight set for circ matchpoints is obtained based on the context ou of the circ (aka, where the circ is happening). The weight set for hold matchpoints is obtained based on the item's circ library (aka, where the item lives). Optionally, add an enabled circ.holds.weight_owner_not_circ internal flag to have the weight set for hold matchpoints be obtained based on the item's owning library (owner of the call number). TODO: discuss promotion of circ.holds.weight_owner_not_circ to a Global Flag; wikified or docbook'd documentation and use-case examples. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19317 dcc99617-32d9-48b4-a31d-7c20da2025e4
Build 210.serial before 200.acq, because 200.acq references serials Confusing due to the order implied by the filename numbers, but priority has to be on getting trunk to build cleanly again; we can sort out a better way later. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17129 dcc99617-32d9-48b4-a31d-7c20da2025e4
add 954.data.marc21expand880.sql to build-db.sh so that it gets picked up during new installations Signed-of-by: Galen Charlton <gmc@esilibrary.com> git-svn-id: svn://svn.open-ils.org/ILS/trunk@16781 dcc99617-32d9-48b4-a31d-7c20da2025e4
1. Eliminate somed source_definitions from the IDL where there is already an equivalent view. In the presence of a tablename attribute, the source_definitions were being ignored anyway. This step applies to classes aufhl, aufhml, and aufhil. 2. For class aufhmxl: the IDL had both a tablename and a source_definition, but there was no table or view corresponding to the tablename. I eliminated the source_definition and created the corresponding view action.unfulfilled_hold_max_loop. 3. For class aufhol: the IDL had both a tablename and a source_definition, but neither was valid. The tablename didn't exist in the database, and the source_definition referenced the action.unfulfilled_hold_max_loop view, which didn't exist. I removed the tablename attribute and left the source_definition in place, which is now valid because in step 2 I created the missing view. 4. Unrelated: added 201.acq.audit-functions.sql to the list of installation scripts to run in build-db.sh. M Open-ILS/src/sql/Pg/090.schema.action.sql M Open-ILS/src/sql/Pg/002.schema.config.sql A Open-ILS/src/sql/Pg/upgrade/0185.schema.acq.aufhmxl-view.sql M Open-ILS/src/sql/Pg/build-db.sh M Open-ILS/examples/fm_IDL.xml git-svn-id: svn://svn.open-ils.org/ILS/trunk@15778 dcc99617-32d9-48b4-a31d-7c20da2025e4
adding new schemas to the database building script git-svn-id: svn://svn.open-ils.org/ILS/trunk@15076 dcc99617-32d9-48b4-a31d-7c20da2025e4
promote the #Evergreen channel over #OpenILS-Evergreen. Does this show up anywhere else? git-svn-id: svn://svn.open-ils.org/ILS/trunk@14938 dcc99617-32d9-48b4-a31d-7c20da2025e4
add the new trigger stuff to the db initialization git-svn-id: svn://svn.open-ils.org/ILS/trunk@11876 dcc99617-32d9-48b4-a31d-7c20da2025e4
reorder the now-moved 999 file git-svn-id: svn://svn.open-ils.org/ILS/trunk@11473 dcc99617-32d9-48b4-a31d-7c20da2025e4
Adding basic user merge function. It blindly copies all data from source user to destination user. When it finds collisions (e.g. 2 user bookbags with the same name), it deletes the offending record from the source user and retains the destination user's data. Added to build-db.sh to load at install time git-svn-id: svn://svn.open-ils.org/ILS/trunk@11248 dcc99617-32d9-48b4-a31d-7c20da2025e4
Include 954.data.MODS33-xsl.sql when creating the schema git-svn-id: svn://svn.open-ils.org/ILS/trunk@11064 dcc99617-32d9-48b4-a31d-7c20da2025e4
didn't mean to to check this in git-svn-id: svn://svn.open-ils.org/ILS/trunk@10908 dcc99617-32d9-48b4-a31d-7c20da2025e4