Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql 15 - syntax sensitivity

Tags:

postgresql

I've noticed that in older version of PG (example 13) when I had query like:

select 1 where 1=1and 2=2

all was OK

but i try this in PG 15 I get error: trailing junk after numeric literal at or near "1a"

Have something changed or maybe there is a new option in configuration to make it more strict ?

like image 232
Stepel Avatar asked Oct 25 '25 08:10

Stepel


1 Answers

This was changed in v 15.0.

From the release notes:

Prevent numeric literals from having non-numeric trailing characters (Peter Eisentraut)

Previously, query text like 123abc would be interpreted as 123 followed by a separate token abc.

and similar

Adjust JSON numeric literal processing to match the SQL/JSON-standard (Peter Eisentraut)

This accepts numeric formats like .1 and 1., and disallows trailing junk after numeric literals, like 1.type().

like image 195
snakecharmerb Avatar answered Oct 26 '25 23:10

snakecharmerb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!