[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-686591-105":3,"detail-sidebar-cat-0-en-105":84,"doc-detail-686591-en":134,"doc-similar-686591":158},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":77,"head_meta":79,"extra_data":81,"updated_unix":83},105,"en","tutorial-3-postgresql","Tutorial 3 - PostgreSQL","","Tutorial 3 - PostgreSQL guides users through deploying a Java web app to Heroku and attaching a hobby-dev PostgreSQL add-on. It explains how to inspect Heroku database settings, credentials, and free database limits, then connects via heroku pg:psql to list databases and query system tables. The tutorial covers creating tables, understanding schemas and search_path behavior, and demonstrates schema creation and table creation using both search_path and fully qualified schema names.",{"@graph":14,"@context":76},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/tutorial-3-postgresql/686591/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/tutorial-3-postgresql/686591.png","ImageObject",300,407,{"name":42,"@type":43},"Guten Appetit_Joghurt","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-12","2026-11-07",true,{"@type":52,"interactionType":53,"userInteractionCount":30},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68,72],{"name":59,"@type":60,"acceptedAnswer":61},"How do you deploy the new_app1 project to Heroku?","Question",{"text":62,"@type":63},"From the project directory, log in to Heroku, create the app, and push the master branch to Heroku using heroku login, heroku create, and git push heroku master.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"How can you verify the PostgreSQL add-on and obtain connection details?",{"text":67,"@type":63},"Use heroku addons:create to add heroku-postgresql:hobby-dev, then run heroku config to check DATABASE_URL and HEROKU_POSTGRESQL_COLOR_URL. Retrieve credentials with heroku pg:credentials and note the dbname value.",{"name":69,"@type":60,"acceptedAnswer":70},"How do you connect to the Heroku-hosted PostgreSQL database using psql?",{"text":71,"@type":63},"Run heroku pg:psql, which connects to the PostgreSQL relational database in the cloud. The session then provides a psql prompt where you can use commands like \\l and SQL queries.",{"name":73,"@type":60,"acceptedAnswer":74},"What is the role of schemas and search_path when creating tables?",{"text":75,"@type":63},"Schemas group tables and objects within a database. By setting search_path (e.g., to test or public), CREATE TABLE statements create tables in that schema; using fully qualified names like test.reviews ensures the target schema regardless of search_path.","https://schema.org",{"og:url":32,"og:type":78,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":80,"canonical":32},"index,follow",{"doc_id":82,"site_id":7},686591,1794057380,{"code":4,"msg":85,"data":86},"success",[87,91,95,99,104,108,113,118,123,126,130],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":96,"show_sort_weight":97,"slug":98},"Exam",70,"exam",{"id":100,"doc_module":4,"doc_module_name":25,"category_name":101,"show_sort_weight":102,"slug":103},5,"Comic",60,"comic",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":106,"slug":107},6,50,"technology",{"id":109,"doc_module":4,"doc_module_name":25,"category_name":110,"show_sort_weight":111,"slug":112},7,"Healthcare",40,"healthcare",{"id":114,"doc_module":4,"doc_module_name":25,"category_name":115,"show_sort_weight":116,"slug":117},8,"Research & Report",30,"research-report",{"id":119,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":121,"slug":122},9,"Religion & Spirituality",20,"religion-spirituality",{"id":121,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":121,"slug":125},"World Cup","world-cup",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":127,"slug":129},10,"Lifestyle","lifestyle",{"id":131,"doc_module":4,"doc_module_name":25,"category_name":132,"show_sort_weight":100,"slug":133},19,"General","general",{"code":4,"msg":85,"data":135},{"doc_id":82,"user_id":136,"nickname":42,"user_avatar":137,"doc_module":4,"category_id":105,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":138,"file_id":139,"file_url":140,"file_type":141,"file_size":142,"view_count":30,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":143,"language":144,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":145,"faqs":146,"seo_title":147,"seo_description":12,"update_tm":83,"read_time":148,"preview_page_count":26,"preview_urls":149},1374408768420,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","TCSS 360: Software Development Institute of Technology  \nand Quality Assurance Techniques University of Washington – Tacoma  \nWinter 2017  \n[http://faculty.washington.edu/wlloyd/courses/tcss360](http://faculty.washington.edu/wlloyd/courses/tcss360)  \nTutorial 3 – PostgreSQL  \nThe purpose of this tutorial is to provide an overview of using postgreSQL a relational SQL database hosted via Heroku.  \n1. Deploy new_app1 as a heroku project  \nOn the command line,“cd” into your Java web application that you've created for your group project in tutorial \\#2 . This should be called “new_app1”.  \n\u003C\u003C note this tutorial can be done individually from sample_maven_web_app from tutorial \\#1 >>  \nSince this is a new source project, go ahead and deploy/build this project to heroku:  \nheroku login  \nheroku create  \ngit push heroku master  \n2. Add the heroku postgresql plugin to your heroku project  \nNow add the postgresl add on to your heroku project:  \n heroku addons:create heroku-postgresql:hobby-dev  Check the DATABASE_URL and HEROKU_POSTGRESQL_COLOR_URL settings  \n heroku config   \nCheck out the pginfo  \nheroku pg:info  \nThis shows information about the database we've created on heroku. The free databases are limited to:  \nA maximum of 20 user connections  \nA maximum of 10,000 rows of data  \nCheck out the automatically created database credentials:  \nheroku pg:credentials  \nYour credentials should appear as below:  \n$ heroku pg:credentials Connection info string:  \n\"dbname=d19m0j1erhvr7v host=ec2-54-235-204-221.compute-1.amazonaws.com  \nport=5432 user=wxojhmodfpbmsv password=80cfef5defecd78ff44e5e2bab48a26b06f930d1f57e097a6be957be98358c53 sslmode=require\"  \nConnection URL:  \npostgres://wxojhmodfpbmsv: 80cfef5defecd78ff44e5e2bab48a26b06f930d1f57e097a6be9 57be98358c53@ec2-54-235-204-221.compute-1.amazonaws.com:5432/d19m0j1erhvr7v  \nNote the value of “dbname”.  \nEither write this down, or save it in your clipboard, or in a text file for easy retrieval.  \n3. Next, let's explore the pgsql command line  \nPostgreSQL one of the leading open source databases has a full feature command-line interface which enables interaction with a database. The advantage with using the command line is that it is possible to fully script everything you would ever need to do with the database by writing “.sql” files.  \nFirst let's try out using the psql command line to explore our new heroku hosted postgreSQL database.  \nHeroku is once again great. Heroku let's you access psql without even installing it locally! Normally if you were to connect to a postgresql database that is not hosted on your computer, you would have to install the command-line client.  \nTo invoke psql via heroku:  \nheroku pg:psql  \nThis should connect you to your postgresql relational database hosted by heroku in the cloud!  \n--> Connecting to postgresql-globular-28873 psql (9.1.24, server 9.6.1)  \nWARNING: psql version 9.1, server version 9.6.  \nSome psql features might not work.  \nSSL connection (cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256) Type \"help\" for help.  \nobscure-ravine-82904::DATABASE=>  \nNow let's list the databases on this server. Type “back-slash” followed by lower-case L.  \n\\l  \nOh my. That's a lot of databases!  \nWhich one is ours?  \nIn order to provide postgresql-as-a-service in the cloud, they've backed a large number of free databases onto a single database server.  \nNow let's try to query this information from the system table:  \nselect * from pg_database;  \nHere's all that data again!  \nHow many rows are there?   Let's refine the query to only see our database:  \nselect * from pg_database where datname='{put the name of your database here}';  \nNow you should only see one row, for our database.  \nThis provides metadata that describes attributes about our specific database.  \n4. Creating tables and schemas  \nNow, let's look at what tables exist in our database.  \n\\dt  \nThere aren't any.  \nLet's create one:  \nCREATE TABLE films (  \ncode char(5),  \ntitle varchar(40),  \ndid inte","cbCaitlPfro3XwKy","https://ap.wps.com/l/cbCaitlPfro3XwKy","pdf",351862,11,"English","# Deploy new_app1 as a Heroku project\n# Add the Heroku PostgreSQL plugin\n## Check database settings and credentials\n# Explore the psql command line\n## Connect with heroku pg:psql\n## List databases and query pg_database\n# Creating tables and schemas\n## Create tables in public schema\n## Understand schemas and search_path\n## Create schema test and create tables","[{\"question\":\"How do you deploy the new_app1 project to Heroku?\",\"answer\":\"From the project directory, log in to Heroku, create the app, and push the master branch to Heroku using heroku login, heroku create, and git push heroku master.\"},{\"question\":\"How can you verify the PostgreSQL add-on and obtain connection details?\",\"answer\":\"Use heroku addons:create to add heroku-postgresql:hobby-dev, then run heroku config to check DATABASE_URL and HEROKU_POSTGRESQL_COLOR_URL. Retrieve credentials with heroku pg:credentials and note the dbname value.\"},{\"question\":\"How do you connect to the Heroku-hosted PostgreSQL database using psql?\",\"answer\":\"Run heroku pg:psql, which connects to the PostgreSQL relational database in the cloud. The session then provides a psql prompt where you can use commands like \\\\l and SQL queries.\"},{\"question\":\"What is the role of schemas and search_path when creating tables?\",\"answer\":\"Schemas group tables and objects within a database. By setting search_path (e.g., to test or public), CREATE TABLE statements create tables in that schema; using fully qualified names like test.reviews ensures the target schema regardless of search_path.\"}]","Tutorial 3 - PostgreSQL | PDF",28,[150,154],{"page_no":22,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/35bd0077ca9f1902c172e73520b4c041.webp",983,1272,{"page_no":26,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/37ddeaf88bd113b0693adcafa488843d.webp",982,1270,{"list":159,"token":11},[160,166,173,179,185,191,197,203,210,216],{"doc_id":161,"doc_title":162,"file_type":141,"home_preview_img_url":163,"slug":164,"view_count":100,"category_name":29,"create_tm":165},655956,"PostgreSQL Sample Database - DVD Rental ER Diagram","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975294905/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796114219&Signature=1JwKTQB0iyNEgXJEpMzBs1S8AjQ%3D","postgresql-sample-database-dvd-rental-er-diagram",1792965083,{"doc_id":167,"doc_title":168,"file_type":141,"home_preview_img_url":169,"slug":170,"view_count":171,"category_name":29,"create_tm":172},656124,"Oracle AI Database - Database Sample Schemas - About This Content","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229974785465/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796114219&Signature=jHjsk7Y2HM7saz4ukw524eKJUZA%3D","oracle-ai-database-database-sample-schemas-about-this-content",14,1792966533,{"doc_id":174,"doc_title":175,"file_type":141,"home_preview_img_url":176,"slug":177,"view_count":33,"category_name":29,"create_tm":178},686598,"PostgreSQL 16.15 Documentation - Legal Notice - Table of Contents","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000540954/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796114219&Signature=8XKlPzWfaVwwPLgbIBb%2BGv%2B9BRE%3D","postgresql-1615-documentation-legal-notice-table-of-contents",1794057395,{"doc_id":180,"doc_title":181,"file_type":141,"home_preview_img_url":182,"slug":183,"view_count":26,"category_name":29,"create_tm":184},763505,"Practical SQL - A Beginner’s Guide to Storytelling with Data","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230047154823/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796114219&Signature=COAkjrQPKse9Fg0LNbQ5SDOw34A%3D","practical-sql-a-beginners-guide-to-storytelling-with-data",1796034070,{"doc_id":186,"doc_title":187,"file_type":141,"home_preview_img_url":188,"slug":189,"view_count":33,"category_name":29,"create_tm":190},692254,"Oracle/SQL Tutorial 1","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003050321/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796114219&Signature=%2BlJrdifcFhey%2FVLvKbLDEl%2Fg%2Br8%3D","oraclesql-tutorial-1",1794187824,{"doc_id":192,"doc_title":193,"file_type":141,"home_preview_img_url":194,"slug":195,"view_count":105,"category_name":29,"create_tm":196},686595,"PostgreSQL Course - Start using PostgreSQL","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001041983/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796114219&Signature=S3iTy4YDajIp9yfZfGErS1zzEso%3D","postgresql-course-start-using-postgresql",1794057390,{"doc_id":198,"doc_title":199,"file_type":141,"home_preview_img_url":200,"slug":201,"view_count":33,"category_name":29,"create_tm":202},686593,"PostgreSQL for Oracle and MySQL DBAs - Introduction to PostgreSQL for Oracle and MySQL DBAs","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001041961/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796114219&Signature=63SUeOWi%2FUqaU9Mkq%2FQW2MTF1YI%3D","postgresql-for-oracle-and-mysql-dbas-introduction-to-postgresql-for-oracle-and-mysql-dbas",1794057381,{"doc_id":204,"doc_title":205,"file_type":141,"home_preview_img_url":206,"slug":207,"view_count":208,"category_name":29,"create_tm":209},656132,"Oracle Database Sample Schemas 12c Release 2 (12.2) - License and Documentation Notice - Contents","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975300914/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796114219&Signature=jInlYQLgGh08fim6FIYWrIY2t70%3D","oracle-database-sample-schemas-12c-release-2-122-license-and-documentation-notice-contents",12,1792966551,{"doc_id":211,"doc_title":212,"file_type":141,"home_preview_img_url":213,"slug":214,"view_count":119,"category_name":29,"create_tm":215},656146,"DBMS UNIT III - Database Management Systems - Unit 3","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975301649/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796114219&Signature=QOaCxGmqttRsV%2B4Xi2c0dKePcFg%3D","dbms-unit-iii-database-management-systems-unit-3",1792966705,{"doc_id":217,"doc_title":218,"file_type":141,"home_preview_img_url":219,"slug":220,"view_count":33,"category_name":29,"create_tm":221},692256,"Cancer Analysis System (CAS) Guidance - Getting started with SQL and extracting data","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003050380/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796114219&Signature=YJ5J7aliCd4kbwsk1%2B8H1rpPWqQ%3D","cancer-analysis-system-cas-guidance-getting-started-with-sql-and-extracting-data",1794187826]