{"id":1661,"date":"2016-08-12T17:15:54","date_gmt":"2016-08-12T14:15:54","guid":{"rendered":"http:\/\/www.systemcodegeeks.com\/?p=1661"},"modified":"2017-12-04T16:04:51","modified_gmt":"2017-12-04T14:04:51","slug":"postgresql-commands-datatypes","status":"publish","type":"post","link":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/","title":{"rendered":"PostgreSQL commands and datatypes"},"content":{"rendered":"<p><em>This article is part of our Academy Course titled <a href=\"http:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-database-tutorial\/\">PostgreSQL Database Tutorial<\/a>.<\/p>\n<p>In this course, we provide a compilation of PostgreSQL tutorials that will help you set up and run your own database management system. We cover a wide range of topics, from installation and configuration, to custom commands and datatypes. With our straightforward tutorials, you will be able to get your own projects up and running in minimum time. Check it out <a href=\"http:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-database-tutorial\/\">here<\/a>!<\/em><\/p>\n<p>In our previous post (<a href=\"https:\/\/www.systemcodegeeks.com\/linux\/postgresql-introduction-installation\/\" target=\"_blank\">PostgreSQL: Introduction and installation<\/a>) we explained how to install and use a desktop and a web-based client to query a sample database we created and populated. We also introduced two basic commands to connect to a database (<code>\\c<\/code> followed by the database name) and to quit (<code>\\q<\/code>) the PostgreSQL prompt.<br \/>\n[ulp id=&#8217;mezv5fambxsNcQw8&#8242;]<\/p>\n<h2>PostgreSQL commands<\/h2>\n<p>In this tutorial we will introduce you to other useful PostgreSQL-specific (<strong>psql<\/strong> for short from now on) commands. To do so, let&#8217;s open the psql prompt by switching to the postgres Linux account and typing <code>psql<\/code> in the command line.<\/p>\n<h3>Getting help<\/h3>\n<p>Once in the psql prompt, type <code>help<\/code> and press Enter. The output should be similar to Fig. 1:<\/p>\n<figure id=\"attachment_1669\" aria-describedby=\"caption-attachment-1669\" style=\"width: 561px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/01.png\"><img decoding=\"async\" class=\"size-full wp-image-1669\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/01.png\" alt=\"Accessing the built-in PostgreSQL help\" width=\"561\" height=\"254\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/01.png 561w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/01-300x136.png 300w\" sizes=\"(max-width: 561px) 100vw, 561px\" \/><\/a><figcaption id=\"caption-attachment-1669\" class=\"wp-caption-text\">Figure 1 &#8211; Accessing the built-in PostgreSQL help<\/figcaption><\/figure>\n<p>The above figure shows the following tips &#8211; make sure you remember because they will come in handy more than once. If you need help with SQL commands, first off type <code>\\h<\/code> to view a list of the available options. Once you have identified the command you need help with, use <code>q<\/code> to return to the psql prompt and then type <code>\\h<\/code> followed by the SQL command you have chosen. For example, let&#8217;s say we chose <code>ALTER USER<\/code>. To see the help for that command, do<\/p>\n<pre class=\"brush:bash\">\\h ALTER USER<\/pre>\n<p>as shown in Fig. 2:<\/p>\n<figure id=\"attachment_1670\" aria-describedby=\"caption-attachment-1670\" style=\"width: 583px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/02.png\"><img decoding=\"async\" class=\"size-full wp-image-1670\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/02.png\" alt=\"Getting help about SQL commands\" width=\"583\" height=\"219\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/02.png 583w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/02-300x113.png 300w\" sizes=\"(max-width: 583px) 100vw, 583px\" \/><\/a><figcaption id=\"caption-attachment-1670\" class=\"wp-caption-text\">Figure 2 &#8211; Getting help about SQL commands<\/figcaption><\/figure>\n<p>On the other hand, if you get stuck with a database management task, do <code>\\?<\/code> and you will see the available psql commands grouped by categories, as seen in Fig. 3 (some of them are highlighted in yellow &#8211; the output is truncated for the sake of space):<\/p>\n<figure id=\"attachment_1671\" aria-describedby=\"caption-attachment-1671\" style=\"width: 711px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/03.png\"><img decoding=\"async\" class=\"size-full wp-image-1671\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/03.png\" alt=\"Getting help with psql commands\" width=\"711\" height=\"281\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/03.png 711w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/03-300x119.png 300w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><\/a><figcaption id=\"caption-attachment-1671\" class=\"wp-caption-text\">Figure 3 &#8211; Getting help with psql commands<\/figcaption><\/figure>\n<p>As before, type <code>q<\/code> to exit the help and return to the psql prompt.<\/p>\n<h3>Displaying databases and tables<\/h3>\n<p>If you find yourself examining a database server you haven&#8217;t previously worked with, or if you are not familiar with the structure of a given database, you may want to start off by listing the databases and their respective tables.<\/p>\n<p>To list the databases, simply do <code>\\l<\/code><\/p>\n<p>To view the tables in the <strong>World_db<\/strong> database (which is the one we imported in our previous tutorial), connect to it and type <code>\\dt<\/code><\/p>\n<p>Keep in mind that you can switch from a given database to another (Alberdi in the following example) with <code>\\c Alberdi<\/code><\/p>\n<p>The above commands are shown in Fig. 4 below:<\/p>\n<figure id=\"attachment_1672\" aria-describedby=\"caption-attachment-1672\" style=\"width: 780px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/04.png\"><img decoding=\"async\" class=\"size-full wp-image-1672\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/04.png\" alt=\"Listing databases and tables\" width=\"780\" height=\"514\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/04.png 780w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/04-300x198.png 300w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/04-768x506.png 768w\" sizes=\"(max-width: 780px) 100vw, 780px\" \/><\/a><figcaption id=\"caption-attachment-1672\" class=\"wp-caption-text\">Figure 4 &#8211; Listing databases and tables<\/figcaption><\/figure>\n<p>With the psql commands above we have learned to how to list databases and switch between one and another, how to list tables, and how to get help if we get stuck along the way.<\/p>\n<h2>PostgreSQL data types<\/h2>\n<p>As a preparation to creating our own databases and tables from scratch (which we will cover in an upcoming tutorial), we need to know how what are the allowed built-in, general-purpose data types for table fields. The <a href=\"https:\/\/www.postgresql.org\/docs\/9.5\/static\/datatype.html\" target=\"_blank\">PostgreSQL 9.5 documentation<\/a> lists the following data types and more:<\/p>\n<p>a) <strong>Numeric types<\/strong> (with corresponding storage sizes and ranges) are listed in Fig. 5:<\/p>\n<figure id=\"attachment_1673\" aria-describedby=\"caption-attachment-1673\" style=\"width: 779px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/05.png\"><img decoding=\"async\" class=\"size-full wp-image-1673\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/05.png\" alt=\"Numeric data types\" width=\"779\" height=\"179\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/05.png 779w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/05-300x69.png 300w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/05-768x176.png 768w\" sizes=\"(max-width: 779px) 100vw, 779px\" \/><\/a><figcaption id=\"caption-attachment-1673\" class=\"wp-caption-text\">Figure 5 &#8211; Numeric data types<\/figcaption><\/figure>\n<p>You will often choose a numeric type for fields that will store amounts of items, grade results, etc.<\/p>\n<p>b)<strong> Character types<\/strong> (see Fig. 6):<\/p>\n<p>These types are used to store regular (English) text or character strings, typically resulting from user interaction.<\/p>\n<figure id=\"attachment_1674\" aria-describedby=\"caption-attachment-1674\" style=\"width: 586px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/06.png\"><img decoding=\"async\" class=\"size-full wp-image-1674\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/06.png\" alt=\"Figure 6 - Character data types\" width=\"586\" height=\"85\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/06.png 586w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/06-300x44.png 300w\" sizes=\"(max-width: 586px) 100vw, 586px\" \/><\/a><figcaption id=\"caption-attachment-1674\" class=\"wp-caption-text\">Figure 6 &#8211; Character data types<\/figcaption><\/figure>\n<p>c) <strong>Date\/time types<\/strong> (see Fig. 7):<\/p>\n<p>These data types are used to indicate the date and or time when an event has been recorded in the database. If you require to store the time zone, there&#8217;s a dedicated type for that as well.<\/p>\n<figure id=\"attachment_1675\" aria-describedby=\"caption-attachment-1675\" style=\"width: 697px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/07.png\"><img decoding=\"async\" class=\"size-full wp-image-1675\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/07.png\" alt=\"Date\/time data types\" width=\"697\" height=\"194\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/07.png 697w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/07-300x84.png 300w\" sizes=\"(max-width: 697px) 100vw, 697px\" \/><\/a><figcaption id=\"caption-attachment-1675\" class=\"wp-caption-text\">Figure 7 &#8211; Date\/time data types<\/figcaption><\/figure>\n<p>d) <strong>Binary type<\/strong> (see Fig. 8):<\/p>\n<p>You will often use this type to indicate true\/false, active\/inactive, and enabled\/disabled statuses.<\/p>\n<figure id=\"attachment_1676\" aria-describedby=\"caption-attachment-1676\" style=\"width: 323px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/08.png\"><img decoding=\"async\" class=\"size-full wp-image-1676\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/08.png\" alt=\"Binary data type\" width=\"323\" height=\"106\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/08.png 323w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/08-300x98.png 300w\" sizes=\"(max-width: 323px) 100vw, 323px\" \/><\/a><figcaption id=\"caption-attachment-1676\" class=\"wp-caption-text\">Figure 8 &#8211; Binary data type<\/figcaption><\/figure>\n<p>Knowing the allowed ranges for each data type is essential to choosing the right type for fields. It is also critical as far as disk usage is concerned, as a 2-byte integer (<strong>smallint<\/strong>) will occupy less space than a 4-byte one (<strong>integer<\/strong>). As a rule of thumb, only use a &#8220;larger&#8221; data type if and only if a smaller type is not likely to scale well with the expected\u00a0 use and growth of the database in terms of record numbers.<\/p>\n<p>Also, the length of character fields must be taken into account while planning -for example- a web application that will gather data through forms or other types of input. While in certain cases users should not be allowed to enter text of indefinite length, you should plan ahead so that they can still enter all that is necessary. Although form validation and sanitization are out of the scope of this tutorial, you definitely will want to make sure that your application does not present security holes and is not abuse-prone.<\/p>\n<div class=\"tip\">The use of data types, among other things, contributes to data consistency in a table by ensuring that a given field will only accept the type of data it is configured to store.<\/div>\n<h2>Enumerated types<\/h2>\n<p>Besides the general purpose data types, PostgreSQL allows us to create our own data types in the form of static, ordered set of values (for example, the months of the year, or the days of the week), similarly to the enum type supported in several programming languages. We will see the benefit of enumerated types when we create our first database and start inserting data into it.<\/p>\n<h2>Summary<\/h2>\n<p>Now that you have learned how to use basic psql commands and have reviewed the most used data types, we are better prepared to dive deeper into PostgreSQL database administration. Stay tuned for the next tutorial!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will help you set up and run your own database management system. We cover a wide range of topics, from installation and configuration, to custom commands and datatypes. With our straightforward tutorials, &hellip;<\/p>\n","protected":false},"author":15,"featured_media":198,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[72,62],"class_list":["post-1661","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-postgresql","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PostgreSQL commands and datatypes - System Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will\" \/>\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.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PostgreSQL commands and datatypes - System Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/\" \/>\n<meta property=\"og:site_name\" content=\"System Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/systemcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/gacanepa\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-12T14:15:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-04T14:04:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Gabriel Canepa\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@gacanepa\" \/>\n<meta name=\"twitter:site\" content=\"@systemcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gabriel Canepa\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/\"},\"author\":{\"name\":\"Gabriel Canepa\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/967da353d0f1a1de21c9504942625a5f\"},\"headline\":\"PostgreSQL commands and datatypes\",\"datePublished\":\"2016-08-12T14:15:54+00:00\",\"dateModified\":\"2017-12-04T14:04:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/\"},\"wordCount\":1056,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\",\"keywords\":[\"Postgresql\",\"Ubuntu\"],\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/\",\"name\":\"PostgreSQL commands and datatypes - System Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\",\"datePublished\":\"2016-08-12T14:15:54+00:00\",\"dateModified\":\"2017-12-04T14:04:51+00:00\",\"description\":\"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will\",\"breadcrumb\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#primaryimage\",\"url\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\",\"contentUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.systemcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\/\/www.systemcodegeeks.com\/category\/databases\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PostgreSQL\",\"item\":\"https:\/\/www.systemcodegeeks.com\/category\/databases\/postgresql\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"PostgreSQL commands and datatypes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\",\"url\":\"https:\/\/www.systemcodegeeks.com\/\",\"name\":\"System Code Geeks\",\"description\":\"Operating System Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.systemcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.systemcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/systemcodegeeks\",\"https:\/\/x.com\/systemcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/967da353d0f1a1de21c9504942625a5f\",\"name\":\"Gabriel Canepa\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/27b3ea2a3fb1de4ed1c8694a1465c099a86586d8b833a0d852a26d76d750df9f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/27b3ea2a3fb1de4ed1c8694a1465c099a86586d8b833a0d852a26d76d750df9f?s=96&d=mm&r=g\",\"caption\":\"Gabriel Canepa\"},\"description\":\"Gabriel Canepa is a Linux Foundation Certified System Administrator (LFCS-1500-0576-0100) and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work. When he's not typing commands or writing code or articles, he enjoys telling bedtime stories with his wife to his two little daughters and playing with them, the great pleasure of his life.\",\"sameAs\":[\"http:\/\/www.gabrielcanepa.com.ar\/\",\"https:\/\/www.facebook.com\/gacanepa\",\"https:\/\/ar.linkedin.com\/in\/gacanepa\",\"https:\/\/x.com\/gacanepa\"],\"url\":\"https:\/\/www.systemcodegeeks.com\/author\/gabriel-canepa\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PostgreSQL commands and datatypes - System Code Geeks - 2026","description":"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will","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.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/","og_locale":"en_US","og_type":"article","og_title":"PostgreSQL commands and datatypes - System Code Geeks - 2026","og_description":"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will","og_url":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/","og_site_name":"System Code Geeks","article_publisher":"https:\/\/www.facebook.com\/systemcodegeeks","article_author":"https:\/\/www.facebook.com\/gacanepa","article_published_time":"2016-08-12T14:15:54+00:00","article_modified_time":"2017-12-04T14:04:51+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","type":"image\/jpeg"}],"author":"Gabriel Canepa","twitter_card":"summary_large_image","twitter_creator":"@gacanepa","twitter_site":"@systemcodegeeks","twitter_misc":{"Written by":"Gabriel Canepa","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#article","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/"},"author":{"name":"Gabriel Canepa","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/967da353d0f1a1de21c9504942625a5f"},"headline":"PostgreSQL commands and datatypes","datePublished":"2016-08-12T14:15:54+00:00","dateModified":"2017-12-04T14:04:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/"},"wordCount":1056,"commentCount":0,"publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","keywords":["Postgresql","Ubuntu"],"articleSection":["PostgreSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/","url":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/","name":"PostgreSQL commands and datatypes - System Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#primaryimage"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","datePublished":"2016-08-12T14:15:54+00:00","dateModified":"2017-12-04T14:04:51+00:00","description":"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will","breadcrumb":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#primaryimage","url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","contentUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.systemcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/www.systemcodegeeks.com\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"PostgreSQL","item":"https:\/\/www.systemcodegeeks.com\/category\/databases\/postgresql\/"},{"@type":"ListItem","position":4,"name":"PostgreSQL commands and datatypes"}]},{"@type":"WebSite","@id":"https:\/\/www.systemcodegeeks.com\/#website","url":"https:\/\/www.systemcodegeeks.com\/","name":"System Code Geeks","description":"Operating System Developers Resource Center","publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.systemcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.systemcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.systemcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/systemcodegeeks","https:\/\/x.com\/systemcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/967da353d0f1a1de21c9504942625a5f","name":"Gabriel Canepa","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/27b3ea2a3fb1de4ed1c8694a1465c099a86586d8b833a0d852a26d76d750df9f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/27b3ea2a3fb1de4ed1c8694a1465c099a86586d8b833a0d852a26d76d750df9f?s=96&d=mm&r=g","caption":"Gabriel Canepa"},"description":"Gabriel Canepa is a Linux Foundation Certified System Administrator (LFCS-1500-0576-0100) and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work. When he's not typing commands or writing code or articles, he enjoys telling bedtime stories with his wife to his two little daughters and playing with them, the great pleasure of his life.","sameAs":["http:\/\/www.gabrielcanepa.com.ar\/","https:\/\/www.facebook.com\/gacanepa","https:\/\/ar.linkedin.com\/in\/gacanepa","https:\/\/x.com\/gacanepa"],"url":"https:\/\/www.systemcodegeeks.com\/author\/gabriel-canepa\/"}]}},"_links":{"self":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/1661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/comments?post=1661"}],"version-history":[{"count":0,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/1661\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/media\/198"}],"wp:attachment":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/media?parent=1661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/categories?post=1661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/tags?post=1661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}