Re: [Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-10 Thread Andrea Aime
Awesome Cheers Andrea On Fri, Feb 10, 2017 at 4:10 PM, David Haynes II wrote: > Thanks so much Andrea for catching that mistake. > > Once, I made the modification to the JSON everything loaded fine. > > On Thu, Feb 9, 2017 at 2:25 AM, Andrea Aime > wrote: > >> Hi, >> I have made a quick test o

Re: [Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-10 Thread David Haynes II
Thanks so much Andrea for catching that mistake. Once, I made the modification to the JSON everything loaded fine. On Thu, Feb 9, 2017 at 2:25 AM, Andrea Aime wrote: > Hi, > I have made a quick test on the UI and I cannot seem to set the > "escapeSql" to true... have you tried flipping that swi

Re: [Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-09 Thread Andrea Aime
Hi David, it sort of seems the parameter is not being replaced but... I see a "id" value in there, and your previous definition had "sgl_id". >From your json, in readable form (took the payload and pasted it at http://jsonprettyprint.com/ , extracted the interesting part of the formatted result):

Re: [Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-09 Thread David Haynes II
The log is showing the same syntax error 2017-02-07 09:27:14 CST [1564-1] terrapop_v1_94_01032017_demo_green ERROR: syntax error at or near "%" at character 166 2017-02-07 09:27:14 CST [1564-2] terrapop_v1_94_01032017_demo_green STATEMENT: select * from (select gi_id::text || '_0'::text as fake_

Re: [Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-09 Thread David Haynes II
I tried set the escape sql property to false, still have the same error "escapeSql": false 2017-02-09 09:23:50,963 WARN [geoserver.catalog] - Error while getting feature type, flushing cache and retrying: Error looking up primary key 2017-02-09 09:23:50,979 WARN [geoserver.rest] - Could not res

Re: [Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-09 Thread Andrea Aime
Hi, I have made a quick test on the UI and I cannot seem to set the "escapeSql" to true... have you tried flipping that switch off? It caught my attention because I did not remember about it, and indeed I was not the one to add that functionality. Cheers Andrea On Wed, Feb 8, 2017 at 9:00 PM, Dav

Re: [Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-08 Thread P O'Toole
David - >I will try switching it to xml and see how that works. Are you sure the >> REST isn't skipping the java layer and submitting directly to PostgreSQL? >Hum... I did not write the REST api, but I cannot see how it might submit >direclty to postgresql, makes no sense. >Can you also share the

Re: [Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-08 Thread David Haynes II
Hello everyone, I guess this is more a question about how the REST API is functioning and if it is perhaps submitting information straight to PosgreSQL instead of encountering the java layer first and allowing it to submit to PostgreSQL Here is a JSON request that does not work This sql is buried

Re: [Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-08 Thread Andrea Aime
On Wed, Feb 8, 2017 at 8:03 PM, David Haynes II wrote: > I will try switching it to xml and see how that works. Are you sure the > REST isn't skipping the java layer and submitting directly to PostgreSQL? > Hum... I did not write the REST api, but I cannot see how it might submit direclty to pos

Re: [Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-08 Thread Andrea Aime
Hi David, I don't know what's going on, but generally speaking, the REST API is best used via XML payloads, the JSON ones have suffered from some hiccups here and there. Cheers Andrea On Tue, Feb 7, 2017 at 7:03 PM, David Haynes II wrote: > Hello, > > I am running into an error when creating a

[Geoserver-users] Error when creating SQL view with parameters via REST

2017-02-07 Thread David Haynes II
Hello, I am running into an error when creating an SQL view data layer via REST. The problem is encountered when trying to creating the SQL view parameter. I submit the following text below in my JSON object and PosgreSQL detects the '%' and it creates the error so no view is created. select gi_i