default value enclosure

Feature requests and their debate

default value enclosure

Postby joselitux » Mon May 06, 2013 10:34 am

Hi

When creating a new VARCHAR column with a default value, the persist script doesn't enclose the default value in quotes, raising an error.

Example

ALTER TABLE MyTable ADD myField VARCHAR(255) NOT NULL DEFAULT some words;

Would be very useful to check if default value is quoted, and if it's not, then quote it.

thanks
joselitux
 
Posts: 43
Joined: Thu Oct 25, 2012 12:11 pm

Re: default value enclosure

Postby Serge » Mon May 06, 2013 11:30 am

Hello,

It is not a bug, it works as designed ( viewtopic.php?f=2&t=905&p=1905 )
It is not possible to add quotes automatically because default value may be quite sophisticated and database dependent.
E.g. it can be come constant, function, other column name, expression, etc.
So if you need string literal as default value you should add quotes manually.

Thanks
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb


Return to Feature Requests



Who is online

Users browsing this forum: No registered users and 6 guests