Preamble
The PostgreSQL replace function replaces all occurrences of the specified string.
Syntax of the replace function in PostgreSQL
replace( string, from_substring, to_substring )
Parameters and arguments
- string – Source line.
- from_substring – A search substring. All entries from_substring found in the string are replaced by to_substring.
- to_substring – Replacement of substring. All occurrences from_substring found in the string are replaced by to_substring.
Note:
- The replace function performs case sensitive replacement.
The replace function can be used in future versions of PostgreSQL
PostgreSQL 11, PostgreSQL 10, PostgreSQL 9.6, PostgreSQL 9.5, PostgreSQL 9.4, PostgreSQL 9.3, PostgreSQL 9.2, PostgreSQL 9.1, PostgreSQL 9.0, PostgreSQL 8.4.
Let’s look at some examples of replace functions to understand how to use the replace function in PostgreSQL.
For example:
SELECT replace('Google.com', 'Google', 'Bing');
--Result: Bing.com
SELECT replace('Google.com', 'google', 'bing');
--Result: Google.com
SELECT replace('abc abc', 'a', 'B');
--Result: Bbc Bbc
SELECT replace('abc abc', 'A', 'B');
--Result: abc abc
SQL String Functions Tutorial (LEFT, RIGHT, POSITION, CONCAT, LOWER, REPLACE)
About Enteros
Enteros offers a patented database performance management SaaS platform. It proactively identifies root causes of complex business-impacting database scalability and performance issues across a growing number of clouds, RDBMS, NoSQL, and machine learning database platforms.
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
Enhancing Database Performance and Scalability in Digital Banking Platforms with Advanced Analytics
- 14 May 2026
- Database Performance Management
Introduction Digital banking has transformed the financial services landscape. Customers now expect seamless mobile banking experiences, instant payments, real-time transaction confirmations, and 24/7 service availability. These modern banking services rely heavily on high-performance database infrastructures that support massive transaction volumes and complex analytics workloads. At the core of every digital banking interaction—whether it is a … Continue reading “Enhancing Database Performance and Scalability in Digital Banking Platforms with Advanced Analytics”
How Intelligent Database Analytics Improves Performance and Reliability in Modern E-Learning Platforms
Introduction The global shift toward digital education has transformed how institutions deliver learning experiences. Universities, online learning platforms, corporate training systems, and educational technology companies now rely heavily on digital platforms to deliver courses, manage learning data, and support millions of simultaneous users. Behind every online lecture, virtual classroom, exam submission, and learning analytics dashboard … Continue reading “How Intelligent Database Analytics Improves Performance and Reliability in Modern E-Learning Platforms”
How Intelligent Database Analytics Improves Performance and Scalability in Modern Retail Platforms
- 13 May 2026
- Database Performance Management
Introduction Retail has undergone a dramatic transformation over the past decade. Today’s retailers operate in a digital-first economy where customers expect fast, personalized, and seamless shopping experiences across multiple channels. From e-commerce platforms and mobile apps to in-store point-of-sale systems and inventory management tools, every component of modern retail relies on efficient data infrastructure. At … Continue reading “How Intelligent Database Analytics Improves Performance and Scalability in Modern Retail Platforms”
How to Accelerate Insurance Sector Growth with Enteros Cost Attribution and RevOps Strategy
Introduction The insurance industry is rapidly evolving as organizations embrace digital transformation, data-driven decision-making, and customer-centric business models. Modern insurers must deliver seamless digital experiences, process claims efficiently, personalize policy offerings, and maintain operational agility in an increasingly competitive market. At the same time, insurance companies face rising operational costs, growing regulatory complexity, and increasing … Continue reading “How to Accelerate Insurance Sector Growth with Enteros Cost Attribution and RevOps Strategy”