Save formula postgresql

Asked

Viewed 61 times

1

I have the following query

UPDATE teste SET
    equacao = 'X*254/1024+15.2', 
    zerar = False, 
    MinValid = 0.00 
WHERE id = 1 
RETURNING *

It runs normally, but when I get to the database the plus signal + vanishes: X*254/1024 15.2.

How should I modify the query so that the plus sign is saved as a character?

  • Why -1? Is any point unclear to me? Or should I edit something?

  • What kind of field equacao?

  • the guy is character varying

  • https://stackoverflow.com/q/7433201/540552

  • I don’t want the database to solve the formula, I just want it to save it as any text. Like any other string.

  • Very strange the + disappear. How are you performing the connection in the database and in which environment you are running it?

Show 1 more comment

1 answer

1

The problem was not in pgAdmin as I said, but in the php page that received the POST and performed the insertion. The + is converted to <espaço>, to use the character + it is necessary to exchange it for %2B in the parameter to be passed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.