Tom Lane wrote:
>
> David Link <dlink@soundscan.com> writes:
> > This frag returns a bogus date when column value is null:
> > to_char(to_date (theatre_reldate, 'DDMMYYYY'), 'DD Mon YYYY')
>
> Uh, what's bogus about it? I get a NULL result.
The data in my column was bogus and not of the form 'DDMMYYYY'. Sorry
Tom, my mistake. Actually, it was of the form YYYY and it was causing
the query to blow up with:
psql:show_title.sql:13: pqReadData() -- backend closed the channel
unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
psql:show_title.sql:13: connection to server was lost
>
> > So I'm looking for something of this sort:
> > (case when not is null (t.theatre_reldate) then
>
> It's spelled "something IS NULL" or "something IS NOT NULL".
>
Thanks, I had trouble finding this in the on-line manuals. I couldn't
find it in Chapter 4 of the User Guide, Functions and Operators.
-David