Preamble
The PostgreSQL translate function replaces a sequence of characters in a string with another set of characters. However, it replaces one character at a time.
For example, it replaces the first character in string_to_replace with the first character in replace_string. Then it will replace the second character in string_to_replace with the second character in replace_string, etc.
Syntax of the translate function in PostgreSQL
translate( string1, string_to_replace, replacement_string )
Parameters and function arguments
- string1 – String to replace the character sequence with another character set.
- string_to_replace – String that will search in string1.
- replacement_string – All characters in string_to_replace will be replaced by the corresponding characters in replace_string.
The translate function can be used in the following PostgreSQL versions
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 the translate function to understand how to use the translate function in PostgreSQL.
For example:
SELECT translate('Google.com', 'o', 'A');
--Result: "GAAgle.cAm"
SELECT translate('Google.com', 'oe', 'ABC');
--Result: "GAAglB.cAm"
SELECT translate('Google.com', 'e.c', '456');
--Result: 'Googl456om'
Learn PostgreSQL Tutorial; Full Course for Beginners
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
How Intelligent Database Analytics is Transforming Performance in BFSI Platforms
- 7 May 2026
- Database Performance Management
Introduction The Banking, Financial Services, and Insurance (BFSI) industry is undergoing a massive digital transformation. From mobile banking apps and real-time payment systems to AI-driven fraud detection and personalized financial services, modern financial platforms depend heavily on high-performance data infrastructure. At the center of this infrastructure lies the database layer, which processes millions of transactions, … Continue reading “How Intelligent Database Analytics is Transforming Performance in BFSI Platforms”
How Modern Financial Institutions Improve Data Infrastructure with Intelligent Database Analytics
- 6 May 2026
- Database Performance Management
The financial services industry has rapidly evolved into a highly digital and data-driven ecosystem. Modern financial institutions—including banks, fintech companies, and payment providers—depend heavily on data infrastructure to power services such as digital banking, mobile payments, fraud detection, algorithmic trading, and customer analytics. Every interaction within these platforms generates data that must be processed, analyzed, … Continue reading “How Modern Financial Institutions Improve Data Infrastructure with Intelligent Database Analytics”
How to Transform Media Sector Performance with Enteros Cost Estimation, Cost Attribution, and RevOps Efficiency
Introduction The media sector is experiencing a rapid transformation driven by digital platforms, streaming services, real-time content delivery, and data-driven audience engagement. From OTT platforms and digital publishing to live broadcasting and advertising ecosystems, media organizations must operate at scale while delivering high-quality, personalized experiences. However, this evolution comes with significant challenges. Massive volumes of … Continue reading “How to Transform Media Sector Performance with Enteros Cost Estimation, Cost Attribution, and RevOps Efficiency”
Building Resilient Financial Data Platforms with AI-Driven Database Analytics
Financial institutions are experiencing an unprecedented wave of digital transformation. From mobile banking and digital wallets to real-time payments and algorithmic trading, modern financial services rely heavily on high-performing and resilient data platforms. At the heart of these platforms lies the database infrastructure that powers transactions, customer interactions, and data-driven decision-making. However, as financial platforms … Continue reading “Building Resilient Financial Data Platforms with AI-Driven Database Analytics”