Re: [SQL] Alter Table/Indexing

2009-03-25 Thread Steve Midgley
At 02:20 AM 3/25/2009, pgsql-sql-ow...@postgresql.org wrote: To: Zdravko Balorda cc: pgsql-sql@postgresql.org Subject: Re: Alter Table/Indexing In-reply-to: <49c89fea.8060...@siix.com> References: <49c89fea.8060...@siix.com> Comments: In-reply-to Zdravko Balorda message dated "Tue, 24 M

Re: [SQL] Alter Table/Indexing

2009-03-24 Thread Tom Lane
Zdravko Balorda writes: > I wonder does ATER TABLE TYPE, SET, depends on indexes, like INSERT does > in a sense it may be faster to drop and recreate index than sorting > after every row inserted. ALTER TABLE TYPE already rebuilds the indexes; you won't make the overall process any faster by doi

Re: [SQL] alter table on a large db

2009-03-24 Thread Jasen Betts
On 2009-03-19, Zdravko Balorda wrote: > > Hi, > > I need to make some ALTER TABLEs. It takes about 30min to copy > this quite large databse, bat several ours to run a bunch of ALTER > TABLE statements. which do you prefer 30 minutes down-time to reload the database or a few hours wait to update i

Re: [SQL] alter table on a large db

2009-03-19 Thread Scott Marlowe
On Thu, Mar 19, 2009 at 1:57 AM, Zdravko Balorda wrote: > > Hi, > > I need to make some ALTER TABLEs. It takes about 30min to copy > this quite large databse, bat several ours to run a bunch of ALTER > TABLE statements. > Is there any way to make it faster? I wonder what could possibly alter table

Re: [SQL] alter table on a large db

2009-03-19 Thread Achilleas Mantzios
Στις Thursday 19 March 2009 09:57:11 ο/η Zdravko Balorda έγραψε: > > Hi, > > I need to make some ALTER TABLEs. It takes about 30min to copy > this quite large databse, bat several ours to run a bunch of ALTER > TABLE statements. > Is there any way to make it faster? I wonder what could possibly a

Re: [SQL] ALTER TABLE DROP CONSTRAINT IF EXISTS ?

2008-01-24 Thread Scott Marlowe
On Jan 23, 2008 4:25 AM, Andreas Joseph Krogh <[EMAIL PROTECTED]> wrote: > Does PG have any way of doing $subject without writing a plpgsql-function > which does it by querying the catalog manually? No. ---(end of broadcast)--- TIP 6: explain analyz

Re: [SQL] Alter Table

2007-03-15 Thread Scott Marlowe
On Thu, 2007-03-15 at 08:35, Shavonne Marietta Wijesinghe wrote: > When i alter a table and add a new column it always adds it to the end > of the table. Is there any way to tell it to add the new column at the > 5th position or to add the new column after a surtain column. No, but the good news i

Re: [SQL] Alter Table

2007-03-15 Thread A. Kretschmer
am Thu, dem 15.03.2007, um 14:35:41 +0100 mailte Shavonne Marietta Wijesinghe folgendes: > When i alter a table and add a new column it always adds it to the end of the > table. Is there any way to tell it to add the new column at the 5th position > or > to add the new column after a surtain col

Re: [SQL] alter table

2006-02-15 Thread Michael Glaesemann
On Feb 16, 2006, at 3:11 , Maciej Piekielniak wrote: How can i modify few fields with alter? I think you need to alter columns one at a time. If you need them to go into effect at the same time, you can wrap the multiple ALTER TABLE statements in a transaction. For example, begin; ALTER

Re: [SQL] alter table

2006-02-15 Thread Maciej Piekielniak
Hello Stephan, Wednesday, February 15, 2006, 9:03:26 PM, you wrote: SS> Not in 7.4, but I believe 8.1 allows that (ALTER TABLE ALTER COLUMN TYPE SS> with semi-optional USING) Thx for all. -- Best regards, Maciejmailto:[EMAIL PROTECTED] ---

