Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMqcJ-0002Do-6C for pgsql-performance@postgresql.org; Sat, 13 Oct 2012 01:34:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMqcE-0006oD-9C for pgsql-performance@postgresql.org; Sat, 13 Oct 2012 01:34:14 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q9D1Y9Um027830; Fri, 12 Oct 2012 21:34:09 -0400 (EDT) From: Tom Lane To: "Anibal David Acosta" cc: pgsql-performance@postgresql.org Subject: Re: Do cast affects index usage? In-reply-to: <000001cda8d9$913a7770$b3af6650$@devshock.com> References: <004301cda8b4$fdc57bd0$f9507370$@devshock.com> <21823.1350074311@sss.pgh.pa.us> <000001cda8d9$913a7770$b3af6650$@devshock.com> Comments: In-reply-to "Anibal David Acosta" message dated "Fri, 12 Oct 2012 21:27:42 -0300" Date: Fri, 12 Oct 2012 21:34:08 -0400 Message-ID: <27829.1350092048@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201210/172 X-Sequence-Number: 48131 "Anibal David Acosta" writes: > Because I need to get all rows where datetime is greater than (for example) > '2012-10-10 00:00:00' but ignoring timezone, so basically I need to truncate > timezone > This can be done by converting to timestamp without timezone. [ shrug... ] It can also be done without that. Whatever your cutoff time is can be expressed as a timestamp *with* tz. regards, tom lane