PostgreSQL Tutorial

  • Home
  • Administration
  • Views
  • Triggers
  • Stored Procedures
Home / PostgreSQL Functions

PostgreSQL Functions

This section provides you with the most useful PostgreSQL functions including aggregate functions, string functions, and date & time functions.

PostgreSQL Aggregate Functions

  • PostgreSQL MIN – gets the minimum value of a set.
  • PostgreSQL MAX – gets the maximum value of a set.
  • PostgreSQL AVG – calculates average value of a numeric column.
  • PostgreSQL COUNT – counts the number of rows in a table.
  • PostgreSQL SUM – returns the sum of values or distinct values.

PostgreSQL Conditional Expressions & Operators

  • PostgreSQL CASE – shows you how to form conditional queries with CASE expression.
  • PostgreSQL COALESCE – returns the first non-null argument. You can use to substitute null value by another default value.
  • PostgreSQL NULLIF – returns a null value if the first argument equals to the second argument. We show you how to apply NULLIF function to substitute null values for displaying data and preventing query from division by zero error.
  • PostgreSQL CAST – converts from one data type into another e.g., from a string into an integer, from a string into date, from a string into date, etc.

PostgreSQL String Functions

PostgreSQL string functions and operators help you manipulate string values. Strings mean character, character varying, and text.

  • PostgreSQL SUBSTRING – extracts a substring from a string using start position and length, as well as regular expression.
  • PostgreSQL REPLACE – searches and replaces all occurrences of substrings with a new substring.
  • PostgreSQL LENGTH – returns the number of characters in a string. The OCTET_LENGTH, BIT_LENGTH, and CHAR_LENGTH functions are also covered.
  • PostgreSQL TRIM – removes the longest string that contains a character from the beginning, ending, and both beginning and ending of a string. We will also introduce you to the LTRIM, RTRIM, and BTRIM functions.
  • PostgreSQL CONCAT – shows you how to use CONCAT and CONCAT_WS functions to concatenate two or more strings into one.
  • PostgreSQL LOWER, UPPER, and INITCAP functions – gives you three useful string functions to format letter case of a string expression.
Previous Tutorial: PostgreSQL Views
Next Tutorial: PostgreSQL JDBC

PostgreSQL Quick Start

  • What is PostgreSQL?
  • Install PostgreSQL
  • Connect to Database
  • Download PostgreSQL Sample Database
  • Load Sample Database
  • Explore Server and Database Objects

PostgreSQL Aggregate Functions

  • PostgreSQL COUNT Function
  • PostgreSQL AVG Function
  • PostgreSQL MAX Function
  • PostgreSQL MIN Function
  • PostgreSQL SUM Function

PostgreSQL Conditional Expressions

  • PostgreSQL CASE
  • PostgreSQL NULLIF
  • PostgreSQL COALESCE

PostgreSQL String functions

  • PostgreSQL CONCAT Function
  • PostgreSQL TRIM Function
  • PostgreSQL LENGTH Function
  • PostgreSQL REPLACE
  • PostgreSQL Substring
  • PostgreSQL Letter Case Functions

PostgreSQL Operators

  • PostgreSQL CAST

About PostgreSQL Tutorial

PostgreSQLTutorial.com is a website dedicated to developers and database administrators who are working on PostgreSQL database management system.

We constantly publish useful PostgreSQL tutorials to keep you up-to-date with the latest PostgreSQL features and technologies. All PostgreSQL tutorials are simple, easy-to-follow and practical.

Recent PostgreSQL Tutorials

  • How To Call PostgreSQL Stored Function Using JDBC
  • The Beginner's Guide To PostgreSQL JDBC Transaction
  • How To Delete Data From A PostgreSQL Table Using JDBC
  • How To Update Data in PostgreSQL Database Using JDBC
  • The Complete Guide to Insert Data Into a Table Using JDBC
  • The Ultimate Guide to Query Data from The PostgreSQL Using JDBC
  • Connecting To The PostgreSQL Database
  • PostgreSQL JDBC
  • PL/pgSQL Function That Returns A Table
  • Using PostgreSQL CAST To Convert From One Data Type Into Another

More Tutorials

  • PostgreSQL Functions
  • PostgreSQL JDBC

Site Info

  • Home
  • About Us
  • Contact Us
  • PostgreSQL Resources
  • Privacy Policy

Copyright © 2016 by PostgreSQL Tutorial Website. All Rights Reserved.