{"id":8465,"date":"2020-12-15T04:50:00","date_gmt":"2020-12-15T04:50:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8465"},"modified":"2025-08-29T04:56:48","modified_gmt":"2025-08-29T04:56:48","slug":"how-to-concatenate-strings-in-postgresql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/","title":{"rendered":"How to Concatenate Strings in PostgreSQL"},"content":{"rendered":"\n<p>String concatenation is a common requirement among web developers and database programmers. They may need to combine two or more strings in SQL query result without modifying actual data. PostgreSQL allows you to easily join two or more columns, strings and int. It offers 3 ways to concatenate strings &#8211; using &#8216;||&#8217; operator, using concat() and using concat_ws() function. In this article, we will look at how to concatenate strings in PostgreSQL using each of these approaches. You can use it to combine columns in PostgreSQL, string and variable, or string and int. We will also learn what to do if one of the strings is null.<\/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-concatenate-strings-in-postgresql\/#How_to_Concatenate_Strings_in_PostgreSQL\" >How to Concatenate Strings 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-concatenate-strings-in-postgresql\/#1_Concatenate_String_Literals_with_Operator\" >1. Concatenate String Literals with || Operator<\/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-concatenate-strings-in-postgresql\/#2_Join_String_with_Int_Using_Operator\" >2. Join String with Int Using || Operator<\/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-concatenate-strings-in-postgresql\/#3_Concatenate_String_with_Null_Using_Operator\" >3. Concatenate String with Null Using || Operator<\/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-concatenate-strings-in-postgresql\/#4_Concatenate_Two_Columns_Using_operator\" >4. Concatenate Two Columns Using || operator<\/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-concatenate-strings-in-postgresql\/#5_Combine_String_Literals_using_concat_function\" >5. Combine String Literals using concat function<\/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-concatenate-strings-in-postgresql\/#6_Join_String_with_Int_Using_concat_function\" >6. Join String with Int Using concat function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#7_Combine_String_with_Null_using_Concat_Function\" >7. Combine String with Null using Concat Function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#8_Concatenate_Columns_using_concat_function\" >8. Concatenate Columns using concat function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#9_Using_Concat_ws_function\" >9. Using Concat_ws() function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Concatenate_Strings_in_PostgreSQL\"><\/span>How to Concatenate Strings in PostgreSQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are three ways to concatenate strings in PostgreSQL &#8211; using || operator, using <em>concat<\/em> and using concat_ws() function. Here is the syntax of &#8216;||&#8217; operator.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">str1 || str2 || str3 || ...<\/pre>\n\n\n\n<p>Here is the syntax of concat() function.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">concat(str1, str2, str3, ...)<\/pre>\n\n\n\n<p>Here is the syntax of concat_ws() function.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">concat_ws(separator, str1, str2, str3, ...)<\/pre>\n\n\n\n<p>In each of the above solutions, you can use string literals or column names. They can also be used with other data types such as int, floats, etc. but they will be converted into string before concatenation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Concatenate_String_Literals_with_Operator\"><\/span>1. Concatenate String Literals with || Operator<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can easily combine two or more string literals using &#8216;||&#8217; operator as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres=# SELECT 'Good' || ' ' || 'Morning' AS greeting;<br><br> greeting<br>-----------<br> Good Morning<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Join_String_with_Int_Using_Operator\"><\/span>2. Join String with Int Using || Operator<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can also use &#8216;||&#8217; operator to combine string with int data types. In this case, the int data is first converted into string, before concatenation.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres=# SELECT 'Good' || ' ' || 1 AS greeting;<br><br> greeting<br>-----------<br> Good 1<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Concatenate_String_with_Null_Using_Operator\"><\/span>3. Concatenate String with Null Using || Operator<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Please note, || operator cannot be used to combine string or int with null values. The result will always be null.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres=# SELECT 'Good' || NULL || 'Morning' AS greeting;<br><br> greeting<br>-----------<br><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Concatenate_Two_Columns_Using_operator\"><\/span>4. Concatenate Two Columns Using || operator<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>PostgreSQL allows you to directly concatenate strings, columns and int values using || operator. <\/p>\n\n\n\n<p>Let us say you have a table <em>employees(id, first_name, last_name)<\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres=# create table employees(id int, <br>              first_name varchar(10), <br>              last_name varchar(10));<br><br>postgres=# insert into employees(id,first_name,last_name)<br>           values(1,'Jim','Doe'),<br>                 (2,'Tim','Don'),<br>                 (3,'Jane','Doe');<br><br>postgres=# select * from employees;<br> id | first_name | last_name<br>----+------------+-----------<br>  1 | Jim        | Doe<br>  2 | Tim        | Don<br>  3 | Jane       | Doe<\/pre>\n\n\n\n<p>Here is the SQL query to concatenate columns <em>first_name<\/em> and <em>last_name<\/em> using || operator.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres-# select first_name || ' ' || last_name as full_name\n           from employees;\n full_name\n-----------\n Jim Doe\n Tim Don\n Jane Doe<\/pre>\n\n\n\n<p>You can even concatenate string with int using || operator.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">select first_name || 123 || last_name as full_name\npostgres-#            from employees;\n full_name\n------------\n Jim123Doe\n Tim123Don\n Jane123Doe<\/pre>\n\n\n\n<p>As you can see || operator automatically converts int to string while concatenating.<\/p>\n\n\n\n<p>Here also, || operator cannot concatenate null values. If there is null in any of the column or string, then the result is a null value.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres-#  select first_name || null || last_name as full_name<br>            from employees;<br> full_name<br>-----------<br><br>(3 rows)<\/pre>\n\n\n\n<p>For that purpose, we need to use <em>concat<\/em> function, which is described below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Combine_String_Literals_using_concat_function\"><\/span>5. Combine String Literals using concat function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Starting PostgreSQL 9.1, <em>Concat<\/em> function also allows you to concatenate strings, columns and int. It accepts comma-separated parameters. These parameters can be strings, columns, int, null, etc.<\/p>\n\n\n\n<p>The key difference between || operator and <em>concat<\/em> function is that, if any of the values in <em>concat<\/em> function is null, it is automatically converted into an empty string during concatenation.<\/p>\n\n\n\n<p>Here is an example to combine two or more string literals using concat() function.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres=# SELECT concat('Good',' ','Morning') AS greeting;<br><br> greeting<br>-----------<br> Good Morning<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Join_String_with_Int_Using_concat_function\"><\/span>6. Join String with Int Using concat function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can also combine string with other data types such as int, float, dates, etc. using concat() function. All non-string data types will be converted into strings before joining them.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres=# SELECT concat('Good', ' ', 123) AS greeting;<br><br> greeting<br>-----------<br> Good 123<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_Combine_String_with_Null_using_Concat_Function\"><\/span>7. Combine String with Null using Concat Function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Unlike || operator, if any of the strings are null, concat() function will convert it into empty string, before concatenation. This is an advantage of using concat() compared to || operator.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres=# SELECT concat('Good', NULL, 'Morning') AS greeting;<br><br> greeting<br>-----------<br> GoodMorning<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8_Concatenate_Columns_using_concat_function\"><\/span>8. Concatenate Columns using concat function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here is an example to concatenate <em>first_name<\/em> and <em>last_name<\/em> column above using <em>concat<\/em> function.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres-# select concat(first_name,' ',last_name) as full_name \n           from employees;\n full_name\n-----------\n Jim Doe\n Tim Don\n Jane Doe\n<\/pre>\n\n\n\n<p>Here is an example to concatenate <em>first_name<\/em> and <em>last_name<\/em> columns with <em>null<\/em> value<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres=# select concat(first_name,null,last_name) as full_name\n            from employees;\n full_name\n-----------\n JimDoe\n TimDon\n JaneDoe<\/pre>\n\n\n\n<p>As you can see, <em>concat<\/em> function has converted null values into empty strings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"9_Using_Concat_ws_function\"><\/span>9. Using Concat_ws() function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>So far, in all the above examples, the result is direct concatenation of strings as they are. Sometimes, you may need to insert a separator between strings in the final result of concatenation. For this purpose, you can use concat_ws() function. It basically concatenates strings with a separator. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CONCAT_WS(separator, str1, str2, ...);<\/pre>\n\n\n\n<p>Here is a simple example to concatenate strings with comma separator.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres=# SELECT concat_ws(',','John', 41, 'Male') AS details;<br><br> details<br>-----------<br> John,41,Male<\/pre>\n\n\n\n<p>You can also use it to combine columns.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">postgres=# SELECT concat_ws(',',name, age, gender) from employees AS details;<br><br> details<br>-----------<br> John,41,Male<\/pre>\n\n\n\n<p>As you can see, it is very useful to quickly concatenate data using a separator.<\/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>In this article, we have learnt several simple ways to easily concatenate strings in PostgreSQL using &#8216;||&#8217; operator as well as concat() function. While using &#8216;||&#8217; operator, it is important to remember that if any of the strings is null, then the result will be null. We have also learnt how to use concat_ws() function which is a variation of concat() function. String concatenation is a common requirement in almost every website and app, especially where you need to display user details such as name, address, etc. Depending on your requirement, you can use any of the solutions described in this article.<\/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-update-multiple-columns-in-postgresql\/\">How to Update Multiple Columns in PostgreSQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-arrays-in-postgresql\/\">How to Compare Arrays in PostgreSQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/\">How to Create Superuser in PostgreSQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can easily concatenate columns &#038; strings in PostgreSQL. Here is how to concatenate strings in PostgreSQL. <\/p>\n","protected":false},"author":1,"featured_media":8467,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[348],"tags":[464],"class_list":["post-8465","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-concatenate"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Concatenate Strings in PostgreSQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"You can easily concatenate columns &amp; strings in PostgreSQL. Here is how to concatenate strings 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-concatenate-strings-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 Concatenate Strings in PostgreSQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"You can easily concatenate columns &amp; strings in PostgreSQL. Here is how to concatenate strings in PostgreSQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-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-15T04:50:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-29T04:56:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/concat-string-postgresql.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"659\" \/>\n\t<meta property=\"og:image:height\" content=\"374\" \/>\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-concatenate-strings-in-postgresql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Concatenate Strings in PostgreSQL\",\"datePublished\":\"2020-12-15T04:50:00+00:00\",\"dateModified\":\"2025-08-29T04:56:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/\"},\"wordCount\":826,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/concat-string-postgresql.webp?fit=659%2C374&ssl=1\",\"keywords\":[\"concatenate\"],\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/\",\"name\":\"How to Concatenate Strings in PostgreSQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/concat-string-postgresql.webp?fit=659%2C374&ssl=1\",\"datePublished\":\"2020-12-15T04:50:00+00:00\",\"dateModified\":\"2025-08-29T04:56:48+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"You can easily concatenate columns & strings in PostgreSQL. Here is how to concatenate strings in PostgreSQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/concat-string-postgresql.webp?fit=659%2C374&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/concat-string-postgresql.webp?fit=659%2C374&ssl=1\",\"width\":659,\"height\":374,\"caption\":\"concat string in postgresql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-concatenate-strings-in-postgresql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Concatenate Strings 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 Concatenate Strings in PostgreSQL - Ubiq BI","description":"You can easily concatenate columns & strings in PostgreSQL. Here is how to concatenate strings 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-concatenate-strings-in-postgresql\/","og_locale":"en_US","og_type":"article","og_title":"How to Concatenate Strings in PostgreSQL - Ubiq BI","og_description":"You can easily concatenate columns & strings in PostgreSQL. Here is how to concatenate strings in PostgreSQL.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-12-15T04:50:00+00:00","article_modified_time":"2025-08-29T04:56:48+00:00","og_image":[{"width":659,"height":374,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/concat-string-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-concatenate-strings-in-postgresql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Concatenate Strings in PostgreSQL","datePublished":"2020-12-15T04:50:00+00:00","dateModified":"2025-08-29T04:56:48+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/"},"wordCount":826,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/concat-string-postgresql.webp?fit=659%2C374&ssl=1","keywords":["concatenate"],"articleSection":["PostgreSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/","name":"How to Concatenate Strings in PostgreSQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/concat-string-postgresql.webp?fit=659%2C374&ssl=1","datePublished":"2020-12-15T04:50:00+00:00","dateModified":"2025-08-29T04:56:48+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"You can easily concatenate columns & strings in PostgreSQL. Here is how to concatenate strings in PostgreSQL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/concat-string-postgresql.webp?fit=659%2C374&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/concat-string-postgresql.webp?fit=659%2C374&ssl=1","width":659,"height":374,"caption":"concat string in postgresql"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-strings-in-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Concatenate Strings 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\/concat-string-postgresql.webp?fit=659%2C374&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2cx","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8465","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=8465"}],"version-history":[{"count":3,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8465\/revisions"}],"predecessor-version":[{"id":9355,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8465\/revisions\/9355"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/8467"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}