Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
8 Apr 2010 at 08:30 UTC
Updated:
27 Apr 2010 at 17:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
AlexisWilke commentedP.S. my other server has PostgreSQL 8.3.9, that's the one that works properly and accepts the CAST() as is.
Comment #2
dawehnerhttp://drupal.org/node/765236
Is this so hard to find?
Comment #3
dawehnerSorry, for my behavior.
I'm not sure, whether its the same problem for pgsql and for mysql.
Comment #4
javiarauz commentedSame two errors on pgsql 8.2.16
Greetings,
Javier
Comment #5
dawehnerlets mark this as duplicate of the other issue.
I think its the same.
Comment #6
AlexisWilke commentedThe following works a lot better for my old PostgreSQL server:
Thank you.
Alexis
Comment #7
dawehnerIt should be just be done with non-sql stuff.
Comment #8
merlinofchaos commentedOk, this integrates #6 into a patch that checks for pgsql and uses that code instead. Needs urgent testing.
Comment #9
dave reidIs this someplace we should use http://api.drupal.org/api/function/db_change_column/6 instead of db_change_field() since it has extras for PostgreSQL?
Comment #10
merlinofchaos commentedNot according to comments by the pgsql maintainer on http://api.drupal.org/api/function/db_change_field/head
Comment #11
dave reidIt has usefulness in a Pgsql-only context for exactly this purpose it seems. Otherwise yes, db_dchange_field() should always be used.
Comment #12
merlinofchaos commentedWell. I would need someone with pgsql to help with this. As soon as possible. We have to get this fix out before more pgsql users get their data destroyed.
Comment #13
merlinofchaos commentedCommitted and hoping for the best.
Comment #14
AlexisWilke commenteddereine,
I'm seeing your answers now... 8-) I don't think that it was the same as that other issue. The other issue talked about the PRIMARY KEY, whereas this one is the CAST that creates a problem. (P.S. I had not even noticed that you marked the issue as a duplicate until now!)
I tried the equivalent of db_change_column() in one of my database and it does not work.
ERROR: column "display_options" is of type text but expression is of type byteaThank you for the quick fix Merlin. I hope my fix helped you well. 8-)
I wasn't sure whether you'd want to use a condition or use that code for MySQL as well. It would work for both, although a little slower, it's just for the views definitions so it is relatively limited!
Thank you.
Alexis
Comment #15
gmh04 commentedHi
I use postgres 8.1 and had the problem upgrading to 6.x-2.9. I restored the display_options table from backup (not the whole site as the backup it was 10 hours old) and installed the 6.x-2.10. The update went well but when I went into the modules page I got the following error:
* warning: Invalid argument supplied for foreach() in /disk/mirror-0/homes/aqmen/distributions/aqmen/modules/views/includes/view.inc on line 1747.
* warning: Invalid argument supplied for foreach() in /disk/mirror-0/homes/aqmen/distributions/aqmen/modules/views/includes/view.inc on line 1747.
* warning: Invalid argument supplied for foreach() in /disk/mirror-0/homes/aqmen/distributions/aqmen/modules/views/includes/view.inc on line 1747.
* warning: Invalid argument supplied for foreach() in /disk/mirror-0/homes/aqmen/distributions/aqmen/modules/views/includes/view.inc on line 1747.
* warning: Invalid argument supplied for foreach() in /disk/mirror-0/homes/aqmen/distributions/aqmen/modules/views/includes/view.inc on line 1747.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near ")" at character 43 in /disk/mirror-0/homes/aqmen/distributions/drupal-6.16/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT * FROM views_display WHERE vid IN () ORDER BY vid, position in /disk/mirror-0/homes/aqmen/distributions/aqmen/modules/views/includes/view.inc on line 1369.
I re-enabled the view module and my views were restored and everything seems to be fine. This error nagging me however.
Thanks for the quick patch!
George
Comment #16
merlinofchaos commentedI've seen that error, it usually means bad cached schema. Try flushing cache?
Comment #17
almalino commentedFor you information. I have similar issue as in comment #15 for MySQL database. I created a separate bug report for it since it is different from original bug in this thread.
http://drupal.org/node/769780
Clearing cache didn't help.
Comment #18
AlexisWilke commentedMerlin,
I just noticed that you switched this issue from 3.x to 2.x... I have 3.x and it failed in 3.x (and probably it would do so in 2.x too.)
I just hope that you'll also fix 3.x! 8-)
Thank you.
Alexis
Comment #19
merlinofchaos commentedAny fixes in 2.x will always go forward into 3.x and beyond. I committed this in both branches.