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):
"metadata": {
"entry": {
"@key": "JDBC_VIRTUAL_TABLE",
"virtualTable": {
"name": "sgl_boundaries_view_3",
"sql": "select gi_id::text || '_3'::text as fake_id, gi_id
AS id, short_label, geom_3, feat_label, 3 as zoom from
terrascope.sgl_boundaries_view where sgl_id = *%sgl_id%*",
"escapeSql": true,
"keyColumn": "fake_id",
"geometry": {
"name": "geom_3",
"type": "MultiPolygon",
"srid": 4326,
"parameter": {
"defaultValue": 58,
"regexpValidator": "^[\\w\\d\\s]+$",*
"name": "sgl_id"*
}
}
}
}
},
And then the log says %id% instead.
I also got the json out of a workig sql view (which I created via the UI,
it's what I normally do to figure out the payload):
"metadata": {
"entry": {
"@key": "JDBC_VIRTUAL_TABLE",
"virtualTable": {
"name": "web2014_view2",
"sql": "select * from test.web2014all_mv where
intersection_related = %test%\n",
"escapeSql": false,
"geometry": {
"name": "geom3857",
"type": "Point",
"srid": 3857
},
"parameter": {
"name": "test",
"defaultValue": true,
"regexpValidator": "^[\\w\\d\\s]+$"
}
}
}
},
If you check carefully, the structure is different, in your case the
geometry object contains parameter, in my case parameter is at the same
level as geometry instead.
That would indeed explain what you're seeing, the json reader just ignores
the parts it does not understand so the parameter definition would be
skipped
Cheers
Andrea
On Thu, Feb 9, 2017 at 5:11 PM, David Haynes II <[email protected]> wrote:
> 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_id,
> gi_id AS id, short_label, geom, feat_label, 0 as zoom from
> terrascope.sgl_boundaries_view where sgl_id = %id%
>
> On Wed, Feb 8, 2017 at 7:56 PM, P O'Toole <[email protected]> wrote:
>
>> 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 request you're sending over?
>>
>> Have you checked your $PGDATA/pg_log/whatever.log file to see what's
>> actually being submitted to Postgres itself? That might offer some clues.
>>
>> - Patrick O'Toole
>>
>> Application Developer
>> Wyoming Natural Diversity Database
>> UW Berry Biodiversity Conservation Center
>> Department 3381, 1000 E. University Av.
>> Laramie, WY 82071
>> P: 307-766-3018
>>
>
>
>
> --
> David Haynes, Ph.D.
> Research Associate Terra Populus
> Minnesota Population Center
> 612-626-3933 <(612)%20626-3933>
> www.terrapop.org
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users