Skip to content

Getting errors when inserting numeric (9,6) value. inconsistent types deduced for parameter #1205

@0radek

Description

@0radek

I am using postGIS but I also have a need to store the raw lat and lng values.

My req.body looks like this:

{
	"kind": 3
  	"lat": "33.155631",
  	"lng": "-118.236325"
}

If I try to insert, I get an inconsistent types deduced for parameter error.

Something like:

client.query(
      'INSERT INTO test(kind, lat, lng)\
       values($1, $2, $3)',
      [
        data.kind,
        data.lat,
        data.lng
      ],
  ////
)
name: 'error',
  length: 156,
  severity: 'ERROR',
  code: '42P08',
  detail: 'double precision versus numeric',
  hint: undefined,
  position: '99',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_param.c',
  line: '221',
  routine: 'variable_coerce_param_hook' }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions