Member-only story

REPLACE() string function — with examples in PostgreSQL

Josh Otwell
2 min readJun 12, 2019

--

String functions are quite useful for manipulating character and text data. Most SQL dialects have several different ones for different use cases so there is surely one (or two) to fit your needs. In this post, I’ll visit the function with examples in PostgreSQL.

Photo by Jason Leung on Unsplash

Note: All data, names or naming found within the database presented in this post, are strictly used for practice, learning, instruction, and testing purposes. It by no means depicts actual data belonging to or being used by any party or organization.

OS and DB used:

  • Xubuntu Linux 18.04.2 LTS (Bionic Beaver)
  • PostgreSQL 11.2

Self-Promotion:

If you enjoy the content written here, by all means, share this blog and your favorite post(s) with others who may benefit from or like it as well. Since coffee is my favorite drink, you can even buy me one if you would like!

I’ll use a couple of tables from the PostgreSQL practice DVD Rental database for the example queries below.

A while back, I wrote Useful String Function — REPLACE in MySQL with examples. I feel it’s only fair to provide the same for the PostgreSQL fanboy (in me) and like-minded fans of this great ecosystem as well.

Finish reading the post here…

Originally published at https://joshuaotwell.com on June 12, 2019.

--

--

Josh Otwell
Josh Otwell

Written by Josh Otwell

SQL/PHP | Photography | Technical Consultant. Sign-up for my free developer newsletter, OpenLampTech, here: openlamptech.substack.com

No responses yet