Re: complicated query (newbie..) - Mailing list pgsql-general

From Sam Mason
Subject Re: complicated query (newbie..)
Date
Msg-id 20090409171617.GT12225@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: complicated query (newbie..)  (Marcin Krol <mrkafk@gmail.com>)
Responses Re: complicated query (newbie..)
List pgsql-general
On Thu, Apr 09, 2009 at 07:03:55PM +0200, Marcin Krol wrote:
> - If I quote date values like '2009-04-09' it doesn't work again! I.e.
> result set includes one host id that should have been excluded (bc it
> has reservation whose date doesn't match the condition)

You *need* those quotes in there; you need to figure out what's going on
there first before going any further.  Maybe the reservation dates for
that entry are "confused" for some reason, or you've got the date in the
wrong format or something (i.e. you're expecting dd/mm/yyyy and you're
getting mmm/dd/yyyy or something else).

> - I have replaced OVERLAPS with explicit date condition bc PG complained:
>
> ERROR:  function pg_catalog.overlaps(date, date, integer, integer) does not exist
> HINT:  No function matches the given name and argument types. You may need to add explicit type casts.

This is a big hint that things are going wrong.  You need those quotes
in there, an "integer" is a plain number and not a date.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: complicated query (newbie..)
Next
From: Marcin Krol
Date:
Subject: Re: complicated query (newbie..)