Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qp7C1-004Nyf-L1 for pgsql-novice@arkaria.postgresql.org; Sat, 07 Oct 2023 13:18:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qp7By-00HATv-Gi for pgsql-novice@arkaria.postgresql.org; Sat, 07 Oct 2023 13:18:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qp6wl-00H71G-5I for pgsql-novice@lists.postgresql.org; Sat, 07 Oct 2023 13:02:20 +0000 Received: from mail-ed1-f54.google.com ([209.85.208.54]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qp6wh-000TUp-U7 for pgsql-novice@lists.postgresql.org; Sat, 07 Oct 2023 13:02:18 +0000 Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-53b32dca0bfso3110436a12.0 for ; Sat, 07 Oct 2023 06:02:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696683734; x=1697288534; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RH+Of7BnHIxyuawmuDhln4VakaW3aLaRfD2Pou8nTS4=; b=HoJUrIVmrjHTij9wTXaGT/BzBVtklS/FCeZSIj/fvXawpfgP+iSi2Vfqc2lWG0ci2C 6GIuajMBCwT8mZoKC70NYt4K7d+ZVyfjSD+KMuQ6UlzXb7O5iuN0mRKzo0d0TPU50ymg U4kimbSkTw+qrlwoC8G6N+MyVHEJS2ZfnVmu9u6q2pcjKayDlPIlwNuy+8j/Godt75ph XddtfWrmgh8vUkG9QzTH3QF3S59VdBbi3cwwlC0BVO7xZJD+taZhVsB8UptuQi39jwSy 6DolZmncnINemzVNBKTNkuKuq4lnOfQqPlvojoi9mbXR+KbhXxtF92JQpmLMTNO/0xvt jJhA== X-Gm-Message-State: AOJu0Yx0bDMJfmKb/NY2dphgG4H3poxJv1kT1huAvUrKt1ARrmaUp4s0 JOIhhGbqHOR8INR2Iiyfq/xQFnOLKb37oslr X-Google-Smtp-Source: AGHT+IHtqbN/QECTlKwrrPLrojJ6fcIUZDJWc9PYX/9Eye+FuCKNFwyfzOVRSVjoQ/CTP2MwXSenuQ== X-Received: by 2002:a05:6402:1e8e:b0:533:5d3d:7efe with SMTP id f14-20020a0564021e8e00b005335d3d7efemr5823971edf.6.1696683733548; Sat, 07 Oct 2023 06:02:13 -0700 (PDT) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com. [209.85.128.49]) by smtp.gmail.com with ESMTPSA id i13-20020a056402054d00b005231e3d89efsm3848323edx.31.2023.10.07.06.02.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Oct 2023 06:02:13 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-405505b07dfso24616105e9.0 for ; Sat, 07 Oct 2023 06:02:12 -0700 (PDT) X-Received: by 2002:a5d:5c07:0:b0:31f:d50e:a14f with SMTP id cc7-20020a5d5c07000000b0031fd50ea14fmr8871904wrb.10.1696683732096; Sat, 07 Oct 2023 06:02:12 -0700 (PDT) MIME-Version: 1.0 From: jinser Date: Sat, 7 Oct 2023 21:01:59 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Is `DATE` a function? To: pgsql-novice@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, Friends, Use it like a normal function: playground=# SELECT DATE(); ERROR: function date() does not exist LINE 1: SELECT DATE(); ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. playground=# SELECT DATE('2022-01-13'); date ------------ 2022-01-13 (1 row) Another reason I think this is a function is that other types don't seem to have the same behavior: playground=# SELECT integer('123'); ERROR: syntax error at or near "(" LINE 1: SELECT integer('123'); ^ The Table 9.33. Date/Time Functions in the documentation (https://www.postgresql.org/docs/16/functions-datetime.html#FUNCTIONS-DATETIME-TABLE) doesn't mention this... If I missed it, where should I find the description? Or maybe it actually should be in this table? Thanks in advance.