Search code examples
postgresql-9.4postgrest

PostgREST filter returns incorrect results when value contains a space


Using current version of PostgREST (v.0.3.2.0), attempting a very simple GET call:

Db contains two records with the following accountNames: "Account 1" and "Account #2".

This works:

GET localhost:3000/accounts?accountName=eq.Account 1 

==> proper data is retrieved.

This does NOT work:

GET localhost:3000/accounts?accountName=eq.Account #2  

==> NO data is retrieved. Obviously the # character prevents the filter from working properly.

Is there a way around this problem?


Solution

  • /accounts?accountName=eq.Account%20%232. Use Urlencoding.