warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "EXISTS" at character 19 in /home/BPM/docs/includes/database.pgsql.inc on line 139.
user warning: query: DROP AGGREGATE IF EXISTS first(anyelement) in /home/BPM/docs/sites/all/modules/views/views.install on line 294.

The 'if exists' syntax is not valid in postgres, certainly up to 8.1, which I'm running.
The following CREATE AGGREGATE first() does not give any errors, so I assume the drop is not critical, at least in my case.

Comments

Anonymous’s picture

I saw the same thing exactly. The weird thing is, I can't see the new aggregate in the system, or I'm looking in the wrong place.. so although the CREATE AGGREGATE gave no errors, I can't find it.

Anonymous’s picture

FYI, This error occurred on Postgres 8.1.17

It did not occur for a copy of the database/site running the same update on Postgres 8.3.7. Looks like IF EXISTS is handled ok in 8.3 .

andy_read’s picture

Having looked through the Postgres docs, the "if exists" syntax has been introduced since 8.2, although it does describe this as a non-standard Postgres extension, even for things like "drop table if exists". But for that matter aggregates as a whole are not in the SQL standard.

I'm looking to upgrade my [conservative] Debian server to 8.2 or 8.3, which should improve Postgres compatibility with a number of modules, but can anyone tell me whether there is an agreed policy on which versions of Postgres should be supported? I recall reading somewhere that D7 would require at least 8.2 for some core functionality.

t-om’s picture

Seeing this too on an up-to-date CentOS 5.4 environment when trying to update the Views module from 6.x-2.6 to 6.x-2.8.
Drupal version 6.16.
Postgresql version 8.1.18.

In my case it was very serious, loosing sight of all the dynamic content of the site.

There seemed to be some Postgresql issues also on newer Views versions than 6.x-2.8.

merlinofchaos’s picture

D7 will only support Postgres 8.3 or better. According to the requirements page, Drupal core supports Postgress 7.4 or better. Views theoretically supports what core supports, but to be honest, almost no one has a version of postgres that old to test on. So issues like this are both 1) going to get through and 2) hard to fix.

Letharion’s picture

Status: Active » Closed (fixed)

Hello!

I'm cleaning up the Views issue queue, and thus trying to close open support requests that have had no activity in the past 6 months or more. If this is still a relevant please reset the status to active, and the new bug squad will make an attempt at the problem.