Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpIgE-0006l0-Db for pgsql-general@arkaria.postgresql.org; Thu, 31 Jan 2019 20:11:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpIgD-0006vK-3x for pgsql-general@arkaria.postgresql.org; Thu, 31 Jan 2019 20:11:21 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpIgC-0006sW-Qu for pgsql-general@lists.postgresql.org; Thu, 31 Jan 2019 20:11:20 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpIgA-0000Gm-Sp for pgsql-general@postgresql.org; Thu, 31 Jan 2019 20:11:20 +0000 Received: by mail-ot1-x333.google.com with SMTP id a11so3949952otr.10 for ; Thu, 31 Jan 2019 12:11:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=f5X6yz5UPE944phRubK1RuOy9fIa/Vl1u8/vlbBv50g=; b=SEzAJyQzUiuplu0DN1tWDcMYZ25GT/40VS4L6K3vI2kO/QjYsZIGK4N6xGXyen4yYP o2109VoNzcRlfQC4fxA8LkER4obHeFqaBMGS0cuN3TnOErAUZ8kOYIddzrvleuCXKL1I Yd0CEs179oaVamxjUXtv9Q5E7jTZUWwBKRMlTIhtjZhK2tnES4o1PfIJNrAilJvxfQJh 2j3LiDC6EAUm9NbUec7Lhq5GSDTbGDmP8yA77ozyRNXZ4s7EMRP2cmk5zg0aAIiQuIIB VMWJFIu32EV59sAXX1vcHSbaPnHO85j6Chj9K9a9UkqGwIBg8I8qiJWNGq0NB9sLuBFM ivAg== 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-transfer-encoding:content-language; bh=f5X6yz5UPE944phRubK1RuOy9fIa/Vl1u8/vlbBv50g=; b=RAZ7ssmDTTZbg8Dm9aM842fYjmDGGdPEVhtDTs97JRUPxowLobR8tqjyvQZ6DQVoeq OY8NiR0X66DoFrxsK3RVs9znSL82rR2ptGTRtOYPyIzhhKXK4O0gNq6UE9ig1rzHws5e 9uecG3W6Ng5H4Ucefrq8UdwIuRYdkGL9l6+uzZvlepeBBSd/+bhJe4grIywF2ZB8zy1/ AgOZ6q+wjAQQ0+2ehb3A+uiGWCyIE0E4hLydJmKTccC7C7oq+yuwwrGAWNZwX2EmURhB x0PfTVCH4JWLjwTalztn7fYEti9Z4wxyewZq/MmZ+QHxWEzDT7zDdMAb+5wmtoZSLvBk vTyQ== X-Gm-Message-State: AHQUAubtfyzJT/6fHB2WjxMQyOY6CKP9Bx1TGe6fyWJUYEg73B3wYN0T lV/iQEWWGhsHgvt4Qo0NXH4KYvIc X-Google-Smtp-Source: AHgI3Ia0Ymceet1jeuvLEUVKJ1Ro0prr8gbkwY3PPntvAt7l1WcapxHya96coS0W3wdQ4Bqt55YvFw== X-Received: by 2002:a9d:3bc7:: with SMTP id k65mr113594otc.11.1548965476249; Thu, 31 Jan 2019 12:11:16 -0800 (PST) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id p203sm2608271oic.49.2019.01.31.12.11.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jan 2019 12:11:15 -0800 (PST) To: pgsql-general@postgresql.org From: Ron Subject: Date calculation Message-ID: Date: Thu, 31 Jan 2019 14:11:14 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, v9.6.6 Is there a built in function to calculate, for example, next Sunday? For example, postgres=# select current_date, next_dow(current_date, 'Sunday');     date    |    date ------------|------------  2019-01-31 | 2019-02-03 (1 row) Thanks -- Angular momentum makes the world go 'round.