title: operator is not unique. Could not choose a best candidate operator. You might need to add explicit type casts
body: <p>I have this query that just selects the difference between two dates:</p>
  
  <pre><code>select date_part('day', 'toDate' - 'fromDate') from "Reservation" where "reservationID" = 1;
  </code></pre>
  
  <p>but this is giving me this error:</p>
  
  <blockquote>
    <p>operator is not unique. Could not choose a best candidate operator.
    You might need to add explicit type casts.</p>
  </blockquote>
  
  <p>How can I fix this?</p>
  
  <p>P.S. This is how I created "Reservations" table:</p>
  
  <pre><code>CREATE TABLE "Reservation"
  (
    "reservationID" serial NOT NULL,
    "fromDate" timestamp without time zone NOT NULL DEFAULT '-  infinity'::timestamp without time zone,
    "toDate" timestamp without time zone NOT NULL DEFAULT '-infinity'::timestamp without time zone,
    "staffID" integer NOT NULL DEFAULT 0,
    "customerID" integer NOT NULL DEFAULT 0,
    "roomID" integer NOT NULL DEFAULT 0,
    CONSTRAINT "PK_public.Reservation" PRIMARY KEY ("reservationID"),
    CONSTRAINT "FK_public.Reservation_public.Customer_customerID" FOREIGN KEY    ("customerID")
    REFERENCES "Customer" ("customerID") MATCH SIMPLE
    ON UPDATE NO ACTION ON DELETE CASCADE,
    CONSTRAINT "FK_public.Reservation_public.Room_roomID" FOREIGN KEY ("roomID")
    REFERENCES "Room" ("roomID") MATCH SIMPLE
    ON UPDATE NO ACTION ON DELETE CASCADE,
    CONSTRAINT "FK_public.Reservation_public.Staff_staffID" FOREIGN KEY ("staffID")
    REFERENCES "Staff" ("staffID") MATCH SIMPLE
    ON UPDATE NO ACTION ON DELETE CASCADE
  )
  </code></pre>