Re: complicated query (newbie..)

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: complicated query (newbie..)
Date: 2009-04-09 17:16:17
Message-ID: 20090409171617.GT12225@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marcin Krol 2009-04-09 17:25:42 Re: complicated query (newbie..)
Previous Message Raymond O'Donnell 2009-04-09 17:11:48 Re: complicated query (newbie..)