synth icon indicating copy to clipboard operation
synth copied to clipboard

bug: generating numeric for postgres gives 'invalid sign' error

Open chesedo opened this issue 3 years ago • 1 comments

Describe the bug When filling a numeric postgres column I am getting an 'invalid sign' error.

To Reproduce Steps to reproduce the behavior:

  1. Schema (postgres)
CREATE TABLE test
(
	length numeric
)
  1. Schema (Synth)
{
  "type": "array",
  "length": 1,
  "content": {
    "type": "object",
    "length": {
      "type": "number",
      "subtype": "f64"
    }
  }
}
  1. See error
Error: At namespace "numeric"

Caused by:
    0: Failed to insert data for collection test
    1: One or more database inserts failed: error returned from database: invalid sign in external "numeric" value: invalid sign in external "numeric" value
  1. Error (postgres logs)
2021-12-23 07:43:56.503 UTC [104] ERROR:  invalid sign in external "numeric" value
2021-12-23 07:43:56.503 UTC [104] CONTEXT:  unnamed portal parameter $1
2021-12-23 07:43:56.503 UTC [104] STATEMENT:  INSERT INTO test (length) VALUES
	($1);

Expected behavior According to the postgres integration page I expect to be able to fill a numeric postgres column with a f64 synth type.

Environment (please complete the following information):

  • OS: Linux
  • Version: 0.6.2

Additional context A successful fix should restore this e2e test

chesedo avatar Dec 23 '21 07:12 chesedo

I haven't created another issue since this is the exact same problem I'm facing.

Is there any workaround for this @chesedo ?

It's a critical point for our test data to use numeric type in a certain column and if there's no solution to pass this, we will need to abandon using Synth completely.

I would very much appreciate any input on this issue.

Thank you!

eadsoy avatar Mar 08 '22 05:03 eadsoy