Skip to content

Fix postgresql integer columns - #52

Merged
dresende merged 1 commit into
dresende:masterfrom
locomote:postgres-integers
Feb 24, 2013
Merged

dresende merged 1 commit into
dresende:masterfrom
locomote:postgres-integers

Conversation

@dxg

@dxg dxg commented Feb 24, 2013

Copy link
Copy Markdown
Collaborator

Version: 2.0.2, Database: PostgreSQL

db.define('house', {
  toiletCount: { type: 'number', rational: false }
}).sync();

executes:

CREATE TABLE "house"(
 "id"               SERIAL PRIMARY KEY,
 "toiletCount"  NUMERIC(0)
);

which results in:
ERROR: NUMERIC precision 0 must be between 1 and 1000

INTEGER is a much better choice; From the PostgreSQL docs:

...arithmetic on numeric values is very slow compared to the integer types...

@dresende

Copy link
Copy Markdown
Owner

Thank you :)

dresende added a commit that referenced this pull request Feb 24, 2013
@dresende
dresende merged commit b0d4627 into dresende:master Feb 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants