Page 1 of 1

Numeric Precision is not set correctly in postgresql

Posted: Tue 31 Jan 2017 21:37
by OutOfTouch6947
Hi,

I have been using a model first approach and I don't know what I need to do to set precision and scale in the database from the model, nothing I have tried works other than to set the precision and scale in the database and than update the model.

Here is an example of the script I ran to set the precision and scale in the database

Code: Select all

ALTER TABLE "TaxRatesMNVA" ALTER COLUMN "TaxRate" SET DATA TYPE NUMERIC(28,10);
I am using EntityDeveloper and dotConnect for postgresql.

Re: Numeric Precision is not set correctly in postgresql

Posted: Wed 01 Feb 2017 16:11
by Shalex
You are working with LinqConnect Model (*.lqml), aren't you?
OutOfTouch6947 wrote:I don't know what I need to do to set precision and scale in the database from the model
Please double click the required property in Model Explorer (or on diagram) to open Property Editor and set Server Data Type to data type with precision and scale: numeric(28,10) instead of just numeric.

Re: Numeric Precision is not set correctly in postgresql

Posted: Wed 01 Feb 2017 18:51
by OutOfTouch6947
Yes I am using the LinqConnect for postgresql model.

Re: Numeric Precision is not set correctly in postgresql

Posted: Wed 01 Feb 2017 18:59
by OutOfTouch6947
Shalex wrote:You are working with LinqConnect Model (*.lqml), aren't you?
OutOfTouch6947 wrote:I don't know what I need to do to set precision and scale in the database from the model
Please double click the required property in Model Explorer (or on diagram) to open Property Editor and set Server Data Type to data type with precision and scale: numeric(28,10) instead of just numeric.
Already tried what you suggested here before I created my ticket, please try to reproduce on your end or double check that this functions correctly. After doing this and updating the database using the model and checking the database I can clearly see that it is numeric but has no precision set.

Re: Numeric Precision is not set correctly in postgresql

Posted: Wed 01 Feb 2017 19:03
by OutOfTouch6947
OutOfTouch6947 wrote:
Shalex wrote:You are working with LinqConnect Model (*.lqml), aren't you?
OutOfTouch6947 wrote:I don't know what I need to do to set precision and scale in the database from the model
Please double click the required property in Model Explorer (or on diagram) to open Property Editor and set Server Data Type to data type with precision and scale: numeric(28,10) instead of just numeric.
Already tried what you suggested here before I created my ticket, please try to reproduce on your end or double check that this functions correctly. After doing this and updating the database using the model and checking the database I can clearly see that it is numeric but has no precision set.
It looks like it might a case issue for example NUMERIC(28,10) vs numeric(28,10)

Re: Numeric Precision is not set correctly in postgresql

Posted: Thu 02 Feb 2017 09:36
by Shalex
OutOfTouch6947 wrote:please try to reproduce on your end or double check that this functions correctly.
Tried and double checked: we cannot reproduce the issue.
OutOfTouch6947 wrote:After doing this and updating the database using the model and checking the database I can clearly see that it is numeric but has no precision set.
Please open the Script tab on the "View and execute script" step of Update To Database Wizard and make sure that DDL for creating/altering column includes precision and scale, e.g.:

Code: Select all

ALTER TABLE public.test_table
   ALTER COLUMN test_column TYPE NUMERIC(28,10);
If this doesn't help to narrow down and fix the problem, please send us a test model and specify the exact steps we should follow to reproduce the issue.

Re: Numeric Precision is not set correctly in postgresql

Posted: Tue 21 Feb 2017 18:40
by OutOfTouch6947
Shalex wrote:
OutOfTouch6947 wrote:please try to reproduce on your end or double check that this functions correctly.
Tried and double checked: we cannot reproduce the issue.
OutOfTouch6947 wrote:After doing this and updating the database using the model and checking the database I can clearly see that it is numeric but has no precision set.
Please open the Script tab on the "View and execute script" step of Update To Database Wizard and make sure that DDL for creating/altering column includes precision and scale, e.g.:

Code: Select all

ALTER TABLE public.test_table
   ALTER COLUMN test_column TYPE NUMERIC(28,10);
If this doesn't help to narrow down and fix the problem, please send us a test model and specify the exact steps we should follow to reproduce the issue.
I just got time to get back to this and it still is an issue, here is an example from the script tab, I can see it is not sending the correct script.

Code: Select all

CREATE TABLE public."TaxRatesMNVA" (
   "ZipCode" CHAR(6) NOT NULL,
   "TaxName" CHAR(30) NOT NULL,
   "TaxState" CHAR(2) NOT NULL,
   "TaxRate" DECIMAL,
   CONSTRAINT "PK_TaxRatesMNVA" PRIMARY KEY ("ZipCode")
);
Here is what I have on the Server Data Type of the column in the Model Designer: numeric(28,10)

Re: Numeric Precision is not set correctly in postgresql

Posted: Mon 27 Feb 2017 15:37
by Shalex
The Server Data Type of the column is reset NUMERIC(28,10) -> DECIMAL if you select the "Recreate Database Tables" option in Update To Database or Generate Database Script wizards.

If this doesn't help, send us a test model and specify the exact steps we should follow to reproduce the issue.