Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8011647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:04:47+00:00 2026-06-04T19:04:47+00:00

I have a Postgres table containing a column of type text[][] . In JDBC

  • 0

I have a Postgres table containing a column of type text[][]. In JDBC code I’ve used a String array, but an exception told me that these two do not match. If there’s no mapping between these types, could you suggest a Postgres type for a string arrays?

This is the code:

String list = "'{";
        for(int i=0; i<array.length; i++) {
            list+=prodotti[i]+",";
        }
        list+="}'";

        preparedStm.setString(4, list);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:04:48+00:00Added an answer on June 4, 2026 at 7:04 pm

    To understand multi-dimensional PostgreSQL array types consider the following quote from the manual:

    The current implementation does not enforce the declared number of
    dimensions either. Arrays of a particular element type are all
    considered to be of the same type, regardless of size or number of
    dimensions. So, declaring the array size or number of dimensions in
    CREATE TABLE is simply documentation; it does not affect run-time
    behavior.

    Internally, the types text[], text[][] are the same to PostgreSQL. If the column actually contains 2-dimensional text arrays, you’ll have to match the dimensions in Java. But it could contain 1- or 3-dimensional arrays as well. PostgreSQL would allow it.

    Also note that text and character varying (varchar) are different data types in PostgreSQL (while doing largely the same when varchar has no length modifier). Start by reading about character types in the manual.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have designed a table (in postgres) where 'id' column is autoincremented via its
I have a postgres table with a column (called id) which contains strings. In
I have a table in Postgres and MySQL with a 'created_at' column. I would
We are redesigning table schema in postgres. It used to have a linker table
Lets say I have two tables in Postgres: Name: table_rad Column Type id integer
Working on postgres SQL. I have a table with a column that contains values
I have a table in my Postgres database with columns named type, desc, and
I have a many-to-many join table in Postgres that I would like to index
I have simple table creating script in Postgres 9.1. I need it to create
I need help in Postgres triggers. I have table with 2 columns: sold boolean;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.