﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6523	PostgreSQL 8.3 cannot do text matching on uncast non-text columns	pat.j.anderson@…	Malcolm Tredinnick	"I have just created my few models and connected my django apps to PostgreSQL 8.3 beta2 on my Fedora 8 server. When I try to create a new record I receive this error:

{{{
Environment:

Request Method: POST
Request URL: http://localhost:8001/admin/publications/publication/add/
Django Version: 0.97-pre-SVN-7047
Python Version: 2.5.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'activemembers.apps.publications',
 'activemembers.apps.world',
 'django.contrib.sites',
 'django.contrib.markup',
 'django.contrib.humanize',
 'django.contrib.admin',
 'tagging',
 'template_utils',
]
Installed Middleware:
('django.middleware.cache.CacheMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.gzip.GZipMiddleware'
)


Traceback:
File ""/usr/lib/python2.5/site-packages/django/core/handlers/base.py"" in get_response
  82.                 response = callback(request, *callback_args, **callback_kwargs)
File ""/usr/lib/python2.5/site-packages/django/contrib/admin/views/decorators.py"" in _checklogin
  56.             return view_func(request, *args, **kwargs)
File ""/usr/lib/python2.5/site-packages/django/views/decorators/cache.py"" in _wrapped_view_func
  39.         response = view_func(request, *args, **kwargs)
File ""/usr/lib/python2.5/site-packages/django/contrib/admin/views/main.py"" in add_stage
  260.         errors = manipulator.get_validation_errors(new_data)
File ""/usr/lib/python2.5/site-packages/django/oldforms/__init__.py"" in get_validation_errors
  62.             errors.update(field.get_validation_errors(new_data))
File ""/usr/lib/python2.5/site-packages/django/oldforms/__init__.py"" in get_validation_errors
  379.                     self.run_validator(new_data, validator)
File ""/usr/lib/python2.5/site-packages/django/oldforms/__init__.py"" in run_validator
  369.                 validator(new_data.get(self.field_name, ''), new_data)
File ""/usr/lib/python2.5/site-packages/django/utils/functional.py"" in _curried
  3.         return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
File ""/usr/lib/python2.5/site-packages/django/db/models/manipulators.py"" in manipulator_validator_unique_together
  302.         old_obj = self.manager.get(**kwargs)
File ""/usr/lib/python2.5/site-packages/django/db/models/manager.py"" in get
  69.         return self.get_query_set().get(*args, **kwargs)
File ""/usr/lib/python2.5/site-packages/django/db/models/query.py"" in get
  261.         obj_list = list(clone)
File ""/usr/lib/python2.5/site-packages/django/db/models/query.py"" in __iter__
  114.         return iter(self._get_data())
File ""/usr/lib/python2.5/site-packages/django/db/models/query.py"" in _get_data
  483.             self._result_cache = list(self.iterator())
File ""/usr/lib/python2.5/site-packages/django/db/models/query.py"" in iterator
  189.         cursor.execute(""SELECT "" + (self._distinct and ""DISTINCT "" or """") + "","".join(select) + sql, params)
File ""/usr/lib/python2.5/site-packages/django/db/backends/util.py"" in execute
  18.             return self.cursor.execute(sql, params)

Exception Type: ProgrammingError at /admin/publications/publication/add/
Exception Value: operator does not exist: integer ~~* unknown
LINE 1: ....1' AND ""publications_publication__language"".""id"" ILIKE '3')
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

}}}

I think this is related to ticket:6210. I have a foreign key relation to Language in my Publication model and it is combined with another field in my Publication model in 'unique_together' attribute in its Meta class.

I'm posting the traceback here, because this is the best way I can describe the problem. The person who closed ticket:6210, might have had a reason for it, but I wonder if it is worth looking into.

I'd like to use PostgreSQL with Django, I really do, but this kind of error scares me and I think I'd have to live with MySQL, which worked."		closed	Database layer (models, ORM)	1.0-beta		fixed	postgresql	rene.puls@… ryan@… v.oostveen@… johannes.beigel@… peter.kese@… dan.fairs@… real.human@… bonelake@… andrehcampos@…	Unreviewed	1	0	0	0	0	0
