pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Question about array_to_string()'s behavior and the behavior might be changed in the future or not
3+ messages / 2 participants
[nested] [flat]

* Question about array_to_string()'s behavior and the behavior might be changed in the future or not
@ 2019-01-17 06:50  Egashira, Yusuke <egashira.yusuke@jp.fujitsu.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Egashira, Yusuke @ 2019-01-17 06:50 UTC (permalink / raw)
  To: pgsql-general

Hi, 

I have a question about array_to_string(). 
I think array_to_string() concatenates always array elements from the "beginning" of the array elements and this rule will not be changed on the future minor releases. 
Is my understanding correct? 

For example, I understand that array_to_string() "never" output like following result now and in the future, is my understanding correct? 

[Example] -> array_to_string(ARRAY[1, 2, 3, NULL, 5], ',', '*')
[Result]  -> 2,1,3,*,5

Currently I use PostgreSQL 9.5. 

Regards,

--
Yusuke, Egashira






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

* Re: Question about array_to_string()'s behavior and the behavior might be changed in the future or not
@ 2019-01-17 06:56  Andrew Gierth <andrew@tao11.riddles.org.uk>
  parent: Egashira, Yusuke <egashira.yusuke@jp.fujitsu.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Andrew Gierth @ 2019-01-17 06:56 UTC (permalink / raw)
  To: Egashira\, Yusuke <egashira.yusuke@jp.fujitsu.com>; +Cc: pgsql-general

>>>>> "Egashira" == Egashira, Yusuke <egashira.yusuke@jp.fujitsu.com> writes:

 Egashira> Hi, 
 Egashira> I have a question about array_to_string(). 

 Egashira> I think array_to_string() concatenates always array elements
 Egashira> from the "beginning" of the array elements and this rule will
 Egashira> not be changed on the future minor releases.

 Egashira> Is my understanding correct? 

The order of elements in the original array will always be preserved in
the string output, yes.

 Egashira> For example, I understand that array_to_string() "never"
 Egashira> output like following result now and in the future, is my
 Egashira> understanding correct?

Yes.

-- 
Andrew (irc:RhodiumToad)




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

* RE: Question about array_to_string()'s behavior and the behavior might be changed in the future or not
@ 2019-01-17 07:53  Egashira, Yusuke <egashira.yusuke@jp.fujitsu.com>
  parent: Andrew Gierth <andrew@tao11.riddles.org.uk>
  0 siblings, 0 replies; 3+ messages in thread

From: Egashira, Yusuke @ 2019-01-17 07:53 UTC (permalink / raw)
  To: Andrew Gierth <andrew@tao11.riddles.org.uk>; +Cc: pgsql-general

Hi, Andrew

Thank you for immediate replying.
I'm relieved.

Regards.
--
Yusuke, Egashira

-----Original Message-----
From: Andrew Gierth [mailto:andrew@tao11.riddles.org.uk] 
Sent: Thursday, January 17, 2019 3:56 PM
To: Egashira, Yusuke/$B9>F,(B $BM&M$(B <egashira.yusuke@jp.fujitsu.com>
Cc: 'pgsql-general@postgresql.org' <pgsql-general@postgresql.org>
Subject: Re: Question about array_to_string()'s behavior and the behavior might be changed in the future or not

>>>>> "Egashira" == Egashira, Yusuke <egashira.yusuke@jp.fujitsu.com> writes:

 Egashira> Hi, 
 Egashira> I have a question about array_to_string(). 

 Egashira> I think array_to_string() concatenates always array elements
 Egashira> from the "beginning" of the array elements and this rule will
 Egashira> not be changed on the future minor releases.

 Egashira> Is my understanding correct? 

The order of elements in the original array will always be preserved in
the string output, yes.

 Egashira> For example, I understand that array_to_string() "never"
 Egashira> output like following result now and in the future, is my
 Egashira> understanding correct?

Yes.

-- 
Andrew (irc:RhodiumToad)






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


end of thread, other threads:[~2019-01-17 07:53 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 06:50 Question about array_to_string()'s behavior and the behavior might be changed in the future or not Egashira, Yusuke <egashira.yusuke@jp.fujitsu.com>
2019-01-17 06:56 ` Andrew Gierth <andrew@tao11.riddles.org.uk>
2019-01-17 07:53   ` Egashira, Yusuke <egashira.yusuke@jp.fujitsu.com>

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