pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18393: Bad multiple "inplace" insert into domain of complex type
2+ messages / 2 participants
[nested] [flat]

* BUG #18393: Bad multiple "inplace" insert into domain of complex type
@ 2024-03-14 06:21  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2024-03-14 06:21 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: pashaharkov@yandex.ru

The following bug has been logged on the website:

Bug reference:      18393
Logged by:          Pablo Kharo
Email address:      pashaharkov@yandex.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,



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #18393: Bad multiple "inplace" insert into domain of complex type
@ 2024-03-14 15:12  Tom Lane <tgl@sss.pgh.pa.us>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2024-03-14 15:12 UTC (permalink / raw)
  To: pashaharkov@yandex.ru; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.org> writes:
> Hi, i have found strange thing when was using domain of complex type.

Yeah, that looks pretty broken.  It works correctly if you just
use the composite type directly, but not with the domain.
I'll go look for the cause in a bit.  Thanks for the report!

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-03-14 15:12 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-14 06:21 BUG #18393: Bad multiple "inplace" insert into domain of complex type PG Bug reporting form <noreply@postgresql.org>
2024-03-14 15:12 ` Tom Lane <tgl@sss.pgh.pa.us>

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