On Tue, 16 Oct 2001, Tariq Muhammad wrote:

> I am trying to set value of an attribute to not null but it does not work
> I am using the following statment:
> 
> UPDATE contact 
> SET attnotnull = TRUE
> WHERE attname = '_rserv_ts' ;
> 
> The error I get is as under :
> 
> ERROR:  Attribute 'attname' not found

You need to update pg_attribute, something like:
update pg_attribute
 set attnotnull=true
 where attname='_rserv_ts' and
  exists (select * from pg_class where
    pg_class.oid=pg_attribute.oid and
    pg_class.relname='contact');


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to