{"id":27543,"date":"2023-08-31T15:09:14","date_gmt":"2023-08-31T13:09:14","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=27543"},"modified":"2023-08-31T15:09:16","modified_gmt":"2023-08-31T13:09:16","slug":"guide-to-install-and-use-pgformatter-on-linux-opensuse","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/","title":{"rendered":"Guide to Install and Use pgFormatter on Linux (openSUSE)"},"content":{"rendered":"\n<p><strong>pgFormatter<\/strong> is a command-line tool used to format SQL code for PostgreSQL databases. It helps improve code readability and maintainability by applying consistent indentation and formatting rules to your SQL queries. This guide will walk you through the process of installing and using pgFormatter on a Linux system, specifically openSUSE.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-i-installation\">I. Installation<\/h2>\n\n\n\n<p>For this guide, I will install pgFormatter using the sources. The latest version at the time I wrote this blog was 5.5.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>14:33:06 postgres@localhost:\/home\/postgres\/ &#091;PG16] version=5.5\n14:33:32 postgres@localhost:\/home\/postgres\/ &#091;PG16] wget https:\/\/github.com\/darold\/pgFormatter\/archive\/refs\/tags\/v${version}.tar.gz\n14:34:03 postgres@localhost:\/home\/postgres\/ &#091;PG16] tar xzf v${version}.tar.gz\n14:34:17 postgres@localhost:\/home\/postgres\/ &#091;PG16] cd pgFormatter-${version}\/\n14:34:41 postgres@localhost:\/home\/postgres\/pgFormatter-5.5\/ &#091;PG16] perl Makefile.PL\n14:38:12 postgres@localhost:\/home\/postgres\/pgFormatter-5.5\/ &#091;PG16] make &amp;&amp; sudo make install\n14:40:27 postgres@localhost:\/home\/postgres\/ &#091;PG16] cd ..\/ &amp;&amp; rm -rf v${version}.tar.gz &amp;&amp; rm -rf pgFormatter-${version}<\/code><\/pre>\n\n\n\n<p>On OpenSuse, I had an issue to run the script pg_format from anywhere, you can fix it like that:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>14:27:34 postgres@localhost:\/home\/postgres\/ &#091;PG16] vi .bashrc\r\nexport PATH=\"$PATH:\/usr\/bin\/pg_format\"\r\n\r\n14:28:26 postgres@localhost:\/home\/postgres\/ &#091;PG16] source ~\/.bashrc\r\n\r\n14:28:34 postgres@localhost:\/home\/postgres\/ &#091;PG16] pg_format --help\r\nUsage: pg_format &#091;options] file.sql\r\n    PostgreSQL SQL queries and PL\/PGSQL code beautifier.\u2026\r\n\u2026\r\n\u2026\r<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-basic-usage\">2. Basic usage<\/h2>\n\n\n\n<p>You can format SQL directly from the command line.<br>Here is an example query that is badly formatted:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT first_name,last_name,\r\nSUM(order_total) AS total_spent,\r\nCASE WHEN gender = 'Male' THEN 'M' WHEN gender = 'Female' THEN 'F'\r\nELSE 'Other'\r\nEND AS simplified_gender FROM customers LEFT JOIN orders ON customers.customer_id = orders.customer_id\r\nWHERE registration_date BETWEEN '2022-01-01' AND '2023-01-01'\r\nAND (country = 'USA' OR country = 'Canada')\r\nGROUP BY gender, first_name, last_name HAVING total_spent &gt; 1000 ORDER BY total_spent DESC;\r<\/code><\/pre>\n\n\n\n<p>You can format it by following theses next steps:<br>run pg_format command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>15:00:38 postgres@localhost:\/home\/postgres\/ &#091;PG16] pg_format<\/code><\/pre>\n\n\n\n<p>Copy paste your query.<br>Press ctrl+d on your keyboard, and then you get the result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT\r\n    first_name,\r\n    last_name,\r\n    SUM(order_total) AS total_spent,\r\n    CASE WHEN gender = 'Male' THEN\r\n        'M'\r\n    WHEN gender = 'Female' THEN\r\n        'F'\r\n    ELSE\r\n        'Other'\r\n    END AS simplified_gender\r\nFROM\r\n    customers\r\n    LEFT JOIN orders ON customers.customer_id = orders.customer_id\r\nWHERE\r\n    registration_date BETWEEN '2022-01-01' AND '2023-01-01'\r\n    AND (country = 'USA'\r\n        OR country = 'Canada')\r\nGROUP BY\r\n    gender,\r\n    first_name,\r\n    last_name\r\nHAVING\r\n    total_spent &gt; 1000\r\nORDER BY\r\n    total_spent DESC;\r<\/code><\/pre>\n\n\n\n<p>You can also use pg_formatter to format queries inside a file.<br>First, create a sql file with our previous unformatted query.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>15:27:30 postgres@localhost:\/home\/postgres\/ &#091;PG16] echo \"SELECT first_name,last_name,\r\n&gt; SUM(order_total) AS total_spent,\r\n&gt; CASE WHEN gender = 'Male' THEN 'M' WHEN gender = 'Female' THEN 'F'\r\n&gt; ELSE 'Other'\r\n&gt; END AS simplified_gender FROM customers LEFT JOIN orders ON customers.customer_id = orders.customer_id\r\n&gt; WHERE registration_date BETWEEN '2022-01-01' AND '2023-01-01'\r\n&gt; AND (country = 'USA' OR country = 'Canada')\r\n&gt; GROUP BY gender, first_name, last_name HAVING total_spent &gt; 1000 ORDER BY total_spent DESC;\" &gt; unformatted_sql_query.sql\r<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-1-cat-content-of-a-file-directly-formatted\">2.1. cat content of a file directly formatted<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>15:34:40 postgres@localhost:\/home\/postgres\/ &#091;PG16] cat unformatted_sql_query.sql | pg_format\r\nSELECT\r\n    first_name,\r\n    last_name,\r\n    SUM(order_total) AS total_spent,\r\n    CASE WHEN gender = 'Male' THEN\r\n        'M'\r\n    WHEN gender = 'Female' THEN\r\n        'F'\r\n    ELSE\r\n        'Other'\r\n    END AS simplified_gender\r\nFROM\r\n    customers\r\n    LEFT JOIN orders ON customers.customer_id = orders.customer_id\r\nWHERE\r\n    registration_date BETWEEN '2022-01-01' AND '2023-01-01'\r\n    AND (country = 'USA'\r\n        OR country = 'Canada')\r\nGROUP BY\r\n    gender,\r\n    first_name,\r\n    last_name\r\nHAVING\r\n    total_spent &gt; 1000\r\nORDER BY\r\n    total_spent DESC;\r<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-2-format-the-content-and-output-it-in-a-new-file\">2.2. Format the content and output it in a new file<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>15:36:05 postgres@localhost:\/home\/postgres\/ &#091;PG16] pg_format  -o formated_query.sql unformatted_sql_query.sql\r\n15:37:28 postgres@localhost:\/home\/postgres\/ &#091;PG16] cat formated_query.sql\r\nSELECT\r\n    first_name,\r\n    last_name,\r\n    SUM(order_total) AS total_spent,\r\n    CASE WHEN gender = 'Male' THEN\r\n        'M'\r\n    WHEN gender = 'Female' THEN\r\n        'F'\r\n    ELSE\r\n        'Other'\r\n    END AS simplified_gender\r\nFROM\r\n    customers\r\n    LEFT JOIN orders ON customers.customer_id = orders.customer_id\r\nWHERE\r\n    registration_date BETWEEN '2022-01-01' AND '2023-01-01'\r\n    AND (country = 'USA'\r\n        OR country = 'Canada')\r\nGROUP BY\r\n    gender,\r\n    first_name,\r\n    last_name\r\nHAVING\r\n    total_spent &gt; 1000\r\nORDER BY\r\n    total_spent DESC;\r<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-3-advanced-usage\">3. Advanced usage<\/h2>\n\n\n\n<p>pgFormatter allows you to configure various formatting options according to your preferences. You can directly pass options to the pg_format command or you can configure pgFormatter by creating a configuration file named . pg_format in your home directory ($HOME\/.pg_format) or in the directory where you&#8217;re running the command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-1-use-options-with-pg-formatter-command\">3.1. Use options with pg_formatter command<\/h3>\n\n\n\n<p>You can list available options by running the commands pg_format &#8211;help or you can find them on the Github of the project. Let\u2019s use the file unformatted_sql_query.sql for our example.<br>We are going to use the options -a and -b.<br>-a: Make queries more secure by concealing all literal information. This is helpful for safeguarding sensitive data prior to formatting.<br>-b: When making a list of parameters, begin with a comma<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>15:47:10 postgres@localhost:\/home\/postgres\/ &#091;PG16] cat unformatted_sql_query.sql | pg_format -b -a\r\nSELECT\r\n    first_name\r\n    , last_name\r\n    , SUM(order_total) AS total_spent\r\n    , CASE WHEN gender = 'AYbHbbLmMP' THEN\r\n        'krP5UwG1JX'\r\n    WHEN gender = 'pSRVKMIWBU' THEN\r\n        'e7lslNpxTK'\r\n    ELSE\r\n        'Yi5aXsXLre'\r\n    END AS simplified_gender\r\nFROM\r\n    customers\r\n    LEFT JOIN orders ON customers.customer_id = orders.customer_id\r\nWHERE\r\n    registration_date BETWEEN '747vADdsUQ' AND 'UZ_iVYEk40'\r\n    AND (country = 'iW14Pzl_Dm'\r\n        OR country = '2rmPyVcZ7s')\r\nGROUP BY\r\n    gender\r\n    , first_name\r\n    , last_name\r\nHAVING\r\n    total_spent &gt; 1000\r\nORDER BY\r\n    total_spent DESC;\r<\/code><\/pre>\n\n\n\n<p>If you compare the results to what we have inside the file formated_query.sql, you can see the differences.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-2-format-the-content-by-editing-the-config-file\">3.2. Format the content by editing the config file<\/h3>\n\n\n\n<p>Create the necessary file and edit it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>15:49:07 postgres@localhost:\/home\/postgres\/ &#091;PG16] vi .pg_format\r\ncomma=start\r<\/code><\/pre>\n\n\n\n<p>Now, we are going to format the content of our file unformatted_sql_query.sql without passing formatting options to the command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>15:53:40 postgres@localhost:\/home\/postgres\/ &#091;PG16] pg_format -n unformatted_sql_query.sql\r\nSELECT\r\n    first_name\r\n    , last_name\r\n    , SUM(order_total) AS total_spent\r\n    , CASE WHEN gender = 'Male' THEN\r\n        'M'\r\n    WHEN gender = 'Female' THEN\r\n        'F'\r\n    ELSE\r\n        'Other'\r\n    END AS simplified_gender\r\nFROM\r\n    customers\r\n    LEFT JOIN orders ON customers.customer_id = orders.customer_id\r\nWHERE\r\n    registration_date BETWEEN '2022-01-01' AND '2023-01-01'\r\n    AND (country = 'USA'\r\n        OR country = 'Canada')\r\nGROUP BY\r\n    gender\r\n    , first_name\r\n    , last_name\r\nHAVING\r\n    total_spent &gt; 1000\r\nORDER BY\r\n    total_spent DESC;\r<\/code><\/pre>\n\n\n\n<p>Tada ! The coma=start options has been taken into consideration.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-4-integration-with-editors\">4. Integration with Editors<\/h3>\n\n\n\n<p>You can integrate pgFormatter with text editors to automatically format SQL code. We are going to use vim as an example.<br>Add the following line to your .vimrc configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>16:00:44 postgres@localhost:\/home\/postgres\/ &#091;PG16]  echo \"au FileType sql setl formatprg=\/usr\/bin\/pg_format\\ - \" &gt;&gt; .vimrc<\/code><\/pre>\n\n\n\n<p>If you moved your binaries to\u00a0 \/usr\/local\/bin\/pg_format, don\u2019t forget to change the path.<\/p>\n\n\n\n<p>Once done, you can format the content inside a file with vim.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim unformatted_sql_query.sql<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"140\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image002.png\" alt=\"\" class=\"wp-image-27549\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image002.png 739w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image002-300x57.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>### press ESC and then type gqG to format the entire file ###<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"538\" height=\"426\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image003-1.png\" alt=\"\" class=\"wp-image-27550\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image003-1.png 538w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image003-1-300x238.png 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-5-conclusion\">5. Conclusion<\/h2>\n\n\n\n<p>pgFormatter is a valuable tool for enhancing the readability and maintainability of your SQL code. By following this guide, you&#8217;ve learned how to install pgFormatter on openSUSE, format SQL files and commands, configure advanced settings, and even integrate it with your favorite text editor. This will help you produce cleaner, more consistent SQL code in your PostgreSQL projects. Again thanks to the developers and don\u2019t forget to check the Github of the pgFormatter project to learn more about it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-useful-links\">Useful links<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/darold\/pgFormatter\">https:\/\/github.com\/darold\/pgFormatter<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>pgFormatter is a command-line tool used to format SQL code for PostgreSQL databases. It helps improve code readability and maintainability by applying consistent indentation and formatting rules to your SQL queries. This guide will walk you through the process of installing and using pgFormatter on a Linux system, specifically openSUSE. I. Installation For this guide, [&hellip;]<\/p>\n","protected":false},"author":87,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[368,83],"tags":[3065,77],"type_dbi":[2749],"class_list":["post-27543","post","type-post","status-publish","format-standard","hentry","category-development-performance","category-postgresql","tag-pgformatter","tag-postgresql","type-postgresql"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Guide to Install and Use pgFormatter on Linux (openSUSE) - dbi Blog<\/title>\n<meta name=\"description\" content=\"Learn how to improve the readability and consistency of your SQL code for PostgreSQL databases using pgFormatter, a command-line tool.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Guide to Install and Use pgFormatter on Linux (openSUSE)\" \/>\n<meta property=\"og:description\" content=\"Learn how to improve the readability and consistency of your SQL code for PostgreSQL databases using pgFormatter, a command-line tool.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-31T13:09:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-31T13:09:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image002.png\" \/>\n<meta name=\"author\" content=\"Joan Frey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joan Frey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/\"},\"author\":{\"name\":\"Joan Frey\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/c03c47649664fe73b27ce457e99f5b06\"},\"headline\":\"Guide to Install and Use pgFormatter on Linux (openSUSE)\",\"datePublished\":\"2023-08-31T13:09:14+00:00\",\"dateModified\":\"2023-08-31T13:09:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/\"},\"wordCount\":545,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/image002.png\",\"keywords\":[\"pgFormatter\",\"PostgreSQL\"],\"articleSection\":[\"Development &amp; Performance\",\"PostgreSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/\",\"name\":\"Guide to Install and Use pgFormatter on Linux (openSUSE) - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/image002.png\",\"datePublished\":\"2023-08-31T13:09:14+00:00\",\"dateModified\":\"2023-08-31T13:09:16+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/c03c47649664fe73b27ce457e99f5b06\"},\"description\":\"Learn how to improve the readability and consistency of your SQL code for PostgreSQL databases using pgFormatter, a command-line tool.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/image002.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/08\\\/image002.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/guide-to-install-and-use-pgformatter-on-linux-opensuse\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Guide to Install and Use pgFormatter on Linux (openSUSE)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/c03c47649664fe73b27ce457e99f5b06\",\"name\":\"Joan Frey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g\",\"caption\":\"Joan Frey\"},\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/joanfrey\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Guide to Install and Use pgFormatter on Linux (openSUSE) - dbi Blog","description":"Learn how to improve the readability and consistency of your SQL code for PostgreSQL databases using pgFormatter, a command-line tool.","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:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/","og_locale":"en_US","og_type":"article","og_title":"Guide to Install and Use pgFormatter on Linux (openSUSE)","og_description":"Learn how to improve the readability and consistency of your SQL code for PostgreSQL databases using pgFormatter, a command-line tool.","og_url":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/","og_site_name":"dbi Blog","article_published_time":"2023-08-31T13:09:14+00:00","article_modified_time":"2023-08-31T13:09:16+00:00","og_image":[{"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image002.png","type":"","width":"","height":""}],"author":"Joan Frey","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Joan Frey","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/"},"author":{"name":"Joan Frey","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c03c47649664fe73b27ce457e99f5b06"},"headline":"Guide to Install and Use pgFormatter on Linux (openSUSE)","datePublished":"2023-08-31T13:09:14+00:00","dateModified":"2023-08-31T13:09:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/"},"wordCount":545,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image002.png","keywords":["pgFormatter","PostgreSQL"],"articleSection":["Development &amp; Performance","PostgreSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/","url":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/","name":"Guide to Install and Use pgFormatter on Linux (openSUSE) - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image002.png","datePublished":"2023-08-31T13:09:14+00:00","dateModified":"2023-08-31T13:09:16+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c03c47649664fe73b27ce457e99f5b06"},"description":"Learn how to improve the readability and consistency of your SQL code for PostgreSQL databases using pgFormatter, a command-line tool.","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image002.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/08\/image002.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/guide-to-install-and-use-pgformatter-on-linux-opensuse\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Guide to Install and Use pgFormatter on Linux (openSUSE)"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c03c47649664fe73b27ce457e99f5b06","name":"Joan Frey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g","caption":"Joan Frey"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/joanfrey\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/27543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=27543"}],"version-history":[{"count":9,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/27543\/revisions"}],"predecessor-version":[{"id":27555,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/27543\/revisions\/27555"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=27543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=27543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=27543"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=27543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}