From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: jaafarmelhem2591@gmail.com
Subject: BUG #18148: Handle null in a date/time fields when passing empty arrays issue
Date: Thu, 05 Oct 2023 14:44:19 +0000
Message-ID: <18148-f1b921dad1c6ef64@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18148
Logged by: jaafar melhem
Email address: jaafarmelhem2591@gmail.com
PostgreSQL version: 14.6
Operating system: linux-gnu
Description:
- I have 4 fields in a table, two are date type and two are time type, and i
have arrays to insert from them to this table.
- I have a function to insert to this table: IN "p_fromdates"
_varchar=NULL::character varying[], IN "p_todates" _varchar=NULL::character
varying[], IN "p_fromtimes" _varchar=NULL::character varying[], IN
"p_totimes" _varchar=NULL::character varying[],
- and I am inserting them like this :
unnest(p_fromdates::_varchar)::date, unnest(p_todates::_varchar)::date,
unnest(p_fromtimes::_varchar)::time,
unnest(p_totimes::_varchar)::time,
- However when passing null values (empty arrays), the record is not
inserted,
- I have tried to handle it but I didn't find any way, always the record is
not inserted if the 4 arrays are empty.
Postgresql version : PostgreSQL 14.6 on x86_64-pc-linux-gnu, compiled by gcc
(GCC) 8.5.0 20210514 (Red Hat 8.5.0-15), 64-bit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, jaafarmelhem2591@gmail.com
Subject: Re: BUG #18148: Handle null in a date/time fields when passing empty arrays issue
In-Reply-To: <18148-f1b921dad1c6ef64@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox