google-code-export / django-hotclub

Automatically exported from code.google.com/p/django-hotclub
MIT License
0 stars 0 forks source link

Swaps break on PostgreSQL #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I installed Pinax and ran it with PostgreSQL (psycopg2) back-end.  When I 
go to /swaps/, I get the following Django error:  

TemplateSyntaxError at /swaps/
Caught an exception while rendering: operator does not exist: character 
varying = integer
LINE 1: ...s" FROM "swaps_offer" WHERE "swaps_offer"."state" = 1  ORDER...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might 
need to add explicit type casts.

Original issue reported on code.google.com by s3x...@gmail.com on 12 Sep 2008 at 11:39

GoogleCodeExporter commented 9 years ago
Confirm this 'errata' on my Debian system with python 2.5.2-11 and 
python-psycopg
2.0.7-4 (plus libapache2-mod-wsgi - 2.3-1). Debug-Exception at bottom. 

Works on OpenBSD 4.3 with python-2.5.2 and py-psycopg2-2.0.6.
(plus added extra port mod_wsgi-2.3)

Debug starts here:
INSERT INTO "crashlog_error" ("class_name", "message", "traceback", "datetime",
"url", "server_name") 
VALUES (E'TemplateSyntaxError', E'Caught an exception while rendering: FEL:  
operator
existerar inte: character varying = integer
LINE 1: ...s" FROM "swaps_offer" WHERE "swaps_offer"."state" = 1  ORDER...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need 
to add
explicit type casts.
', E'Traceback (most recent call last):
  File "/home/bfrost/development/python/django-trunk/django/core/handlers/base.py",
line 86, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File
"/home/bfrost/development/python/django-trunk/django/contrib/auth/decorators.py"
,
line 67, in __call__
    return self.view_func(request, *args, **kwargs)
  File "/home/bfrost/development/python/django-hotclub/external_apps/swaps/views.py",
line 29, in offers
    return render_to_response("swaps/offers.html", {"offers": offers},
context_instance=RequestContext(request))
  File "/home/bfrost/development/python/django-trunk/django/shortcuts/__init__.py",
line 18, in render_to_response
    return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
  File "/home/bfrost/development/python/django-trunk/django/template/loader.py", line
107, in render_to_string
    return t.render(context_instance)
  File "/home/bfrost/development/python/django-trunk/django/template/__init__.py",
line 176, in render
    return self.nodelist.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/__init__.py",
line 768, in render
    bits.append(self.render_node(node, context))
  File "/home/bfrost/development/python/django-trunk/django/template/debug.py", line
71, in render_node
    result = node.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/loader_tags.py",
line 97, in render
    return compiled_parent.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/__init__.py",
line 176, in render
    return self.nodelist.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/__init__.py",
line 768, in render
    bits.append(self.render_node(node, context))
  File "/home/bfrost/development/python/django-trunk/django/template/debug.py", line
71, in render_node
    result = node.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/loader_tags.py",
line 97, in render
    return compiled_parent.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/__init__.py",
line 176, in render
    return self.nodelist.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/__init__.py",
line 768, in render
    bits.append(self.render_node(node, context))
  File "/home/bfrost/development/python/django-trunk/django/template/debug.py", line
71, in render_node
    result = node.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/loader_tags.py",
line 97, in render
    return compiled_parent.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/__init__.py",
line 176, in render
    return self.nodelist.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/__init__.py",
line 768, in render
    bits.append(self.render_node(node, context))
  File "/home/bfrost/development/python/django-trunk/django/template/debug.py", line
71, in render_node
    result = node.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/loader_tags.py",
line 24, in render
    result = self.nodelist.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/__init__.py",
line 768, in render
    bits.append(self.render_node(node, context))
  File "/home/bfrost/development/python/django-trunk/django/template/debug.py", line
81, in render_node
    raise wrapped
TemplateSyntaxError: Caught an exception while rendering: FEL:  operator 
existerar
inte: character varying = integer
LINE 1: ...s" FROM "swaps_offer" WHERE "swaps_offer"."state" = 1  ORDER...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need 
to add
explicit type casts.

Original Traceback (most recent call last):
  File "/home/bfrost/development/python/django-trunk/django/template/debug.py", line
71, in render_node
    result = node.render(context)
  File "/home/bfrost/development/python/django-trunk/django/template/defaulttags.py",
line 244, in render
    if (value and not ifnot) or (ifnot and not value):
  File "/home/bfrost/development/python/django-trunk/django/db/models/query.py", line
185, in __nonzero__
    iter(self).next()
  File "/home/bfrost/development/python/django-trunk/django/db/models/query.py", line
179, in _result_iter
    self._fill_cache()
  File "/home/bfrost/development/python/django-trunk/django/db/models/query.py", line
612, in _fill_cache
    self._result_cache.append(self._iter.next())
  File "/home/bfrost/development/python/django-trunk/django/db/models/query.py", line
269, in iterator
    for row in self.query.results_iter():
  File "/home/bfrost/development/python/django-trunk/django/db/models/sql/query.py",
line 206, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/home/bfrost/development/python/django-trunk/django/db/models/sql/query.py",
line 1724, in execute_sql
    cursor.execute(sql, params)
  File "/home/bfrost/development/python/django-trunk/django/db/backends/util.py",
line 19, in execute
    return self.cursor.execute(sql, params)
ProgrammingError: FEL:  operator existerar inte: character varying = integer
LINE 1: ...s" FROM "swaps_offer" WHERE "swaps_offer"."state" = 1  ORDER...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need 
to add
explicit type casts.

', E'2008-10-01 14:58:48.396480', E'http://www.pinax.local/swaps/', E'universe')

Original comment by bengtfr...@gmail.com on 1 Oct 2008 at 2:36

GoogleCodeExporter commented 9 years ago
I think this should be moved to Django proper.  This seems like a lower level 
problem
than Pinax.

Original comment by arocki...@gmail.com on 23 Oct 2008 at 8:47

GoogleCodeExporter commented 9 years ago
Can't reproduce this.

Original comment by jtau...@gmail.com on 27 Oct 2008 at 10:55

GoogleCodeExporter commented 9 years ago
I have same error with latest django-trunk (rev. 9699), pinax (rev. 1306 ) and
PostgreSQL 8.3.5 on Ubuntu.

Original comment by kit1980 on 4 Jan 2009 at 1:06

GoogleCodeExporter commented 9 years ago
I think I've fixed it. The problem was that field 'state' was declared in the 
model
like "Char", but was used everywhere like integer.

I'll propose patch to the http://django-social-economics.googlecode.com/

Original comment by kit1980 on 4 Jan 2009 at 1:25

GoogleCodeExporter commented 9 years ago
Indeed this is specific to 8.3.

Original comment by bros...@gmail.com on 8 Feb 2009 at 7:25

GoogleCodeExporter commented 9 years ago

Original comment by pyDanny on 13 Mar 2009 at 3:42

GoogleCodeExporter commented 9 years ago
Moved to code.pinaxproject.com

Original comment by pyDanny on 31 Mar 2009 at 1:42

GoogleCodeExporter commented 9 years ago

Original comment by pyDanny on 31 Mar 2009 at 2:40