Gwen,<br><br>Please review existing issues for postgresql [1] and submit your patch to one if appropriate, or if not, create an issue and attach it there [2].<br><br>Nat<br><br>1. <a href="http://drupal.org/project/issues/drupal?text=postgresql&projects=3060&states=1%2C16%2C8%2C13%2C14%2C15%2C2%2C4">http://drupal.org/project/issues/drupal?text=postgresql&projects=3060&states=1%2C16%2C8%2C13%2C14%2C15%2C2%2C4</a><br>
2. <a href="http://drupal.org/node/add/project-issue/drupal">http://drupal.org/node/add/project-issue/drupal</a><br><br><div class="gmail_quote">On Thu, Jun 19, 2008 at 3:13 PM, Saint-Genest Gwenael <<a href="mailto:gwenael.saint-genest@makina-corpus.com">gwenael.saint-genest@makina-corpus.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
Today, i've tried to install two sets of datas into a drupal 6.2<br>
database (with pgsql). With a table prefix i've take an error like :<br>
<br>
Warning: pg_query() [function.pg-query]: Query failed: ERROR: type<br>
"int_unsigned" already exists in<br>
/var/www/xxxxxx/drupal-6.2/includes/database.pgsql.inc on line 138<br>
Warning: ERROR: type "int_unsigned" already exists query: CREATE DOMAIN<br>
int_unsigned integer CHECK (VALUE >= 0) in<br>
/var/www/xxxxxx/drupal-6.2/includes/database.pgsql.inc on line 159<br>
Warning: pg_query() [function.pg-query]: Query failed: ERROR: type<br>
"smallint_unsigned" already exists in<br>
/var/www/xxxxxx/drupal-6.2/includes/database.pgsql.inc on line 138<br>
Warning: ERROR: type "smallint_unsigned" already exists query: CREATE<br>
DOMAIN smallint_unsigned smallint CHECK (VALUE >= 0) in<br>
/var/www/xxxxxx/drupal-6.2/includes/database.pgsql.inc on line 159<br>
Warning: pg_query() [function.pg-query]: Query failed: ERROR: type<br>
"bigint_unsigned" already exists in<br>
/var/www/xxxxxx/drupal-6.2/includes/database.pgsql.inc on line 138<br>
Warning: ERROR: type "bigint_unsigned" already exists query: CREATE<br>
DOMAIN bigint_unsigned bigint CHECK (VALUE >= 0) in<br>
/var/www/xxxxxx/drupal-6.2/includes/database.pgsql.inc on line 159<br>
<br>
Ok ... Drupal try to create data types two times ... and crash :(<br>
<br>
If anyone else has the same error, this patch can solve this problem :<br>
<br>
--=={ snip }==--<br>
--- drupal-6.2-ref/modules/system/system.install 2008-06-19<br>
10:19:36.000000000 +0200<br>
+++ drupal-6.2/modules/system/system.install 2008-06-19<br>
15:53:28.000000000 +0200<br>
@@ -302,9 +302,15 @@<br>
function system_install() {<br>
if ($GLOBALS['db_type'] == 'pgsql') {<br>
// Create unsigned types.<br>
- db_query("CREATE DOMAIN int_unsigned integer CHECK (VALUE >= 0)");<br>
- db_query("CREATE DOMAIN smallint_unsigned smallint CHECK (VALUE >=<br>
0)");<br>
- db_query("CREATE DOMAIN bigint_unsigned bigint CHECK (VALUE >= 0)");<br>
+ if (!db_result(db_query("SELECT COUNT(*) FROM pg_type WHERE typname<br>
= 'int_unsigned'"))) {<br>
+ db_query("CREATE DOMAIN int_unsigned integer CHECK (VALUE >= 0)");<br>
+ }<br>
+ if (!db_result(db_query("SELECT COUNT(*) FROM pg_type WHERE typname<br>
= 'smallint_unsigned'"))) {<br>
+ db_query("CREATE DOMAIN smallint_unsigned smallint CHECK (VALUE<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
= 0)");<br>
</blockquote>
+ }<br>
+ if (!db_result(db_query("SELECT COUNT(*) FROM pg_type WHERE typname<br>
= 'bigint_unsigned'"))) {<br>
+ db_query("CREATE DOMAIN bigint_unsigned bigint CHECK (VALUE >= 0)");<br>
+ }<br>
<br>
// Create functions.<br>
db_query('CREATE OR REPLACE FUNCTION "greatest"(numeric, numeric)<br>
RETURNS numeric AS<br>
--=={ snip }==--<br>
<br>
<br>
Gwen<br><font color="#888888">
<br>
-- <br>
Gwenael Saint-Genest<br>
MAKINA CORPUS - <a href="http://www.makina-corpus.com" target="_blank">www.makina-corpus.com</a><br>
44 boulevard des Pas Enchantés FR-44230 Saint Sébastien sur Loire<br>
Tel : +33 (0) 2 40 94 96 08<br>
</font></blockquote></div><br>