node-postgres icon indicating copy to clipboard operation
node-postgres copied to clipboard

Pg suffers from Y10K problem

Open moll opened this issue 13 years ago • 9 comments

This is because of dateMatcher in textParsers.js expects years to be 4 characters. https://en.wikipedia.org/wiki/Y10K

moll avatar Sep 15 '13 23:09 moll

Thanks for reporting the problem. Can you provide us with a few lines of code to reproduce the problem or a failing test case?

booo avatar Sep 16 '13 08:09 booo

Well, just create a date column in the database and insert a date above 10K there. ;)

moll avatar Sep 16 '13 09:09 moll

Something like:

SELECT DATE '20000-01-01'

booo avatar Sep 17 '13 07:09 booo

Can this be handled in another few thousand years?

domino14 avatar Dec 09 '13 19:12 domino14

Sadly, no. Unless all PostgreSQL users so far have been religious, the world also started more than 10k years ago. ;)

moll avatar Dec 09 '13 21:12 moll

Unfortunately PostgreSQL does not support dates early than 4713 BCE (see manual). However I did fix pg's y10k issue with pull request #480 so you can record your pet dinosaur's birth date whenever PostgreSQL adds support for that date. :smile:

benighted avatar Dec 10 '13 04:12 benighted

Cool. Thanks, @benighted! Life is difficult for us time-travelers.

moll avatar Dec 10 '13 09:12 moll

This is fixed now, right?

charmander avatar Mar 29 '14 15:03 charmander

This is fixed now, correct. Thanks @charmander - I was stuck under the rock of working too many hours at my startup not having enough time to work on this.

brianc avatar Oct 20 '14 03:10 brianc