· 1 min read

Select Basename in Postgres SQL

Postgres doesn't have a basename function per se. But it's easy to accomplish.

select regexp_replace('http://www.seanbehan.com/images/logo.png', '.+/', '') ;
-- Will return logo.png

1 comment

  • Mark

    Nice. Just what i needed!

Leave a comment