Author: pledbrook
Date: 2006-06-12 08:43:27-0700
New Revision: 10170
Added:
branches/release/b21/src/sql/postgresql/hack-db.sql (contents, props changed)
Modified:
branches/release/b21/INSTALL
Log:
Added a script that works around a problem between Torque and PostgreSQL.
Modified: branches/release/b21/INSTALL
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/INSTALL?view=diff&rev=10170&p1=branches/release/b21/INSTALL&p2=branches/release/b21/INSTALL&r1=10169&r2=10170
==============================================================================
--- branches/release/b21/INSTALL (original)
+++ branches/release/b21/INSTALL 2006-06-12 08:43:27-0700
@@ -21,12 +21,14 @@
+----------------+--------------------------------------------------
| MySQL | Full support for 4.0 and 4.1
- | PostgreSQL | Full support
+ | PostgreSQL | Full support (*)
| MS SQL Server | partial support [FIXME] what is partial support ?
| Oracle | partial support [FIXME] what is partial support ?
| Hypersonic | partial support [FIXME] what is partial support ?
+----------------+--------------------------------------------------
+(*) See step 5a for more details.
+
,-----------------------------------------------------------------------.
| Step 1: Unpack the Scarab distribution
'-----------------------------------------------------------------------'
@@ -135,6 +137,30 @@
maven -Dskip.seed.data=true scarab:create-db
+*** IMPORTANT information for PostgreSQL users ***
+
+Due to a problem in the database persistence framework we use, Scarab
+will not work "out-of-the-box" with PostgreSQL. Fortunately, there is
+a simple script that you can run which will create a work-around.
+
+This script must be run by a user with sufficient privileges, which
+generally means the user that originally created and initialised the
+PostgreSQL database. Typically this user will be 'postgres'.
+
+The script can be found at src/sql/postgresql/hack-db.sql in the
+distribution, and it can be executed in different ways, for example
+from the command line:
+
+postgres> psql scarab < hack-db.sql
+
+where 'scarab' is the name of the Scarab database, and 'postgres' is
+the "system" postgreSQL user. Alternatively, from the psql interactive
+console:
+
+scarab=> \i hack-db.sql
+
+*** End ***
+
JIRA templates
--------------
Added: branches/release/b21/src/sql/postgresql/hack-db.sql
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/sql/postgresql/hack-db.sql?view=auto&rev=10170
==============================================================================
--- (empty file)
+++ branches/release/b21/src/sql/postgresql/hack-db.sql 2006-06-12 08:43:27-0700
@@ -0,0 +1,12 @@
+---
+--- This is a hack specific to PostgreSQL: implicit conversions from
+--- bool to smallint are no longer supported, and this causes problems
+--- with columns that are defined as BOLLEANINT in a Torque schema.
+--- These lines add a cast to the Scarab database that resolves the
+--- problem, although it is not particularly elegant!
+---
+CREATE FUNCTION bool2smallint(boolean) RETURNS smallint AS $$
+ SELECT CASE WHEN $1 THEN INT2(1) ELSE INT2(0) END;
+$$ LANGUAGE SQL;
+
+CREATE CAST (boolean AS smallint) WITH FUNCTION bool2smallint(boolean) AS IMPLICIT;
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.