Re: column insert/alter got me stumped! - Mailing list pgsql-general

From Adam Rich
Subject Re: column insert/alter got me stumped!
Date
Msg-id 0ed401c74014$68cae740$6400a8c0@dualcore
Whole thread Raw
In response to column insert/alter got me stumped!  ("John Smith" <jayzee.smith@gmail.com>)
List pgsql-general
I think you want this:

update tablename set columname = 'value'
where column2 = 'value2';



-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of John Smith
Sent: Wednesday, January 24, 2007 5:59 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] column insert/alter got me stumped!


guys,
just wanna change value of 1 existing column

# insert into tablename (columnname) values ('value');
...works

# select columnname from tablename where columnname='value';
...works

# insert into tablename (columnname) values ('value') select
columnname from tablename where columnname='value';
or
# insert into tablename (columnname) values ('value') where
columnname='value';
...combinations don't work

# alter table tablename alter column columnname set value='value';
...doesn't work either

embarrassingly simple? pgadmin III thinks so
jzs
http://www.postgresql.org/docs/8.1/static/sql-insert.html
http://www.postgresql.org/docs/8.0/static/sql-altertable.html

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

               http://www.postgresql.org/docs/faq


pgsql-general by date:

Previous
From: "John Smith"
Date:
Subject: column insert/alter got me stumped!
Next
From: Rich Shepard
Date:
Subject: Re: Cannot Restart PostgreSQL-8.1.4