Fix save_properties on Postgres

“CALL save_property(.)” does not work (tested with Postgres 9.6):
SQL Error [42601]: ERROR: syntax error at or near "CALL"
  Position: 1
  org.postgresql.util.PSQLException: ERROR: syntax error at or near "CALL"
  Position: 1
This commit is contained in:
Stefan Neuhaus
2017-07-29 19:49:32 +02:00
parent 2753bb97c8
commit c6c194dddb
2 changed files with 3 additions and 3 deletions

View File

@@ -512,7 +512,7 @@ public final class CveDB implements AutoCloseable {
if (mergeProperty != null) {
mergeProperty.setString(1, key);
mergeProperty.setString(2, value);
mergeProperty.executeUpdate();
mergeProperty.execute();
} else {
// No Merge statement, so doing an Update/Insert...
final PreparedStatement updateProperty = getPreparedStatement(UPDATE_PROPERTY);

View File

@@ -12,5 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
MERGE_PROPERTY=CALL save_property(?, ?)
CLEANUP_ORPHANS=DELETE FROM cpeEntry WHERE id IN (SELECT id FROM cpeEntry LEFT JOIN software ON cpeEntry.id = software.CPEEntryId WHERE software.CPEEntryId IS NULL);
MERGE_PROPERTY=SELECT save_property(?, ?)
CLEANUP_ORPHANS=DELETE FROM cpeEntry WHERE id IN (SELECT id FROM cpeEntry LEFT JOIN software ON cpeEntry.id = software.CPEEntryId WHERE software.CPEEntryId IS NULL);