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

Moving data from stream to postgres with an infinity value

JO_9930585
6-Contributor

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?

1 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-infotab... 

@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