Re: [SQL] alter table

2006-02-15 Thread Stephan Szabo
On Wed, 15 Feb 2006, Owen Jacobson wrote: > Maciej Piekielniak wrote: > > > > Wednesday, February 15, 2006, 8:31:17 PM, you wrote: > > OJ> Note that prior to 8.0 PostgreSQL does not support > > multiple ALTER actions in a single query. To get an > > equivalent effect, wrap separate ALTER TABLE qu

Re: [SQL] alter table

2006-02-15 Thread Owen Jacobson
Maciej Piekielniak wrote: > > Hello Owen, > > Wednesday, February 15, 2006, 8:56:05 PM, you wrote: > >> ALTER TABLE proc MODIFY name varchar(64) DEFAULT '' NOT NULL; > > OJ> Not under 7.4. > > Hmm, maybe postgres can copy constraints and properties in > "create table .. as select"? What is it

Re: [SQL] alter table

2006-02-15 Thread Maciej Piekielniak
Hello Owen, Wednesday, February 15, 2006, 8:56:05 PM, you wrote: >> ALTER TABLE proc MODIFY name varchar(64) DEFAULT '' NOT NULL; OJ> Not under 7.4. Hmm, maybe postgres can copy constraints and properties in "create table .. as select"? CREATE TABLE fv_wystawione ( abonament) AS SELECT a.nazwa

Re: [SQL] alter table

2006-02-15 Thread Owen Jacobson
Maciej Piekielniak wrote: > > Wednesday, February 15, 2006, 8:31:17 PM, you wrote: > OJ> Note that prior to 8.0 PostgreSQL does not support > multiple ALTER actions in a single query. To get an > equivalent effect, wrap separate ALTER TABLE queries in a transaction: > > OJ> BEGIN; > OJ> alter

Re: [SQL] alter table

2006-02-15 Thread Maciej Piekielniak
Hello Owen, Wednesday, February 15, 2006, 8:31:17 PM, you wrote: OJ> Note that prior to 8.0 PostgreSQL does not support multiple ALTER actions in a single query. To get an equivalent effect, wrap separate ALTER TABLE queries in a transaction: OJ> BEGIN; OJ> alter table xyz alter column id set

Re: [SQL] alter table

2006-02-15 Thread Owen Jacobson
Andreas Kretschmer wrote: > > Maciej Piekielniak <[EMAIL PROTECTED]> schrieb: > > > Hello Andreas, > > > > Wednesday, February 15, 2006, 7:54:28 PM, you wrote: > > AK> test=# alter table xyz alter column id set default > nextval('xyz_seq'), alter column foo set default ''; > > > > PGAdmin-SQL:

Re: [SQL] alter table

2006-02-15 Thread Maciej Piekielniak
Hello Andreas, Wednesday, February 15, 2006, 8:27:00 PM, you wrote: AK> test=# select version(); AK>version AK> -- AK> PostgreSQL 8.1.2

Re: [SQL] alter table

2006-02-15 Thread Andreas Kretschmer
Maciej Piekielniak <[EMAIL PROTECTED]> schrieb: > Hello Andreas, > > Wednesday, February 15, 2006, 7:54:28 PM, you wrote: > AK> test=# alter table xyz alter column id set default nextval('xyz_seq'), > alter column foo set default ''; > > PGAdmin-SQL: > > alter table xyz alter column id set def

Re: [SQL] alter table

2006-02-15 Thread Maciej Piekielniak
Hello Andreas, Wednesday, February 15, 2006, 7:54:28 PM, you wrote: AK> test=# alter table xyz alter column id set default nextval('xyz_seq'), alter column foo set default ''; PGAdmin-SQL: alter table xyz alter column id set default nextval('xyz_seq'), alter column foo set default ''; ERROR:

Re: [SQL] alter table

2006-02-15 Thread Andreas Kretschmer
Maciej Piekielniak <[EMAIL PROTECTED]> 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 sequ

Re: [SQL] Alter table

2004-03-10 Thread scott.marlowe
On Wed, 10 Mar 2004, David wrote: > Ok another very newbie question. How can i change the data type a column can > accept? at the moment it will only take character(7) i want to change it to > varchar(30), but i cant figure how, ideas? While there are ways to tinker with the system catalogs to ch

Re: [SQL] ALTER TABLE ... DROP CONSTRAINT

2003-07-30 Thread Rajesh Kumar Mallah
if the constraint are named $1 $2 etc you will need to quote them eg ALTER TABLE xyz DROP CONSTRAINT "$1" ; in some version you may require ALTER TABLE xyz DROP CONSTRAINT "$1" RESTRICT; What is ur version btw? try to post the table structure also. regds mallah. Elielson Fontanezi wrote: H

Re: [SQL] ALTER TABLE ... DROP CONSTRAINT

2003-07-30 Thread George Weaver
It works in 7.3.2.   George - Original Message - From: Elielson Fontanezi To: pgsql-general ; pgsql-sql Sent: Wednesday, July 30, 2003 10:52 AM Subject: [SQL] ALTER TABLE ... DROP CONSTRAINT Hi all!       Who can tell me what postgres version supports

Re: [SQL] ALTER TABLE ... DROP CONSTRAINT

2003-07-30 Thread Rod Taylor
I think you can do some constraints in 7.2, but 7.3 will allow dropping them all in that fashion. On Wed, 2003-07-30 at 11:52, Elielson Fontanezi wrote: > Hi all! > > Who can tell me what postgres version supports ALTER TABLE... DROP > CONSTRAINT without > the need of droping the table to re

Re: [SQL] ALTER TABLE ... DROP CONSTRAINT

2003-07-30 Thread Chad Thompson
  Hi all!       Who can tell me what postgres version supports ALTER TABLE... DROP CONSTRAINT without the need of droping the table to remove a simple coinstraint. (link)    >\\\!/< 55 11 5080 9283 

Re: [SQL] Alter table

2002-11-08 Thread Daniel Schuchardt
I think 7.3 has this feature. Daniel ""Rachel.Vaudron"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:Pine.LNX.4.33.0211080811160.12232-10@;lazaret.unice.fr... > Hi, > > I wonder if it is possible to remove a field of a table ? > I haven't found anything about this into the reference manual

Re: [SQL] Alter table

2002-11-08 Thread Rachel.Vaudron
Thanks a lot, but it's already what i am doing! It's very a pity that there is no way do to this more quickly!!! > alter table xxx rename to temp; > create table xxx as > select field1, field2, ...without some field... from temp; > drop table temp; > > Tomasz Myrta > > Rachel -

Re: [SQL] Alter table

2002-11-08 Thread Tomasz Myrta
Uz.ytkownik Rachel.Vaudron napisa?: Hi, I wonder if it is possible to remove a field of a table ? I haven't found anything about this into the reference manual. Can I do something like that ?: ALTER TABLE table DROP COLUMN column; alter table xxx rename to temp; create table xxx as select fiel

Re: [SQL] Alter Table problems

2001-04-27 Thread Stephan Szabo
On Fri, 27 Apr 2001, Scott David Walter wrote: > I am attempting to add a few attributes to an existing table that already > contains data. The problem that I am having is that the new attributes > that I want to add need to be forgein key references to other tables. I > can't figure out how to

Re: [SQL] alter table add column implementation undesirable?

2000-11-09 Thread Tom Lane
Forest Wilkinson <[EMAIL PROTECTED]> writes: > A coworker told me that the postgres implementation of ALTER TABLE ADD > COLUMN creates an inefficient database. Dunno where he got that idea. There are some problems lurking in ADD COLUMN when used on a table with inheritance children --- the new c