← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 600964] Re: using "search" orm method querying uppercase columns, produces PostgreSQL error "column TABLE.COLUMN does not exist"

 

For the record,  the relevant trunk server revision is r.3619 revid:
odo@xxxxxxxxxxx-20110919201845-heer0rttcouvtc9x

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/600964

Title:
  using "search" orm method querying uppercase columns, produces
  PostgreSQL error "column TABLE.COLUMN does not exist"

Status in OpenERP Server:
  Fix Released

Bug description:
  Using upper case field name causes PostgreSQL error while searching
  it.

  For instance, if you create a new object "custom.object" with an integer field "FIELD" and try searching it with
  self.pool.get('custom.object').search(cr, uid, [('FIELD', '=', 1)])
  PostgreSQL will tell "ERROR:  column custom_object.field does not exist".

  According to PostgreSQL documentation
  http://www.postgresql.org/docs/8.4/static/sql-syntax-lexical.html ,
  "unquoted names are always folded to lower case. For example, the
  identifiers FOO, foo, and "foo" are considered the same by PostgreSQL,
  but "Foo"  and "FOO" are different from these three and each other"

  By first analysis, I solved modifying the "__leaf_to_sql" method of "expression" class ( http://bazaar.launchpad.net/~openerp/openobject-server/trunk/annotate/2458/bin/osv/expression.py#L342 ) replacing every
  %s.%s
  with
  "%s"."%s"

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/600964/+subscriptions