I'm on Drupal 7.7, first time installing Quotes ... PostgreSQL backend ...

===
Notice: Array to string conversion in DatabaseSchema_pgsql->createTableSql() (line 131 of /usr/local/www/d_admin/dev.bestseniorsinfo.com/www/includes/database/pgsql/schema.inc).

PDOException: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "Array" LINE 6: CONSTRAINT quotes_authors_name_key UNIQUE (Array) ^: CREATE TABLE {quotes_authors} ( aid serial CHECK (aid >= 0), name text NOT NULL, bio text NULL, PRIMARY KEY (aid), CONSTRAINT quotes_authors_name_key UNIQUE (Array) ); Array ( ) in db_create_table() (line 2657 of /usr/local/www/d_admin/dev.bestseniorsinfo.com/www/includes/database/database.inc).
===

Am going to try and trace through the code in the morning, but if anyone has an idea ... ?

Comments

hubScrappy’s picture

Priority: Normal » Major
Status: Active » Needs review

The following patch fixes the issue ... is this something that works under MySQL, and just not PostgreSQL? Looking at the other tables in quotes.install, this one seems the only one that has the 'double array' and the ,255, so I'm figuring maybe a typo, but how nobody else came across it odd if it is ... ?

*** /tmp/quotes.install Fri Oct 28 07:06:57 2011
--- quotes.install      Fri Oct 28 07:13:27 2011
***************
*** 206,213 ****
        ),
      'primary key' => array('aid'),
      'unique keys' => array(
!       'name' => array(array('name', 255)),
!       ),
      );
  
    return $schema;
--- 206,212 ----
        ),
      'primary key' => array('aid'),
      'unique keys' => array(
!       'name' => array('name')),
      );
  
    return $schema;
ctmattice1’s picture

Status: Needs review » Postponed

Without the double array MySQL fails on the unique key. The error is a length error which is why the double array. It could be easily fixed by changing the type to varchar and adding a length of 255. However, in the early days of quotes (ie 5.x something or early 6x this was changed from varchar(255) to text as people were using the author field for biographical info before the Bio option was added.

Now with the bio option it would make more sense to go back to a varchar type and eliminate the double array. I'll open a new issue on using the author field for biographical info on old releases and see how many still have their data set this way.

ctmattice1’s picture

Status: Postponed » Fixed

New dev release out

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.