{"id":1596,"date":"2025-01-10T09:45:44","date_gmt":"2025-01-10T02:45:44","guid":{"rendered":"https:\/\/www.pgtutorial.com\/?page_id=1596"},"modified":"2025-01-10T09:51:12","modified_gmt":"2025-01-10T02:51:12","slug":"postgresql-drop-type","status":"publish","type":"page","link":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/","title":{"rendered":"PostgreSQL DROP TYPE Statement"},"content":{"rendered":"\n<p><strong>Summary:<\/strong> In this tutorial, you will learn how to use the PostgreSQL <code>DROP TYPE<\/code> statement to remove a user-defined type from the database.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-postgresql-drop-type-statement'>Introduction to the PostgreSQL DROP TYPE statement <a href=\"#introduction-to-the-postgresql-drop-type-statement\" class=\"anchor\" id=\"introduction-to-the-postgresql-drop-type-statement\" title=\"Anchor for Introduction to the PostgreSQL DROP TYPE statement\">#<\/a><\/h2>\n\n\n\n<p>The <code>DROP TYPE<\/code> statement allows you to remove one or more <a href=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-composite-types\/\">user-defined data types<\/a> from a database.<\/p>\n\n\n\n<p>Here&#8217;s the syntax of the <code>DROP TYPE<\/code> statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">DROP<\/span> <span class=\"hljs-keyword\">TYPE<\/span> &#91;<span class=\"hljs-keyword\">IF<\/span> <span class=\"hljs-keyword\">EXISTS<\/span>] type_name &#91;<span class=\"hljs-keyword\">CASCADE<\/span> | <span class=\"hljs-keyword\">RESTRICT<\/span>];<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, specify the name of the user-defined type you want to remove after the <code>DROP TYPE<\/code> keywords.<\/li>\n\n\n\n<li>Second, use <code>IF EXISTS<\/code> to remove the data type only if it exists. This prevents errors if the type does not exist, making your command more robust.<\/li>\n\n\n\n<li>Third, use <code>CASCADE<\/code> to drop objects that depend on the type, such as table columns and functions, and in turn, all objects that depend on those objects. The <code>DROP TYPE<\/code> statement uses the <code>RESTRICT<\/code> option by default, which rejects dropping the type if any objects depend on it.<\/li>\n<\/ul>\n\n\n\n<p>If you want to drop more than one type at the same time, you can list them in the <code>DROP TYPE<\/code> statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">DROP<\/span> <span class=\"hljs-keyword\">TYPE<\/span> type_name1, type_name2, ...;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='basic-drop-type-statement-example'>Basic DROP TYPE statement example <a href=\"#basic-drop-type-statement-example\" class=\"anchor\" id=\"basic-drop-type-statement-example\" title=\"Anchor for Basic DROP TYPE statement example\">#<\/a><\/h2>\n\n\n\n<p>First, <a href=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-composite-types\/\">create a new type<\/a> called <code>contact<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TYPE<\/span> contact <span class=\"hljs-keyword\">AS<\/span> ( \n    phone <span class=\"hljs-type\">TEXT<\/span>, \n    email <span class=\"hljs-type\">TEXT<\/span> \n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.pgtutorial.com\/playground\/?q=Q1JFQVRFIFRZUEUgY29udGFjdCBBUyAocGhvbmUgVEVYVCwgZW1haWwgVEVYVCk7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Second, drop the <code>contact<\/code> type using the <code>DROP TYPE<\/code> statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">DROP<\/span> <span class=\"hljs-keyword\">TYPE<\/span> <span class=\"hljs-keyword\">IF<\/span> <span class=\"hljs-keyword\">EXISTS<\/span> contact;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.pgtutorial.com\/playground\/?q=RFJPUCBUWVBFIElGIEVYSVNUUyBjb250YWN0Ow%3D%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='dropping-user-defined-types-with-dependent-objects'>Dropping user-defined types with dependent objects <a href=\"#dropping-user-defined-types-with-dependent-objects\" class=\"anchor\" id=\"dropping-user-defined-types-with-dependent-objects\" title=\"Anchor for Dropping user-defined types with dependent objects\">#<\/a><\/h2>\n\n\n\n<p>First, create a new composite type called <code>address<\/code> that includes <code>city<\/code>, <code>street<\/code>, <code>zip_code<\/code>, <code>state<\/code>, and <code>country<\/code>: <\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TYPE<\/span> address <span class=\"hljs-keyword\">AS<\/span> (\n  city <span class=\"hljs-type\">VARCHAR<\/span>,\n  street <span class=\"hljs-type\">VARCHAR<\/span>,\n  zip_code <span class=\"hljs-type\">VARCHAR<\/span>,\n  state <span class=\"hljs-type\">VARCHAR<\/span>,\n  country <span class=\"hljs-type\">VARCHAR<\/span>\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.pgtutorial.com\/playground\/?q=Q1JFQVRFIFRZUEUgYWRkcmVzcyBBUyAoIGNpdHkgVkFSQ0hBUiwgc3RyZWV0IFZBUkNIQVIsIHppcF9jb2RlIFZBUkNIQVIsIHN0YXRlIFZBUkNIQVIsIGNvdW50cnkgVkFSQ0hBUiApOw%3D%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Second, <a href=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-create-table\/\">create a table<\/a> called <code>customers<\/code> to store customer information. The <code>customers<\/code> table uses the <code>address<\/code> type:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> customers (\n  id <span class=\"hljs-type\">INT<\/span> <span class=\"hljs-keyword\">GENERATED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-keyword\">DEFAULT<\/span> <span class=\"hljs-keyword\">AS<\/span> <span class=\"hljs-keyword\">IDENTITY<\/span>,\n  <span class=\"hljs-type\">name<\/span> <span class=\"hljs-type\">VARCHAR<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-keyword\">NULL<\/span>,\n  email <span class=\"hljs-type\">VARCHAR<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-keyword\">NULL<\/span>,\n  billing_address address,\n  shipping_address address\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.pgtutorial.com\/playground\/?q=Q1JFQVRFIFRBQkxFIGN1c3RvbWVycyAoIGlkIElOVCBHRU5FUkFURUQgQlkgREVGQVVMVCBBUyBJREVOVElUWSwgbmFtZSBWQVJDSEFSIE5PVCBOVUxMLCBlbWFpbCBWQVJDSEFSIE5PVCBOVUxMLCBiaWxsaW5nX2FkZHJlc3MgYWRkcmVzcywgc2hpcHBpbmdfYWRkcmVzcyBhZGRyZXNzICk7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Third, attempt to drop the <code>address<\/code> type:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">DROP<\/span> <span class=\"hljs-keyword\">TYPE<\/span> address;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.pgtutorial.com\/playground\/?q=RFJPUCBUWVBFIGFkZHJlc3M7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>PostgreSQL issues the following error:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">ERROR:  cannot drop type address because other objects depend on it\nDETAIL:  column shipping_address of table customers depends on type address\ncolumn billing_address of table customers depends on type address\nHINT:  Use DROP ... CASCADE to drop the dependent objects too.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The error shows that the <code>shipping_address<\/code> and <code>billing_address<\/code> columns of the <code>customers<\/code> table use the <code>address<\/code> type; therefore, you cannot drop it with <code>RESTRICT<\/code> (the default). You must use <code>DROP TYPE ... CASCADE<\/code> to drop dependent objects as well.<\/p>\n\n\n\n<p>If these columns have data and you want to keep it, you need to back up the table, change the type of these columns (e.g., to <code>TEXT<\/code>), and then drop the type <em>without<\/em> using the <code>CASCADE<\/code> option.<\/p>\n\n\n\n<p>Finally, drop the type <code>address<\/code> with the <code>CASCADE<\/code> option:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">DROP<\/span> <span class=\"hljs-keyword\">TYPE<\/span> address <span class=\"hljs-keyword\">CASCADE<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.pgtutorial.com\/playground\/?q=RFJPUCBUWVBFIGFkZHJlc3MgQ0FTQ0FERTs%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">NOTICE:  drop cascades to 2 other objects\nDETAIL:  drop cascades to column shipping_address of table customers\ndrop cascades to column billing_address of table customers<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The output shows that the statement dropped the <code>shipping_address<\/code> and <code>billing_address<\/code> columns from the <code>customers<\/code> table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>DROP TYPE<\/code> statement to remove a user-defined type from a database.<\/li>\n\n\n\n<li>Use the <code>IF EXISTS<\/code> option to avoid errors if the type does not exist.<\/li>\n\n\n\n<li>Carefully review the dependent objects before using the <code>CASCADE<\/code> option, as it will delete those objects as well.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='quiz'>Quiz <a href=\"#quiz\" class=\"anchor\" id=\"quiz\" title=\"Anchor for Quiz\">#<\/a><\/h2>\n\n\n\n<iframe loading=\"lazy\"\n  name=\"quiz\"\n  src=\"\/quiz\/?quiz=drop-type\"\n  height=\"700\"\n  width=\"600\"\n  class=\"iframe\"\n><\/iframe>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"1596\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/\"\n\t\t\t\tdata-post-title=\"PostgreSQL DROP TYPE Statement\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"1596\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/\"\n\t\t\t\tdata-post-title=\"PostgreSQL DROP TYPE Statement\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: In this tutorial, you will learn how to use the PostgreSQL DROP TYPE statement to remove a user-defined type from the database. Introduction to the PostgreSQL DROP TYPE statement # The DROP TYPE statement allows you to remove one or more user-defined data types from a database. Here&#8217;s the syntax of the DROP TYPE [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":13,"menu_order":91,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1596","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PostgreSQL DROP TYPE Statement<\/title>\n<meta name=\"description\" content=\"In this tutorial, you will learn how to use the PostgreSQL DROP TYPE statement to remove a user-defined type from the database.\" \/>\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.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PostgreSQL DROP TYPE Statement\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will learn how to use the PostgreSQL DROP TYPE statement to remove a user-defined type from the database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/\" \/>\n<meta property=\"og:site_name\" content=\"PostgreSQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-10T02:51:12+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-drop-type\\\/\",\"url\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-drop-type\\\/\",\"name\":\"PostgreSQL DROP TYPE Statement\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/#website\"},\"datePublished\":\"2025-01-10T02:45:44+00:00\",\"dateModified\":\"2025-01-10T02:51:12+00:00\",\"description\":\"In this tutorial, you will learn how to use the PostgreSQL DROP TYPE statement to remove a user-defined type from the database.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-drop-type\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-drop-type\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-drop-type\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pgtutorial.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PostgreSQL Tutorial\",\"item\":\"https:\\\/\\\/www.pgtutorial.com\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PostgreSQL DROP TYPE Statement\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/#website\",\"url\":\"https:\\\/\\\/www.pgtutorial.com\\\/\",\"name\":\"PostgreSQL Tutorial\",\"description\":\"Learn PostgreSQL from Scratch\",\"alternateName\":\"PostgreSQL\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pgtutorial.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PostgreSQL DROP TYPE Statement","description":"In this tutorial, you will learn how to use the PostgreSQL DROP TYPE statement to remove a user-defined type from the database.","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.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/","og_locale":"en_US","og_type":"article","og_title":"PostgreSQL DROP TYPE Statement","og_description":"In this tutorial, you will learn how to use the PostgreSQL DROP TYPE statement to remove a user-defined type from the database.","og_url":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/","og_site_name":"PostgreSQL Tutorial","article_modified_time":"2025-01-10T02:51:12+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/","url":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/","name":"PostgreSQL DROP TYPE Statement","isPartOf":{"@id":"https:\/\/www.pgtutorial.com\/#website"},"datePublished":"2025-01-10T02:45:44+00:00","dateModified":"2025-01-10T02:51:12+00:00","description":"In this tutorial, you will learn how to use the PostgreSQL DROP TYPE statement to remove a user-defined type from the database.","breadcrumb":{"@id":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-drop-type\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pgtutorial.com\/"},{"@type":"ListItem","position":2,"name":"PostgreSQL Tutorial","item":"https:\/\/www.pgtutorial.com\/"},{"@type":"ListItem","position":3,"name":"PostgreSQL DROP TYPE Statement"}]},{"@type":"WebSite","@id":"https:\/\/www.pgtutorial.com\/#website","url":"https:\/\/www.pgtutorial.com\/","name":"PostgreSQL Tutorial","description":"Learn PostgreSQL from Scratch","alternateName":"PostgreSQL","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pgtutorial.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/pages\/1596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/comments?post=1596"}],"version-history":[{"count":7,"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/pages\/1596\/revisions"}],"predecessor-version":[{"id":1603,"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/pages\/1596\/revisions\/1603"}],"up":[{"embeddable":true,"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/pages\/13"}],"wp:attachment":[{"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/media?parent=1596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}