Skip to content

Tag: postgresql

The function processes the sql request

The function processes the sql request. It receives parameters and one of them can be either “null” or a value (uuid), I need to add this value to where. But there is a problem, because with null “where param is null”, but with the value “where param = value” Example Answer…

Convert Postgres IPv6 column TEXT field into JSON

Trying to convert a text field to a JSON field in Postgres. The field was an IPv6 address those having multiple semicolons e.g.: “14:eth1:vTA1:::4:” Trying to run smth like: Results in: Failed to convert text field to JSON. Details: invalid input syntax for type json DETAIL: Expected end of input,…

How to edit and return a Cursor in plpgsql?

I am doing a simple query inside a function, and I need to change the values ​​of this query, but only for information. I don’t need to update the table as such. I managed to edit the values ​​but I don’t know how to return them. And below this function will be executed As you can see, the query d…