{"id":8452,"date":"2020-12-21T08:37:00","date_gmt":"2020-12-21T08:37:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8452"},"modified":"2025-09-01T04:49:02","modified_gmt":"2025-09-01T04:49:02","slug":"how-to-create-array-in-postgresql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/","title":{"rendered":"How to Create Array in PostgreSQL"},"content":{"rendered":"\n<p>PostgreSQL is a popular database that supports a vast number of data types. It allows web developers and database programmers to easily build any kind of website or app around their data. It even allows you to store data in arrays. Arrays are complex data types used to store a large amount of information compactly. In this article, we will look at how to create array in PostgreSQL. You can use it to create and store arrays in PostgreSQL. There are several different ways to define arrays and insert data into them. Unless you are aware of them and know their syntax, you will often encounter errors in your SQL queries while working arrays.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#What_is_Array_in_PostgreSQL\" >What is Array in PostgreSQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#How_to_Create_Array_in_PostgreSQL\" >How to Create Array in PostgreSQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#1_Using_Square_Brackets\" >1. Using Square Brackets<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#2_Using_Array_keyword\" >2. Using Array keyword<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#3_Create_Array_with_Size_in_PostgreSQL\" >3. Create Array with Size in PostgreSQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#4_Create_Multi-dimensional_Array_in_PostgreSQL\" >4. Create Multi-dimensional Array in PostgreSQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Array_in_PostgreSQL\"><\/span>What is Array in PostgreSQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>PostgreSQL array is a special type of column where each value consists of a sequential list of items. Each of these items can be a built in data type like integer or varchar, or a user-defined data type. This is very useful for modern software development such as websites and apps that extensively use arrays. PostgreSQL not only provides several ways to define arrays and insert data but also many ways to update arrays.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Create_Array_in_PostgreSQL\"><\/span>How to Create Array in PostgreSQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>PostgreSQL arrays can consist of built-in or user defined data types. But all elements of an array must be of same data type. For example, you can create array of integers or array of dates, but you cannot create an array with both integers and dates in it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Using_Square_Brackets\"><\/span>1. Using Square Brackets<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can easily create arrays in PostgreSQL by adding square brackets [] immediately after the data type for the column.<\/p>\n\n\n\n<p>Here is an example to create integer array column<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create table employees ( <\/code>\n     <code>first_name varchar, <\/code>\n     <code>last_name varchar, <\/code>\n     <code>phone_numbers <strong>integer[] <\/strong><\/code>\n<code>);<\/code><\/pre>\n\n\n\n<p>In the above example, we have created column phone_numbers as an array of integers. As you can see, we need to specify the data type of array items, immediately after the column name, followed by square brackets. So it is implied that all items of array column have same data type.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Using_Array_keyword\"><\/span>2. Using Array keyword<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Alternatively, you can also use array keyword, instead of square brackets to define array.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create table employees ( <\/code><br>     <code>first_name varchar, <\/code><br>     <code>last_name varchar, <\/code><br>     <code>phone_numbers <strong>integer array<\/strong><\/code><br><code>);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Create_Array_with_Size_in_PostgreSQL\"><\/span>3. Create Array with Size in PostgreSQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can also create an array of definite size by specifying array size limit. Here is an example that uses integer array of size 10.<\/p>\n\n\n\n<pre id=\"block-8cfc2061-a096-4e3e-943c-95b513512e29\" class=\"wp-block-preformatted\"><code>create table employees ( <\/code><br>     <code>first_name varchar, <\/code><br>     <code>last_name varchar, <\/code><br>     <code>phone_numbers <strong>integer[10] <\/strong><\/code><br><code>);<\/code><br><br>OR<br><br><code>create table employees ( <\/code><br>     <code>first_name varchar, <\/code><br>     <code>last_name varchar, <\/code><br>     <code>phone_numbers <strong>integer array[10] <\/strong><\/code><br><code>);<\/code><\/pre>\n\n\n\n<p>Whether you use datatype[] or datatype array[] format to define an array column, you can choose to specify size limit. But please note, from PostgreSQL 12.2 it is ignored and not enforced.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Create_Multi-dimensional_Array_in_PostgreSQL\"><\/span>4. Create Multi-dimensional Array in PostgreSQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Similarly, it is very easy to create multi-dimensional array in PostgreSQL. You just need to add multiple pairs of square brackets after the data type. For example, you need to add two pair of square brackets [][] to create a two-dimensional array in PostgreSQL.<\/p>\n\n\n\n<pre id=\"block-95bf006e-52b7-4069-a842-9dbddee1531a\" class=\"wp-block-preformatted\"><code>create table employees ( <\/code>\n     <code>first_name varchar, <\/code>\n     <code>last_name varchar, <\/code>\n     <code>contacts <strong>integer[][] <\/strong><\/code>\n<code>);<\/code><\/pre>\n\n\n\n<p>In the above example, <em>contacts<\/em> column is a two-dimensional array of integers. Please note, in this case, each sub-array in main array needs to be of same length. You can use the same logic to create array with more dimensions, such as 3, 4, 5, etc. dimensions, depending on your requirement.<\/p>\n\n\n\n<p>Once you have created an array in PostgreSQL, you can also learn how to insert into array and how to update array.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Arrays are a versatile data structure used to save multiple values of an entity in a database. It is a big relief that a popular database like PostgreSQL supports arrays. But it is important to know the different ways to create arrays, correct syntax to define an array, along with the limitations in each approach. Otherwise, you will frequently get errors in your SQL queries.<\/p>\n\n\n\n<p>Need a reporting tool for PostgreSQL? <a href=\"http:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data in minutes, and monitor in real-time dashboards.&nbsp;<a href=\"http:\/\/ubiq.co\/accounts\/register\">Try it<\/a>&nbsp;Today!<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-convert-string-case-in-postgresql\/\">How to Convert String Case in PostgreSQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/\">How to Concatenate Strings in PostgreSQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-update-multiple-columns-in-postgresql\/\">How to Update Multiple Columns in PostgreSQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL allows you to store array or create arrays with range. Here is how to create array in PostgreSQL.<\/p>\n","protected":false},"author":1,"featured_media":8454,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[348],"tags":[459],"class_list":["post-8452","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-postgresql-array"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create Array in PostgreSQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"PostgreSQL allows you to store array or create arrays with range. Here is how to create array in PostgreSQL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create Array in PostgreSQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"PostgreSQL allows you to store array or create arrays with range. Here is how to create array in PostgreSQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-21T08:37:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-01T04:49:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/create-array-in-postgresql.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"730\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Create Array in PostgreSQL\",\"datePublished\":\"2020-12-21T08:37:00+00:00\",\"dateModified\":\"2025-09-01T04:49:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/\"},\"wordCount\":646,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/create-array-in-postgresql.webp?fit=730%2C400&ssl=1\",\"keywords\":[\"postgresql array\"],\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/\",\"name\":\"How to Create Array in PostgreSQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/create-array-in-postgresql.webp?fit=730%2C400&ssl=1\",\"datePublished\":\"2020-12-21T08:37:00+00:00\",\"dateModified\":\"2025-09-01T04:49:02+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"PostgreSQL allows you to store array or create arrays with range. Here is how to create array in PostgreSQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/create-array-in-postgresql.webp?fit=730%2C400&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/create-array-in-postgresql.webp?fit=730%2C400&ssl=1\",\"width\":730,\"height\":400,\"caption\":\"create array in postgresql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-array-in-postgresql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create Array in PostgreSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create Array in PostgreSQL - Ubiq BI","description":"PostgreSQL allows you to store array or create arrays with range. Here is how to create array in PostgreSQL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/","og_locale":"en_US","og_type":"article","og_title":"How to Create Array in PostgreSQL - Ubiq BI","og_description":"PostgreSQL allows you to store array or create arrays with range. Here is how to create array in PostgreSQL.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-12-21T08:37:00+00:00","article_modified_time":"2025-09-01T04:49:02+00:00","og_image":[{"width":730,"height":400,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/create-array-in-postgresql.webp","type":"image\/webp"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Create Array in PostgreSQL","datePublished":"2020-12-21T08:37:00+00:00","dateModified":"2025-09-01T04:49:02+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/"},"wordCount":646,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/create-array-in-postgresql.webp?fit=730%2C400&ssl=1","keywords":["postgresql array"],"articleSection":["PostgreSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/","name":"How to Create Array in PostgreSQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/create-array-in-postgresql.webp?fit=730%2C400&ssl=1","datePublished":"2020-12-21T08:37:00+00:00","dateModified":"2025-09-01T04:49:02+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"PostgreSQL allows you to store array or create arrays with range. Here is how to create array in PostgreSQL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/create-array-in-postgresql.webp?fit=730%2C400&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/create-array-in-postgresql.webp?fit=730%2C400&ssl=1","width":730,"height":400,"caption":"create array in postgresql"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-array-in-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Create Array in PostgreSQL"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/create-array-in-postgresql.webp?fit=730%2C400&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2ck","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=8452"}],"version-history":[{"count":2,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8452\/revisions"}],"predecessor-version":[{"id":9368,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8452\/revisions\/9368"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/8454"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}