FYI, I get this one with PostgreSQL when updating from 2.2 to 2.3

  • warning: pg_query() [function.pg-query]: Query failed: ERROR: column "data" is of type text but expression is of type bytea LINE 1: UPDATE views_object_cache SET data = data_old ^ HINT: You will need to rewrite or cast the expression. in /usr/clients/www_html/new.m2osw.com/public_html/includes/database.pgsql.inc on line 139.
  • user warning: query: UPDATE views_object_cache SET data = data_old in /usr/clients/www_html/new.m2osw.com/public_html/includes/database.pgsql.inc on line 918.

I have no clue how you can change a bytea into a text so here we are. Although this is not too serious since only the cache is affected... What I would suggest is that you just drop the cache (DELETE FROM views_object_cache) then ALTER the type of the data column and be done with it.

Thank you.
Alexis Wilke

Comments

tuxave’s picture

This threw me for a loop as well. At first I thought that the column was supposed to be bytea after the module update, but a quick view of the code suggest the new type is text. I confirmed my back shows the column to be bytea.

I suspect this is either a bug in the database.pgsql.inc file or the views module makes a wrong assumption about casting data under these circumstances.

sammys’s picture

Assigned: Unassigned » sammys
Status: Active » Postponed (maintainer needs more info)

Thanks for posting the issue. I can't replicate the bug with D6 6.9 and PostgreSQL 8.3. What version are your D6/PostgreSQL at?

We might need to move this to be a core issue (my realm).

AlexisWilke’s picture

Status: Postponed (maintainer needs more info) » Active

sammys,

I have 6.9 too.

However, my two servers have PostgreSQL 8.2.

psql (PostgreSQL) 8.2.7
psql (PostgreSQL) 8.2.9

So I guess that is an issue in older versions only.

Thank you.
Alexis Wilke

merlinofchaos’s picture

The problem is line 223 of includes/cache.inc:

  db_query("INSERT INTO {views_object_cache} (sid, obj, name, data, updated) VALUES ('%s', '%s', '%s', %b, %d)", session_id(), $obj, $name, serialize($cache), time());

should be

  db_query("INSERT INTO {views_object_cache} (sid, obj, name, data, updated) VALUES ('%s', '%s', '%s', '%s', %d)", session_id(), $obj, $name, serialize($cache), time());

Can someone with pgsql verify that this fixes the problem?

josh waihi’s picture

Status: Active » Closed (duplicate)

this has been fixed here #373225: views database update warnings on postgresql. Its a core issue that need to be commited

sammys’s picture

This bug is a duplicate of the one in http://drupal.org/node/373225 so i'm marking this as a duplicate. We shall continue this sucker in that issue.