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

Wrong type detection in PostgreSQL #163

Closed
dohnal opened this issue Feb 11, 2017 · 1 comment
Closed

Wrong type detection in PostgreSQL #163

dohnal opened this issue Feb 11, 2017 · 1 comment

Comments

@dohnal
Copy link

@dohnal dohnal commented Feb 11, 2017

  • bug report? yes
  • feature request? no
  • version: v2.4.1

Description

Data type detection does not accept all postgres supported timestamp types as "time" types. Here, postgres type "TIMESTAMP WITH TIME ZONE" is interpreted as string.

Steps To Reproduce

Create a table with two columns "TIMESTAMP" and "TIMESTAMP WITH TIME ZONE". Insert a record and compare the results in ActiveRow object -- the first column will be OK, the second will be string.

Fix is simple -- update Helpers.php as follows:
Changing the $typePatterns array on line with '(SMALL)?DATETIME(OFFSET)?\d*|TIME(STAMP)?' by adding .* after "STAMP".

@JanTvrdik
Copy link
Contributor

@JanTvrdik JanTvrdik commented Feb 20, 2017

Thank you @dg

WyskyNet pushed a commit to trigama/nette-database that referenced this issue May 30, 2018
WyskyNet pushed a commit to trigama/nette-database that referenced this issue Jun 1, 2018
WyskyNet pushed a commit to trigama/nette-database that referenced this issue Jun 1, 2018
dg pushed a commit that referenced this issue Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants