BUG #14239: Array of array type reporting

Started by Yurii Rashkovskiialmost 10 years ago3 messagesbugs
Jump to latest
#1Yurii Rashkovskii
yrashk@gmail.com

The following bug has been logged on the website:

Bug reference: 14239
Logged by: Yurii Rashkovskii
Email address: yrashk@gmail.com
PostgreSQL version: 9.5.3
Operating system: Mac OS X
Description:

Hi,

Ran:

db=# CREATE TABLE sal_emp (
db(# name text,
db(# pay_by_quarter integer[],
db(# schedule text[][]
db(# );
CREATE TABLE
db=# \d sal_emp;

Expected:

Table "eventsourcing.sal_emp"
Column | Type | Modifiers
----------------+-----------+-----------
name | text |
pay_by_quarter | integer[] |
schedule | text[][] |

Got:

Table "eventsourcing.sal_emp"
Column | Type | Modifiers
----------------+-----------+-----------
name | text |
pay_by_quarter | integer[] |
schedule | text[] |

Is there any reason why schedule text[][] is reported as text[]? I think my
JDBC driver (pgjdbc-ng) picks that up and fails to do proper coercion
because it things it's simply a text[].

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Yurii Rashkovskii (#1)
Re: BUG #14239: Array of array type reporting

On 7/9/16 12:57 PM, yrashk@gmail.com wrote:

Is there any reason why schedule text[][] is reported as text[]?

There is no such thing as text[][]. I'm not sure why it's accepted
(perhaps backward compatibility), but PostgreSQL only supports one level
of array-ness, which can, however, be multidimensional.

So this is nothing to worry about.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#3Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#2)
Re: BUG #14239: Array of array type reporting

On Sat, Jul 9, 2016 at 03:03:34PM -0400, Peter Eisentraut wrote:

On 7/9/16 12:57 PM, yrashk@gmail.com wrote:

Is there any reason why schedule text[][] is reported as text[]?

There is no such thing as text[][]. I'm not sure why it's accepted (perhaps
backward compatibility), but PostgreSQL only supports one level of
array-ness, which can, however, be multidimensional.

So this is nothing to worry about.

Yeah, arrays basically don't store any supplied dimmensions:

test=> CREATE TABLE test(x TEXT[3]);
CREATE TABLE

test=> \d test
Table "public.test"
Column | Type | Modifiers
--------+--------+-----------
x | text[] |

^^

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+                     Ancient Roman grave inscription +

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs