Errors you'll see if a RestTemplate
isn't defined
Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.
or
No qualifying bean of type
CriteriaBuilder cb = new CriteriaBuilder(); | |
// = SELECT * FROM entity WHERE JSON_EXTRACT("json_column", "$.path") | |
Root<entity> root; | |
cb.equal( | |
cb.function("JSON_EXTRACT", Integer.class, root.get("json_column"), "$.path"), | |
100); |
Errors you'll see if a RestTemplate
isn't defined
Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.
or
No qualifying bean of type
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)<?php | |
header('Content-Type: application/json; charset=UTF-8'); | |
/** | |
* PostGIS to GeoJSON | |
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc. | |
* | |
* @param string $geotable The PostGIS layer name *REQUIRED* | |
* @param string $geomfield The PostGIS geometry field *REQUIRED* | |
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)* | |
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |