Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ejsko-000240-UA for pgsql-general@arkaria.postgresql.org; Thu, 08 Feb 2018 20:25:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejskn-00007O-KY for pgsql-general@arkaria.postgresql.org; Thu, 08 Feb 2018 20:25:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ejskn-000076-8x for pgsql-general@lists.postgresql.org; Thu, 08 Feb 2018 20:25:09 +0000 Received: from mail-it0-x243.google.com ([2607:f8b0:4001:c0b::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ejskf-0003WG-KK for pgsql-general@postgresql.org; Thu, 08 Feb 2018 20:25:08 +0000 Received: by mail-it0-x243.google.com with SMTP id p139so8139453itb.1 for ; Thu, 08 Feb 2018 12:25:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lucee-org.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=vntOKO32hlCn+n4OWBdpRt29Bu5qYMZHKJGMgi65xpk=; b=bwNR0zpzk4SOtZJ3RmfIXEowxRN4+YSgftuUafvp8AIR1N3xgDmvN90Eo6JQvEdlI4 ju1MuUGAW6X9ZuJtyyOu+5Gz+2JBbnvolR1hZ4GJFWMQSV5t3zImZqYBYPGC1wjkhR5L xRcF/LWW+cVi3yaqZcfnbcpmM7HZD+mwYwLgDlnOiXhjF7f7B3jAsjddqviJ4WT7DRiR HrLFMQaMP3kl1q2khidK+CAj3TFfGu22cJibhfPK7pc4R4CLlhPZ6z8Vz87xyYFNaPIZ mUAmhGU2mmoStwpahunDwQPM9JvJoPCHFo8MSRJdKHX0W88I7FKPddnseb3HYtD3pakz yzWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=vntOKO32hlCn+n4OWBdpRt29Bu5qYMZHKJGMgi65xpk=; b=STOs6M+25Mgg2MZGxpGN8aJAsYSE3Cnm6JHd2Opx9J/5aIKdaWsuVipK8krPZfy3g0 U69Di6zXyZEXZ3eikMFqsRIq1E+bIZc9B8g2mWNN/l5cuFQDOwftHPEthXxvsjHnxJPZ QRmFDOKwrBKP6tMpuGt0aYhK/Wv6swf7XdOiP4Loq8udcUJXHzsUrbfH02IzZuDGrvy1 6nQ+PRvP7SXVJB5u4sSDUWECCD5tlIAynMqfvF3X9IGtqcjJFY3m+3tKOVsvagWGTcan 3TQaAltAvk1Y2YjPcs9EPX1dPNGcrj2SjQF1rvgM/lyvWhx94tcUad+UwPSHjAzNys1/ vycA== X-Gm-Message-State: APf1xPBQbPm+OI3R2xiGENBG8P4EfBnTxXUTVH+3uXkiZ8etBDYxnlM+ LLeP4XKv/sIsPzZQbMJ7iSsmUWcQ X-Google-Smtp-Source: AH8x227D1Y7gqBgrqAAUSWMm88VXJwzGseLVh/XMJLmEewYXl84s6ewGRlhnUUDbGGH0LLFi+n8MNw== X-Received: by 10.36.121.5 with SMTP id z5mr540012itc.146.1518121498280; Thu, 08 Feb 2018 12:24:58 -0800 (PST) Received: from [192.168.1.15] (45-19-167-161.lightspeed.irvnca.sbcglobal.net. [45.19.167.161]) by smtp.googlemail.com with ESMTPSA id w6sm575132itc.5.2018.02.08.12.24.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 12:24:56 -0800 (PST) To: pgsql-general From: "Igal @ Lucee.org" Subject: DOW is 0-based? Message-ID: <860b4e3a-b157-8a70-8a5b-deb4a61e1494@lucee.org> Date: Thu, 8 Feb 2018 12:24:54 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------2AC58B60A8FF15A6B08F368A" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------2AC58B60A8FF15A6B08F368A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Is there a rational reason why Day of the Week is 0-based, i.e. Sunday (0) to Saturday (6) instead of the more intuitive Sunday (1) to Saturday (7)?     SELECT date_part('dow', current_date); https://www.postgresql.org/docs/current/static/functions-datetime.html Thanks, Igal Sapir Lucee Core Developer Lucee.org --------------2AC58B60A8FF15A6B08F368A Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Is there a rational reason why Day of the Week is 0-based, i.e. Sunday (0) to Saturday (6) instead of the more intuitive Sunday (1) to Saturday (7)?

    SELECT date_part('dow', current_date);

https://www.postgresql.org/docs/current/static/functions-datetime.html

Thanks,

Igal Sapir
Lucee Core Developer
Lucee.org

--------------2AC58B60A8FF15A6B08F368A--