in reply to Capturing warnings from DBD:PG

$dbh->quote($post_id) . "," .

A side point, if you don't mind: The code uses dynamic SQL. Instead of building the statement on the fly, please use placeholders instead. That is, something like:

my $cmd = "insert into latlong (post_id,some_text,geom) VALUES (?, ?, +?);" my $query_handle = $dbh->prepare($cmd); $query_handle->execute($post_id, $some_text, "ST_GeomFromText('POINT($ +LongDEC $LatDEC)', 4326)");

Using placeholders tends to be safer, more clear, and does not (usually) require special quoting.

Replies are listed 'Best First'.
Re^2: Capturing warnings from DBD:PG
by HeadScratcher (Novice) on Nov 26, 2015 at 10:31 UTC

    Yes I know however in the past I have had trouble with creating sql cmds that involve geometry entries using placeholders It is thought due to escaping internal quotes this method works for this kind of SQL. For all other SQL commands I use placeholders

      Hmm... I guess that could be a problem. But, it's still worthwhile to use placeholders. Better to escape characters than to escape security.

      A function may do you well though. A little longer just once, and more secure in every script.