pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-sql@postgresql.org
Subject: Re: alter table
Date: Wed, 15 Feb 2006 19:54:28 +0100
Message-ID: <20060215185428.GB12551@KanotixBox> (raw)
In-Reply-To: <1113783300.20060215191156@isb.com.pl>
References: <1113783300.20060215191156@isb.com.pl>

Maciej Piekielniak <piechcio@isb.com.pl> schrieb:

> Hello ,
> 
> How can i modify few fields with alter?
> 
> ALTER TABLE fv_wystawione
>   ALTER id_fv SET DEFAULT nextval('id_fv_seq'::text),
>   ALTER imie SET DEFAULT '';  

test=# create table xyz (id int not null);
CREATE TABLE
test=# create sequence xyz_seq;
CREATE SEQUENCE
test=# alter table xyz alter column id set default nextval('xyz_seq');
ALTER TABLE


or:

test=# drop TABLE xyz;
DROP TABLE
test=# create table xyz (id int not null, foo varchar);
CREATE TABLE
test=# alter table xyz alter column id set default nextval('xyz_seq'), alter column foo set default '';
ALTER TABLE



HTH, Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°



view thread (22+ messages)  latest in thread

Message-ID: <20060215185428.GB12551@KanotixBox>
Permalink:  ../20060215185428.GB12551@KanotixBox/
Also on:    postgresql.org/message-id/20060215185428.GB12551@KanotixBox

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: akretschmer@spamfence.net
  Subject: Re: alter table
  In-Reply-To: <20060215185428.GB12551@KanotixBox>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox