Re: casting strings to multidimensional arrays yields strange results

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: casting strings to multidimensional arrays yields strange results
Date: 2004-07-27 16:41:04
Message-ID: 163.1090946464@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-patches

Kris Jurka <books(at)ejurka(dot)com> writes:
> Are you considering NULL padding arrays constructed with the
> ARRAY[] syntax?

Don't think anyone's really thought about it.

> we should consistently pad with 0 instead of sometimes padding and sometimes
> truncating.

"Pad with 0" is a meaningless concept as soon as you think about
nonnumeric data types. I'm not very sure what's even happening
inside the code --- it's a bit surprising it doesn't crash outright
on pass-by-reference data types ...

I'd agree that the truncation behavior is wrong, but I don't want to
get rid of it by causing the padding behavior to happen more often.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Joe Conway 2004-07-28 04:38:34 Re: casting strings to multidimensional arrays yields strange
Previous Message Kris Jurka 2004-07-27 16:07:22 Re: casting strings to multidimensional arrays yields strange

Browse pgsql-hackers by date

  From Date Subject
Next Message markw 2004-07-27 17:41:48 Re: [PATCHES] Point in Time Recovery
Previous Message Kris Jurka 2004-07-27 16:07:22 Re: casting strings to multidimensional arrays yields strange

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-07-27 16:49:10 Re: [subxacts] Fixing TODO items
Previous Message Kris Jurka 2004-07-27 16:07:22 Re: casting strings to multidimensional arrays yields strange