pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

Add mapping of getutcdate ms sql default function

Open bjrne opened this issue 2 years ago • 1 comments

getdate() is getutcdate() under the hood, but getutcdate() can also be used and thus also needs a mapping/translation

  • I compiled this locally and can confirm that this solved my use case, but this PR would probably benefit from a test. Unfortunately my lisp skills are nonexistent, so I'll leave this open for now.
  • I took insipration from this PR: #577
  • This PR will probably fix #1343 which was closed without actually being fixed.

Thanks for this awesome open source software!

bjrne avatar Feb 17 '23 23:02 bjrne

Hey, any news on that? I have this issue - our database uses getutcdate() all over the place so it's good to have this fix in latest release, because it's easier to use pgloader with docker

I'm new to pgloader, reading through documentation currently, hope I could at least use loader script to address this issue, but this feature is good to have.

And I believe that default getdate() should be translated to LOCALTIMESTAMP

Also adding missing SYSUTCDATETIME and SYSDATETIME might be a good point, they return datetime2 format which range is still included in PostgreSQL timestamp with time zone type so basically can be safely translated to the same CURRENT_TIMESTAMP and LOCALTIMESTAMP

axtox avatar Feb 05 '24 18:02 axtox