Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero precision in timestamp/datetime #4784 #4786

Merged

Conversation

OlivierCavadenti
Copy link
Collaborator

@@ -72,22 +72,13 @@ class ColumnCompiler_PG extends ColumnCompiler {
useTz = !withoutTz;
}
useTz = typeof useTz === 'boolean' ? useTz : true;
precision = precision ? '(' + precision + ')' : '';
precision = precision !== undefined ? '(' + precision + ')' : '';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also check for null here?

precision = precision ? '(' + precision + ')' : '';

return `${useTz ? 'timestamptz' : 'timestamp'}${precision}`;
return this.datetime(withoutTz, precision);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch!

@kibertoad
Copy link
Collaborator

@OlivierCavadenti If you think we need to release it as a hotfix, we should also backport it to 0.95 branch.

@OlivierCavadenti
Copy link
Collaborator Author

@OlivierCavadenti If you think we need to release it as a hotfix, we should also backport it to 0.95 branch.

yes we can. do you have any conventation (naming, ...) to make the backport ?

@kibertoad
Copy link
Collaborator

@OlivierCavadenti I don't think we have one. Also feel free to merge approved PRs at your convenience!

@OlivierCavadenti OlivierCavadenti merged commit a431485 into knex:master Oct 30, 2021
OlivierCavadenti added a commit to OlivierCavadenti/knex that referenced this pull request Oct 30, 2021
OlivierCavadenti added a commit to AbeonaPascha/knex that referenced this pull request Nov 4, 2021
@OlivierCavadenti OlivierCavadenti deleted the precision-zero-timestamp-4784 branch December 20, 2021 22:18
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.

Can's set zero precision to timestamp
2 participants