#15586: Fields with missing columns populated when querying on PostgreSQL
-------------------------------------+-------------------------------------
               Reporter:  sebzur     |        Owner:  nobody
                 Status:  reopened   |    Milestone:
              Component:             |      Version:  1.2
  Uncategorized                      |     Keywords:  postgresql
             Resolution:             |    Has patch:  0
           Triage Stage:  Design     |  Needs tests:  0
  decision needed                    |
    Needs documentation:  0          |
Patch needs improvement:  0          |
-------------------------------------+-------------------------------------
Changes (by lrekucki):

 * status:  closed => reopened
 * keywords:   => postgresql
 * resolution:  wontfix =>
 * stage:  Unreviewed => Design decision needed


Comment:

 This is a PostgreSQL related issue. The query looks something like this:
 {{{
 #!sql
 SELECT "ticket15586_mymodel"."id", "ticket15586_mymodel"."name" FROM
 "ticket15586_mymodel"
 }}}

 And with absence of {{{name}}} column on the table, one would expect it to
 fail (and it does on other SQLite). But PostgreSQL seems to let you select
 the table as a ROW object (or something like that - I'm not an expert on
 that). So the following queries are valid:

 {{{
 #!sql
 SELECT "ticket15586_mymodel" FROM "ticket15586_mymodel";
 SELECT "ticket15586_mymodel".name FROM "ticket15586_mymodel";
 SELECT ("ticket15586_mymodel")::name FROM "ticket15586_mymodel";
 }}}

 With the second being treated as the third, which is a type cast. Don't
 know if there is a way to make it unambiguous that we want a table column,
 not some weird type thing. I'm going to reopen, so maybe someone with more
 PostgreSQL-related knowledge can fix this.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15586#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to