Closed (won't fix)
Project:
Drupal core
Version:
4.6.6
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2006 at 20:45 UTC
Updated:
4 Apr 2006 at 00:11 UTC
I was porting over to Postgresql (client requirement) and ran into a rather nasty issue.
Apparently 'cast' is a reserved word in Postgres and you cannot have a field by that name, you can however declare it as long as it is double quoted.
Eg. bad: cast varchar(256),
good: "cast" varchar(256)
However, the problem is that all of the built in Postgres handling for queries do not wrap field names in double quotes.
So all prepared statements involving this table fail in pg_query() with syntax errors as cast is a reserved word.
Workaround is to simply rename the field to something else but cast for example makes sense if your making a node about TV shows, or movies.
Comments
Comment #1
Cvbge commentedHi,
thank you for your report.
I do not see a way to automatically wrap all column names with quotes.
There are a lot of reserved words (in postgres and in mysql and in other databases).
Correct way is, as you said, to rename the fields to something else.
Drupal core does not use 'cast' column name.
Please reassign this bug to the project that uses 'cast' column name.
Comment #2
proxyissues commentedActually this came up during development of a custom module, I have not yet encountered a downloadable module that uses it yet.
So I guess it can be resolved as "won't fix"
Comment #3
chx commentedthere is nothing to fix.