Postgresql unable to change the data type of a column

ساخت وبلاگ

Vote count: 0

I am new to Postgresql, and I am trying to change the data type of a column from Integer to Varchar(20), but I get strange error:

ERROR: operator does not exist: character varying <> integer : No operator matches the given name and argument type(s). You might need to add explicit type casts.********** Error **********

The script I wrote to create the table is:

CREATE TABLE LOGIN( USERNAME INTEGER NOT NULL CHECK(USERNAME != NULL), PASSWORD VARCHAR(10) NOT NULL CHECK(PASSWORD <>'' AND USERNAME != NULL) );

This is the script I used to modify the column from Integer to Varchar:

ALTER TABLE LOGIN ALTER COLUMN USERNAME TYPE varchar(20);

I appreciate any help. Thanks.

asked 1 min ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 336 تاريخ : جمعه 31 ارديبهشت 1395 ساعت: 17:40