Re: ALTER TABLE commands - Mailing list pgsql-admin

From Stephan Szabo
Subject Re: ALTER TABLE commands
Date
Msg-id Pine.BSF.4.21.0110162142210.20084-100000@megazone23.bigpanda.com
Whole thread Raw
In response to ALTER TABLE commands  (Tariq Muhammad <tmuhamma@libertyrms.com>)
List pgsql-admin
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');


pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Database subdirectories in V7.1.x
Next
From: "Moovarkku Mudhalvan"
Date:
Subject: Convertion of Oracle Database to Postgresql