BUG #18393: Bad multiple "inplace" insert into domain of complex type

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: pashaharkov(at)yandex(dot)ru
Subject: BUG #18393: Bad multiple "inplace" insert into domain of complex type
Date: 2024-03-14 06:21:16
Message-ID: 18393-65fedb1a0de9260d@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18393
Logged by: Pablo Kharo
Email address: pashaharkov(at)yandex(dot)ru
PostgreSQL version: 16.2
Operating system: Mac OS 14.1
Description:

Hi, i have found strange thing when was using domain of complex type.

When i was using insert like this to domain of type:
```
CREATE TYPE user_tp AS (
uid TEXT,
email text,
timestamp TIMESTAMP
);

create domain user_domain as public.user_tp;

CREATE TABLE comps_tb (
id SERIAL PRIMARY KEY,
us user_domain NOT NULL
);

insert into public.comps_tb
(
us.uid,
us.email
)
values
(
'213'::TEXT,
'email'::TEXT
),
(
'321'::TEXT,
'email2'::TEXT
);

select
id,
(us).uid,
(us).email
from
public.comps_tb;
```

I have output like this:
id|uid |email |
--+-------+----------+
1|(213,,)|(,email,) |
2|(321,,)|(,email2,)|

But i expecting
id|uid |email |
--+-------+----------+
1|213|email |
2|321|email2|

So, it has created additional brackets in uid and email. BUT if i inserting
into this table only one element, it inserts without additional brackets.
Also additional brackets are not creating when i am using complex type
itself - not domain,

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurenz Albe 2024-03-14 08:55:25 Re: BUG #18392: Can't restore database (using pg_restore) after latest Feb 8 update
Previous Message Carl Smith 2024-03-14 06:03:17 Re: BUG #18392: Can't restore database (using pg_restore) after latest Feb 8 update