Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 78D3A2E0049 for ; Thu, 24 Apr 2008 12:16:16 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 77346-09 for ; Thu, 24 Apr 2008 12:16:09 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by developer.postgresql.org (Postfix) with ESMTP id 329232E0048 for ; Thu, 24 Apr 2008 12:16:08 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id j3so736538ugf.49 for ; Thu, 24 Apr 2008 08:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=zijM8bHo8ryYL4/ffdrwLHkcljFJ8PiuBbPC1bptbSg=; b=FNAs3betg56eCtm8ARpnqaPXIU9Km6m2AF0C1gnm4Io4QYmaqvZkNPQpVkGWQsdhqoDCU2BrotTSC+sVIawdSixYfQtACZyTT1it5+ZcQIskjpj0KEaXsES4spSy57CzdiOigVfezMAI+KV6Z9DlzQLGqEPftFaGLtV76xYxKxI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WR57kN8dRnf6tu9IGFdA1lbwtRzMXVr4p5kDb5dqiHlBLnT2cxo7iu1Z4zf7K/hSM9unHgt1Rm8+keyHibzgkZj2QRHOek0Bq0aSx/xztF5uYGwFNpnXtw1wxPS/0H+hTOyv1B5zqqnMc5PAxPuySZGyyxrBJ0Niw67ykV68NBA= Received: by 10.114.161.11 with SMTP id j11mr793660wae.13.1209050166566; Thu, 24 Apr 2008 08:16:06 -0700 (PDT) Received: by 10.114.137.7 with HTTP; Thu, 24 Apr 2008 08:16:01 -0700 (PDT) Message-ID: Date: Thu, 24 Apr 2008 09:16:01 -0600 From: "Scott Marlowe" To: "Fernando Hevia" Subject: Re: First day of month, last day of month Cc: pgsql-sql@postgresql.org In-Reply-To: <023b01c8a61d$5855cea0$8f01010a@iptel.com.ar> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <481085D1.2010807@sympatico.ca> <48108813.6070401@sympatico.ca> <481095FB.7090600@denterprises.org> <023b01c8a61d$5855cea0$8f01010a@iptel.com.ar> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/168 X-Sequence-Number: 30707 On Thu, Apr 24, 2008 at 9:10 AM, Fernando Hevia wrote: > > De: pgsql-sql-owner@postgresql.org > > [mailto:pgsql-sql-owner@postgresql.org] En nombre de Scott Marlowe > > > > > Then you can just use date_trunc on the values in the > > database. Plus if you're using timestamp WITHOUT timezone, > > you can index on it. > > > > Did not understand this. Are you saying timestamps WITH timezone are NOT > indexable or you mean that you cant build a partial index on a > timestamp-with-time-zone returning function? Correct, timestamptz or timestamp with timezone (timestamptz is the shorter alias) are not indexable because functions in an index must be immutable, and date_trunc on a timestamptz is not.