Re: CURRENTE_DATE

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: CURRENTE_DATE
Date: 2024-10-23 12:55:29
Message-ID: 5a32acb0-37fb-f97e-b0fc-6bd560e9eb6@appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ray O'Donnell 2024-10-23 13:18:36 Re: CURRENTE_DATE
Previous Message Rich Shepard 2024-10-23 12:49:54 Re: CURRENTE_DATE