sqlserver2pgsql icon indicating copy to clipboard operation
sqlserver2pgsql copied to clipboard

Incorrect parsing of default sysdatetime() function

Open shubham-yb opened this issue 1 year ago • 0 comments

Hi Team, If we have a date time type column with a default value ex:

ALTER TABLE [dbo].[AAFILE] ADD  CONSTRAINT [DF_AAFILE_created_on]  DEFAULT (sysdatetime()) FOR [created_on]

The function sysdatetime() gets parsed as is which is not supported by PG ex:

ALTER TABLE "public"."aafile" ALTER COLUMN "created_on" SET DEFAULT sysdatetime();

If we could convert it to now(), the PG equivalent, the error can be avoided.

Thank You for your help.

shubham-yb avatar Mar 28 '23 08:03 shubham-yb