Using PostgreSQL Functions in Real Projects with Python

Turtle Code
135 views •

In this video, we explore how to use PostgreSQL functions in a real-world scenario and how to call those functions directly from Python. We start by creating a simple products table, then write a PostgreSQL function that uses a SELECT query to calculate discounted prices. After testing the function inside PostgreSQL, we switch to Python and learn how to connect to a PostgreSQL database using psycopg2. You’ll see how easy it is to call a database function from Python and work with the returned results in your application. 0:00 - Introduction 0:13 - PostgreSQL: Creating Tables, Inserting Data & Functions 1:12 - Calling PostgreSQL Functions with Python 1:55 - Free Python & PostgreSQL Courses Source Code: https://github.com/turtlecode/postgresql-python-examples/blob/main/function.py ✔️ Free Courses: https://www.youtube.com/@turtlecode/courses ✔️ Join Channel: https://www.youtube.com/channel/UChc8lo6K1HPM4_WDjsMSH6g/join This tutorial is perfect if you want to understand how Python and PostgreSQL work together, how database functions are used in real projects, and how to keep business logic inside the database.

Keyboard shortcuts

On. Switch them off if they collide with your assistive tools; ? still opens this sheet.

Go to

Press g then the letter.

  • gh Latest
  • gs Sources
  • gm Media
  • gv Videos
  • gp Podcasts
  • gc Calendar
  • gd Decoder
  • gz Dataviz
  • ga Datasets
  • gb Blog
  • gk Markets
  • gj Careers
  • gn Prompt Notebook

On this page

  • / Focus search, where there is one
  • t Back to top
  • ? This list
  • Esc Close