I tried...
Code: Select all
dbadmin=> create table my_test (t int);
CREATE TABLE
dbadmin=> alter table my_test add constraint col1_nn not null (t);
ERROR 4856: Syntax error at or near "not" at character 44
LINE 1: alter table my_test add constraint col1_nn not null (t);
^
dbadmin=> alter table my_test add constraint col1_pk primary key (t);
WARNING 2623: Column "t" definition changed to NOT NULL
ALTER TABLE
Code: Select all
dbadmin=> select table_name, column_name, constraint_name, constraint_type
dbadmin-> from constraint_columns where table_name = 'my_test';
table_name | column_name | constraint_name | constraint_type
------------+-------------+-----------------+-----------------
my_test | t | C_NOTNULL | n
my_test | t | col1_pk | p
(2 rows)