Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7860389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:16:04+00:00 2026-06-02T22:16:04+00:00

Is there any function/stored procedure in PostgreSQL/plpgsql which is same as the javascripts encodeURI?

  • 0

Is there any function/stored procedure in PostgreSQL/plpgsql which is same as the javascripts encodeURI?

What does it mean? Javascript have a handy built in function to encode any kind of url:

encodeURI(url) -> returns the encoded url

For example:
encodeURI('http://hu.wikipedia.org/wiki/São_Paulo') -> returns a String which is "http://hu.wikipedia.org/wiki/S%C3%A3o_Paulo"

I looking for exactly the same.

I don’t want to encode each parameters separately. I don’t want a function like javascript encodeURIComponent which is not the same. The example above results a different output with

encodeURIComponent('http://hu.wikipedia.org/wiki/São_Paulo')

-> "http%3A%2F%2Fhu.wikipedia.org%2Fwiki%2FS%C3%A3o_Paulo"

It’s encode the whole string not just the path part. So this is not what I’m looking for. I need a plpgsql function which results equivalent output to javascript function encodeURI.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:16:05+00:00Added an answer on June 2, 2026 at 10:16 pm

    I wrote PostgreSQL extensions url_encode that solves this issue.

    postgres=# select url_encode('http://hu.wikipedia.org/wiki/São_Paulo');
                          url_encode                       
    ───────────────────────────────────────────────────────
    http%3A%2F%2Fhu.wikipedia.org%2Fwiki%2FS%C3%A3o_Paulo
    

    or

    postgres=# select uri_encode('http://hu.wikipedia.org/wiki/São_Paulo');
                   uri_encode                  
    ---------------------------------------------
    http://hu.wikipedia.org/wiki/S%C3%A3o_Paulo
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any built-it stored procedure / any database program by which I can
Is there any chance to create temporary stored procedure or function on MS SQL
Is there any function in C on linux by which we can query MX
Is there any function call to restart web application in c# ?? I mean
Is there any function that do the opposite job of QString::split() . I mean
I have a provided stored procedure (SP) that i should execute in tibco, which
I have a Function called dbo.GetFoo(). I also have a unit-testing Stored Procedure called
Is there any way to send functions as parameters to stored procedures? create procedure
I have a CLR stored procedure which is written .Net 3.5 due to the
is there any function in C++ that calculates a fingerprint or hash of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.