cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Moving data from stream to postgres with an infinity value

JO_9930585
12-Amethyst

Moving data from stream to postgres with an infinity value

I am migrating streams to postgres and I have some columns which contain infinity values. I changed the schema in postgres to double precision, which does allow inifinity values. However, I get the error "JSON does not allow non-finite numbers." when I try to move my stream into here and it has an infinity value. How do I migrate a stream with inifinity for some values into postgres?

ACCEPTED SOLUTION

Accepted Solutions

@JO_9930585 ,

 

This is a case where you'll need to use the <<>> brackets around your SQL command inputs instead of the [[ ]] square brackets.  Ex:

insert into myTable (uid, value1, value2) VALUES
([[uid]], <<numberValue1>>, <<numberValue2>>)

 

numberValue1 and numberValue2 should then be STRING inputs.  Now you'll be able to use the "Infinity" keyword that works with the postgresql database.

 

-Nick

View solution in original post

2 REPLIES 2

 Hi,

 

There was a similar question before - "JSON does not allow non-finite numbers for infotable creation": https://community.ptc.com/t5/ThingWorx-Developers/JSON-does-not-allow-non-finite-numbers-for-infotable-creation/td-p/760542 

@JO_9930585 ,

 

This is a case where you'll need to use the <<>> brackets around your SQL command inputs instead of the [[ ]] square brackets.  Ex:

insert into myTable (uid, value1, value2) VALUES
([[uid]], <<numberValue1>>, <<numberValue2>>)

 

numberValue1 and numberValue2 should then be STRING inputs.  Now you'll be able to use the "Infinity" keyword that works with the postgresql database.

 

-Nick

Announcements


Top Tags