Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2hQ5-0005YA-F8 for pgsql-general@arkaria.postgresql.org; Thu, 21 Jan 2021 21:23:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2hQ4-0002an-7n for pgsql-general@arkaria.postgresql.org; Thu, 21 Jan 2021 21:23:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2hPz-0002af-Oo for pgsql-general@lists.postgresql.org; Thu, 21 Jan 2021 21:23:07 +0000 Received: from mx32.harte-lyne.ca ([216.185.71.32]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2hPx-0003jQ-7f for pgsql-general@lists.postgresql.org; Thu, 21 Jan 2021 21:23:02 +0000 Received: from mx32.harte-lyne.ca (localhost [127.0.32.1]) by mx32.harte-lyne.ca (Postfix) with ESMTP id 585DE5E2E9 for ; Thu, 21 Jan 2021 16:22:58 -0500 (EST) X-Virus-Scanned: amavisd-new at harte-lyne.ca Received: from mx32.harte-lyne.ca ([127.0.32.1]) by mx32.harte-lyne.ca (mx32.harte-lyne.ca [127.0.32.1]) (amavisd-new, port 10024) with ESMTP id GQYKD8Caq5PL for ; Thu, 21 Jan 2021 16:22:56 -0500 (EST) Received: from webmail.harte-lyne.ca (webmail.hamilton.harte-lyne.ca [216.185.71.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx32.harte-lyne.ca (Postfix) with ESMTPSA id 805615E2DE for ; Thu, 21 Jan 2021 16:22:56 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=harte-lyne.ca; s=dkim_hll; t=1611264176; bh=v+KO0+eINTxQwQmu0qLx5+ydgRBUYFOmPvkR/c48FlI=; h=Date:Subject:From:To:Reply-To; b=C7SKq6V3JrtK1dQn5ko7B9F/zLrnRyQEnSETL6iRMbaNK0MzgufNEqD5OpgvBLrFO ifcO0CcKAOaEeOUELj+4FNwBfsHzJ7KLfHF7lAgn6laOUZ+OHne/HV+QVWo8+I52Ih 3p1dZuoBlK3c+vJMLyOHmAMy7xd0jDfPmEp/KorDMEwynu6lrFdkAd++jaOIpVqgQU T+s3DlFzLBcICIAE2+Mm3g5ao8U+wCx/ExtQ656j1nXmta7+DyLsXA5O8auCFU5Asc yo1a9InG9r5cQ91jAAeYQiHQ+zayqlYgAn+gm3Ta0K6DU49uD1L7aDQuojg9Erz/Fp CBfKQgzAQjzZA== Received: from 216.185.71.41 (SquirrelMail authenticated user byrnejb_hll) by webmail.harte-lyne.ca with HTTP; Thu, 21 Jan 2021 16:22:56 -0500 Message-ID: <0c229ba17fe7eb51223ebd8bb90cdfff.squirrel@webmail.harte-lyne.ca> Date: Thu, 21 Jan 2021 16:22:56 -0500 Subject: interval data type From: "James B. Byrne" To: pgsql-general@lists.postgresql.org Reply-To: byrnejb@harte-lyne.ca User-Agent: SquirrelMail/1.4.23 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk What is the difference between interval(3)[] and simply interval(3)? Where in the documentation is the [] syntax discussed? This question arises only because I am trying to map an Informix database column defined as lead_time INTERVAL DAY(3) TO DAY to an equivalent PostgreSQL datatype. I got this to work with: ADD COLUMN lead_time interval day; and also with: ADD COLUMN lead_time interval(3); but I do not understand what these mean frankly. Does the form 'interval(3) imply a field value of SECOND? As a side note: The use of of the word 'fields' in the manual discussion regarding interval is, to me, misleading in that only one 'field' value is permitted. "The interval type has an additional option, which is to restrict the set of stored fields by writing one of these phrases: . . . Note that if both fields and p are specified, the fields must include SECOND, since the precision applies only to the seconds." The manual says 'one of these phrases'; but then uses the word "fields" together with the word "includes" and thereby implies that multiple selections are permitted. Given the brevity of the exposition this initially confused me. Are there other types of 'fields' that may be used with interval that are not given? I could not find a definition of 'sectored fields' in the manual. What is its meaning? Also I do not understand under what circumstance one would use the interval type in place of a simple integer. If someone would be kind enough to explain these things to me I would be appreciative. Regards, -- *** e-Mail is NOT a SECURE channel *** Do NOT transmit sensitive data via e-Mail Unencrypted messages have no legal claim to privacy Do NOT open attachments nor follow links sent by e-Mail James B. Byrne mailto:ByrneJB@Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3