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 1t3atj-00DTRq-Pr for pgsql-general@arkaria.postgresql.org; Wed, 23 Oct 2024 12:55:35 +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 1t3ath-009YCA-4y for pgsql-general@arkaria.postgresql.org; Wed, 23 Oct 2024 12:55:33 +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 1t3atg-009YC2-Qc for pgsql-general@lists.postgresql.org; Wed, 23 Oct 2024 12:55:33 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t3ate-002SGO-PN for pgsql-general@lists.postgresql.org; Wed, 23 Oct 2024 12:55:31 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 6F5382A14D6 for ; Wed, 23 Oct 2024 05:55:29 -0700 (PDT) Date: Wed, 23 Oct 2024 05:55:29 -0700 (PDT) From: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Re: CURRENTE_DATE In-Reply-To: <00b001db2475$e6584640$b308d2c0$@bry-it.com> Message-ID: <5a32acb0-37fb-f97e-b0fc-6bd560e9eb6@appl-ecosys.com> References: <00b001db2475$e6584640$b308d2c0$@bry-it.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 22 Oct 2024, Rossana Ocampos wrote: > ERROR: invalid input syntax for type date: "CURRENT_DATE" LINE 1: > ...extsupplydate ('1085018'::bigint, '5278'::bigint, 'CURRENT_D... ^ ERROR: > invalid input syntax for type date: "CURRENT_DATE" SQL status: 22007 > Characters: 78 Rossana, Also, I suggest you put the column names (not their data types) separate from the values. Here's an example of a script I use (Slackware64 linux): \d enforcement Table "public.enforcement" Column | Type | Collation | Nullable | Default ----------------+---------+-----------+----------+-------------- company_nbr | integer | | | action_date | date | | not null | CURRENT_DATE penalty_amount | real | | | reason | text | | | comment | text | | | Foreign-key constraints: "enforcement_company_nbr_fkey" FOREIGN KEY (company_nbr) REFERENCES companies(company_nbr) ON UPDATE CASCADE ON DELETE RESTRICT insert into enforcement (company_nbr, action_date, penalty_amount, reason, comment) values (123, '2024-10-23', default, 'Did a wrong thing.', null); HTH, Rich