#31304: PostgreSQL full-text search employs coalesce function for non-null 
single-
column searches with SearchVector
-------------------------------------+-------------------------------------
     Reporter:  Paul Boddie          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  2.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  PostgreSQL text      |             Triage Stage:  Accepted
  search FTS coalesce SearchVector   |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Paul Boddie):

 Thanks for the comment, Simon.

 I wouldn't expect to_tsvector to treat an empty string and null in the
 same way - this being SQL after all - but the aim would be to avoid
 coalesce where null could never occur. This then becomes an issue of
 knowing when this might be guaranteed.

 I'm still getting familiar with the ORM, but I imagine that there could
 easily be cases where column values are null even if the table columns are
 declared not null. For instance, any query involving an outer join could
 produce null values for a "not null" column. In such cases, the
 characteristics of the output column would need to be defined by
 identifying its role in the query, pretty much as you say.

 I am inclined to think that making my own lookup would be the safest thing
 to do for now, with the lookups provided also considering the issue of
 transferring the configuration.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31304#comment:7>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.f463cf84d57e6a74cd76170b68fcd502%40djangoproject.com.

Reply via email to