{"id":8525,"date":"2020-11-09T07:11:00","date_gmt":"2020-11-09T07:11:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8525"},"modified":"2025-08-26T04:38:10","modified_gmt":"2025-08-26T04:38:10","slug":"how-to-compare-two-schemas-in-postgresql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/","title":{"rendered":"How to Compare Two Schemas in PostgreSQL"},"content":{"rendered":"\n<p>PostgreSQL Schema is a collection of database tables, functions, views, constraints. Often database administrators may need to compare two schemas in PostgreSQL to see if they are identical or not. It is very tedious to do this manually since a schema consists of many different things. You can use a SQL query to accomplish this, or use one of the many third-party tools that allow you to compare two schemas in PostgreSQL. In this article we will look at both ways to compare two schemas in PostgreSQL.<\/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-compare-two-schemas-in-postgresql\/#How_to_Compare_Two_Schemas_in_PostgreSQL\" >How to Compare Two Schemas 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-compare-two-schemas-in-postgresql\/#1_Compare_Two_Schemas_Using_SQL\" >1. Compare Two Schemas Using SQL<\/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-compare-two-schemas-in-postgresql\/#2_Compare_Two_Schemas_in_pgAdmin\" >2. Compare Two Schemas in pgAdmin<\/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-compare-two-schemas-in-postgresql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Compare_Two_Schemas_in_PostgreSQL\"><\/span>How to Compare Two Schemas in PostgreSQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We will look at two ways to compare two schemas in PostgreSQL &#8211; using SQL queries and using pgAdmin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Compare_Two_Schemas_Using_SQL\"><\/span>1. Compare Two Schemas Using SQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here&#8217;s the SQL query to compare two schemas. Every PostgreSQL installation contains information_schema system table that contains all information about all databases, tables, views and other aspects. Replace schema1 and schema2 with the names of two schemas you want to compare.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">select COALESCE(c1.table_name, c2.table_name) as table_name,\n       COALESCE(c1.column_name, c2.column_name) as table_column,\n       c1.column_name as schema1,\n       c2.column_name as schema2\nfrom\n    (select table_name,\n            column_name\n     from information_schema.columns c\n     where c.table_schema = '<strong>schema1<\/strong>') c1\nfull join\n         (select table_name,\n                 column_name\n          from information_schema.columns c\n          where c.table_schema = '<strong>schema2<\/strong>') c2\non c1.table_name = c2.table_name and c1.column_name = c2.column_name\nwhere c1.column_name is null\n      or c2.column_name is null\norder by table_name,\n         table_column;\n<\/pre>\n\n\n\n<p>The above query basically lists all rows present in either schema with information about its presence\/absence in the other schema. <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>table_name<\/em> &#8211; name of table present in schema1 or schema2<\/li>\n\n\n\n<li><em>table_column<\/em> &#8211; name of column present in schema1 or schema2<\/li>\n\n\n\n<li><em>schema1<\/em> &#8211; if column exists in schema1 its name is displayed, else it is null.<\/li>\n\n\n\n<li><em>schema2<\/em> &#8211; if column exists in schema2 its name is displayed, else it is null.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Compare_Two_Schemas_in_pgAdmin\"><\/span>2. Compare Two Schemas in pgAdmin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>pgAdmin is a popular database management tool for PostgreSQL databases. We will use the <strong>Schema Diff<\/strong> feature of pgAdmin to compare schemas or databases or other objects.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.pgadmin.org\/docs\/pgadmin4\/development\/schema_diff.html\" target=\"_blank\" rel=\"noreferrer noopener\">Schema diff<\/a> tool allows you to trace the difference between two database objects, and list the different SQL statements to synchronize databases.<\/p>\n\n\n\n<p>However, please note, the source and target servers should be of same major server version.<\/p>\n\n\n\n<p>Here are the steps to compare two schemas using Schema Diff tool.<\/p>\n\n\n\n<p>1. Click <em>Schema Diff<\/em> option, under <em>Tools<\/em> menu.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"129\" src=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.webp?resize=730%2C129&#038;ssl=1\" alt=\"\" class=\"wp-image-8527\"\/><\/figure>\n<\/div>\n\n\n<p>2. You will see a form where you need to select Source and Target <\/p>\n\n\n\n<p>3. Select server versions, source and target servers, and database\/schema depending on your requirement.<\/p>\n\n\n\n<p>4. Click Compare to compare two databases\/schemas. You will see a detailed list of object comparison result, followed by DDL comparison result<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"491\" src=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_comparison_results.webp?resize=730%2C491&#038;ssl=1\" alt=\"\" class=\"wp-image-8528\"\/><\/figure>\n<\/div>\n\n\n<p>5. The object comparison result is presented as a tree, which you can click to expand\/collapse.<\/p>\n\n\n\n<p>6. DDL comparison results are presented in 3 panels. In the left panel you will find SQL queries of source schema. In the middle panel, you have the SQL statements for target schema. And in the right panel, you will find the difference between SQL statements of two schemas. <\/p>\n\n\n\n<p>7. You will find many options to refine comparison results such as Query Editor, Script generator and filters.<\/p>\n\n\n\n<p>pgAdmin Schema diff is much more comprehensive than SQL-based schema comparison, and is highly recommended. Hopefully, this article will help you compare two schemas in PostgreSQL.<\/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 a couple of simple ways to easily compare two PostgreSQL schemas. They are very useful to quickly determine if two databases are similar or not. You can use any of these methods as per your requirement. Otherwise, it will be very cumbersome to compare two databases. Of course, it is important to remember that even if two database schemas are identical, it is possible that they contain different data. <\/p>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\/\">Ubiq<\/a> makes it easy to visualize data, and monitor them in real-time dashboards. <a href=\"https:\/\/ubiq.co\/accounts\/register\">Try Ubiq<\/a> for free.<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/top-5-free-database-design-tools\/\">Top Free Database Design Tools<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/\">How to Enable SSL in PostgreSQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-pivot-table-in-postgresql\/\">How to Create Pivot Table in PostgreSQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you may need to compare two schemas in PostgreSQL. Here&#8217;s how to compare schemas in PostgreSQL.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[348],"tags":[482],"class_list":["post-8525","post","type-post","status-publish","format-standard","hentry","category-postgresql","tag-compare-schema"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Compare Two Schemas in PostgreSQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Sometimes you may need to compare two schemas in PostgreSQL. Here&#039;s how to compare schemas 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-compare-two-schemas-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 Compare Two Schemas in PostgreSQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Sometimes you may need to compare two schemas in PostgreSQL. Here&#039;s how to compare schemas in PostgreSQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-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-11-09T07:11:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-26T04:38:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.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=\"3 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-compare-two-schemas-in-postgresql\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Compare Two Schemas in PostgreSQL\",\"datePublished\":\"2020-11-09T07:11:00+00:00\",\"dateModified\":\"2025-08-26T04:38:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/\"},\"wordCount\":596,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.webp\",\"keywords\":[\"compare schema\"],\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/\",\"name\":\"How to Compare Two Schemas in PostgreSQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.webp\",\"datePublished\":\"2020-11-09T07:11:00+00:00\",\"dateModified\":\"2025-08-26T04:38:10+00:00\",\"author\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Sometimes you may need to compare two schemas in PostgreSQL. Here's how to compare schemas in PostgreSQL.\",\"breadcrumb\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.webp?fit=768%2C136&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.webp?fit=768%2C136&ssl=1\",\"width\":768,\"height\":136},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ubiq.co\/tech-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Compare Two Schemas 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 Compare Two Schemas in PostgreSQL - Ubiq BI","description":"Sometimes you may need to compare two schemas in PostgreSQL. Here's how to compare schemas 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-compare-two-schemas-in-postgresql\/","og_locale":"en_US","og_type":"article","og_title":"How to Compare Two Schemas in PostgreSQL - Ubiq BI","og_description":"Sometimes you may need to compare two schemas in PostgreSQL. Here's how to compare schemas in PostgreSQL.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-11-09T07:11:00+00:00","article_modified_time":"2025-08-26T04:38:10+00:00","og_image":[{"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.webp","type":"","width":"","height":""}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Compare Two Schemas in PostgreSQL","datePublished":"2020-11-09T07:11:00+00:00","dateModified":"2025-08-26T04:38:10+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/"},"wordCount":596,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.webp","keywords":["compare schema"],"articleSection":["PostgreSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/","name":"How to Compare Two Schemas in PostgreSQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.webp","datePublished":"2020-11-09T07:11:00+00:00","dateModified":"2025-08-26T04:38:10+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Sometimes you may need to compare two schemas in PostgreSQL. Here's how to compare schemas in PostgreSQL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.webp?fit=768%2C136&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/schema_diff_compare_button.webp?fit=768%2C136&ssl=1","width":768,"height":136},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Compare Two Schemas 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":"","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2dv","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8525","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=8525"}],"version-history":[{"count":3,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8525\/revisions"}],"predecessor-version":[{"id":9289,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8525\/revisions\/9289"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}