1

I'm trying to set up a table using pgAdmin4. Works like a charm... with one exception. pgAdmin4 only allows single dimension arrays.

And even when I try to get around it using a script with

"column_name" double precision[][] NOT NULL

It simply fails, while it works for the one dimensional array just fine.

Probably just a simple syntax problem but I fail to find the solution. Any hints?

EDIT: when trying to add the column via point 'n click it just fails to offer the option of multi dimensional arrays.

When trying to go around it with a script like this:

ALTER TABLE public.table_name DROP COLUMN "column_name";

ALTER TABLE public.table_name ADD COLUMN "column_name" double precision[][] NOT NULL;

I get a successfull change... but when I check the table again, it's still one-dimensional.

Explain gives no error code either.

Anders Bernard
  • 541
  • 1
  • 6
  • 19
  • 1
    What exactly is the error you get? Your example works just fine: http://rextester.com/QBN13378 –  Oct 12 '16 at 08:30
  • 2
    See [How to get the dimensionality of an ARRAY column?](http://stackoverflow.com/q/39436189/1995738) – klin Oct 12 '16 at 08:40
  • Thanks, so it's basically just not "showing". That does help. – Anders Bernard Oct 12 '16 at 08:55
  • 1
    In a way. It is no difference in PostgreSQL if you declare a field `integer[]` or `integer[][]`, so pgAdmin 4 is correct (the internal type name is `_int4`). You can store one- or many-dimensional arrays in such a field. – Laurenz Albe Oct 12 '16 at 09:53

0 Answers0