[ADMIN] Corrupted database - how to recover

2010-05-27 Thread Johann Spies
After two disks on our raid-5 system failed causing a filesystem
failure.

We could get one online again and the filesystem is at present usable
but  I cannot start postgresql at the moment:

$ /usr/lib/postgresql/8.3/bin/postgres --single -D /etc/postgresql/8.3/main/
2010-05-27 09:22:48 SAST FATAL:  could not stat directory "base/16400": 
Structure needs cleaning
2010-05-27 09:22:48 SAST CONTEXT:  xlog redo insert: rel 1663/16400/16438; tid 
10960/41

in 'base' I see

drwx-- 10 postgres postgres  102 2010-04-22 15:09 .
drwx-- 10 postgres postgres 4096 2010-05-27 09:29 ..
drwx--  2 postgres postgres 4096 2010-05-20 02:11 1
drwx--  2 postgres postgres 4096 2010-04-22 15:07 11510
??  ? ??   ?? 16388
drwx--  2 postgres postgres 4096 2010-05-20 02:11 16389
drwx--  2 postgres postgres 4096 2010-05-20 02:11 16390
drwx--  2 postgres postgres 4096 2010-05-20 02:11 16391
??  ? ??   ?? 16400

I can just move the data-directory, do an initdb and use an older dump
to repair the database as it was some time ago.  Fortunately the data is
not mission critical.  But what if it was.  

How do I recover from a situation like this?

Regards
Johann
-- 
Johann Spies  Telefoon: 021-808 4599
Informasietegnologie, Universiteit van Stellenbosch

 "All that the Father giveth me shall come to me; and
  him that cometh to me I will in no wise cast out."
  John 6:37 

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] Corrupted database - how to recover

2010-05-27 Thread Andreas Schmitz


hi johann,

maybe you should consider using point in time recovery (pitr) if the 
database is mission critical.


http://www.postgresql.org/docs/8.4/interactive/continuous-archiving.html

regards

andreas



Johann Spies wrote:

After two disks on our raid-5 system failed causing a filesystem
failure.

We could get one online again and the filesystem is at present usable
but  I cannot start postgresql at the moment:

$ /usr/lib/postgresql/8.3/bin/postgres --single -D /etc/postgresql/8.3/main/
2010-05-27 09:22:48 SAST FATAL:  could not stat directory "base/16400": 
Structure needs cleaning
2010-05-27 09:22:48 SAST CONTEXT:  xlog redo insert: rel 1663/16400/16438; tid 
10960/41

in 'base' I see

drwx-- 10 postgres postgres  102 2010-04-22 15:09 .
drwx-- 10 postgres postgres 4096 2010-05-27 09:29 ..
drwx--  2 postgres postgres 4096 2010-05-20 02:11 1
drwx--  2 postgres postgres 4096 2010-04-22 15:07 11510
??  ? ??   ?? 16388
drwx--  2 postgres postgres 4096 2010-05-20 02:11 16389
drwx--  2 postgres postgres 4096 2010-05-20 02:11 16390
drwx--  2 postgres postgres 4096 2010-05-20 02:11 16391
??  ? ??   ?? 16400

I can just move the data-directory, do an initdb and use an older dump
to repair the database as it was some time ago.  Fortunately the data is
not mission critical.  But what if it was.  


How do I recover from a situation like this?

Regards
Johann
  



--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[ADMIN] How to add constraints without validating data.

2010-05-27 Thread Amit jain

Hi Gurus

Is there any way in postgreSQL to apply constraints forcefully without 
checking/validating Data ? It should validate only those records which 
comes after constraints are applied.


I need this help as data is already loaded in database but "ALTER TABLE" 
sql for adding CONSTRAINTS is taking enormous time.


Thanks for ideas/suggestion in Advance !!


--

Regards,

*Amit Jain*
*Synechron Technologies Pvt. Ltd.*  4th  Floor, B Wing, Block 1.2, Embassy 
Techzone,
Rajiv Gandhi Infotech Park, Hinjewadi Phase II, Pune 411 057.
Phone : +91.20.40262000 Ext 2163 | Mobile:+91.9561298565  |VoIP : 
+1.732.415.0894
http://www.synechron.com     MailTo: 
amitj...@synechron.com  





Re: [ADMIN] How to add constraints without validating data.

2010-05-27 Thread Nilesh Govindarajan
On Thu, May 27, 2010 at 5:55 PM, Amit jain  wrote:
> Hi Gurus
>
> Is there any way in postgreSQL to apply constraints forcefully without
> checking/validating Data ? It should validate only those records which comes
> after constraints are applied.
>
> I need this help as data is already loaded in database but "ALTER TABLE" sql
> for adding CONSTRAINTS is taking enormous time.
>
> Thanks for ideas/suggestion in Advance !!
>
>
> --
>
> Regards,
>
> Amit Jain
> Synechron Technologies Pvt. Ltd. 4th  Floor, B Wing, Block 1.2, Embassy
> Techzone,
> Rajiv Gandhi Infotech Park, Hinjewadi Phase II, Pune 411 057.
> Phone : +91.20.40262000 Ext 2163 | Mobile:+91.9561298565 | VoIP :
> +1.732.415.0894
> http://www.synechron.com  MailTo: amitj...@synechron.com
>
>


I don't think there's any method to do that. If you add a constraint
using ALTER TABLE it will check existing data also. One option is you
create a new table with the constraints and same column names then:

insert into newtable values ( select * from oldtable)

but again this will check for old data, but may be faster.

-- 
Nilesh Govindarajan
Facebook: nilesh.gr
Twitter: nileshgr
Website: www.itech7.com

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] Corrupted database - how to recover

2010-05-27 Thread Johann Spies
On Thu, May 27, 2010 at 09:54:00AM +0200, Andreas Schmitz wrote:
> 
> maybe you should consider using point in time recovery (pitr) if the
> database is mission critical.
> 
> http://www.postgresql.org/docs/8.4/interactive/continuous-archiving.html

Thanks.  This is the first time I experienced this type of problem.
Fortunately the data was not that critical.  I agree that pitr should be
a part of any mission critical setup.

Regards
Johann
-- 
Johann Spies  Telefoon: 021-808 4599
Informasietegnologie, Universiteit van Stellenbosch

 "All that the Father giveth me shall come to me; and
  him that cometh to me I will in no wise cast out."
  John 6:37 

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] future development of xml capabilities

2010-05-27 Thread Kevin Grittner
Kasia Tuszynska  wrote:
 
> I was wondering if there were any plans to implement indexing on a
> xpath expression in future releases on Postges like Postgres 9?
 
I wouldn't be surprised if that eventually gets added, but I don't
recall seeing any discussion of doing so anytime soon.  To see the
list of XML work which has made it to the TODO list, look here:
 
http://wiki.postgresql.org/wiki/Todo#XML
 
-Kevin

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] How to add constraints without validating data.

2010-05-27 Thread Iñigo Martinez Lasala
You have to disable triggers.

Two options:

- Export table data, truncate table (if your table is fk source you will
have a problem), add constraint and import exported data with
--disable-triggers flag in pg_restore.

- Perhaps you could add manually triger via pg_trigger table in
pg_catalog whith an insert into this table.

-Original Message-
From: Amit jain 
To: pgsql-admin@postgresql.org 
Subject: [ADMIN] How to add constraints without validating data.
Date: Thu, 27 May 2010 17:55:56 +0530

Hi Gurus

Is there any way in postgreSQL to apply constraints forcefully without
checking/validating Data ? It should validate only those records which
comes after constraints are applied. 

I need this help as data is already loaded in database but "ALTER TABLE"
sql for adding CONSTRAINTS is taking enormous time.

Thanks for ideas/suggestion in Advance !!


-- 

Regards,

Amit Jain 
Synechron Technologies Pvt. Ltd. 4th  Floor, B Wing, Block 1.2, Embassy 
Techzone,
Rajiv Gandhi Infotech Park, Hinjewadi Phase II, Pune 411 057. 
Phone : +91.20.40262000 Ext 2163 | Mobile:+91.9561298565 | VoIP : 
+1.732.415.0894
http://www.synechron.com  MailTo: amitj...@synechron.com







Re: [ADMIN] How to add constraints without validating data.

2010-05-27 Thread Nilesh Govindarajan
On Thu, May 27, 2010 at 9:30 PM, Iñigo Martinez Lasala
 wrote:
> You have to disable triggers.
>
> Two options:
>
> - Export table data, truncate table (if your table is fk source you will
> have a problem), add constraint and import exported data with
> --disable-triggers flag in pg_restore.
>
> - Perhaps you could add manually triger via pg_trigger table in pg_catalog
> whith an insert into this table.
>
> -Original Message-
> From: Amit jain 
> To: pgsql-admin@postgresql.org 
> Subject: [ADMIN] How to add constraints without validating data.
> Date: Thu, 27 May 2010 17:55:56 +0530
>
> Hi Gurus
>
> Is there any way in postgreSQL to apply constraints forcefully without
> checking/validating Data ? It should validate only those records which comes
> after constraints are applied.
>
> I need this help as data is already loaded in database but "ALTER TABLE" sql
> for adding CONSTRAINTS is taking enormous time.
>
> Thanks for ideas/suggestion in Advance !!
>
>
> --
>
> Regards,
>
> Amit Jain
> Synechron Technologies Pvt. Ltd. 4th  Floor, B Wing, Block 1.2, Embassy
> Techzone,
> Rajiv Gandhi Infotech Park, Hinjewadi Phase II, Pune 411 057.
> Phone : +91.20.40262000 Ext 2163 | Mobile:+91.9561298565 | VoIP :
> +1.732.415.0894
> http://www.synechron.com  MailTo: amitj...@synechron.com
>
>
>
>
>


How would disabling triggers help that ? He just wants to add
constraints without loss of data. I don't think he has any triggers.

-- 
Nilesh Govindarajan
Facebook: nilesh.gr
Twitter: nileshgr
Website: www.itech7.com

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] How to add constraints without validating data.

2010-05-27 Thread Iñigo Martinez Lasala
Constraints are special triggers, but triggers anyway.

So, If you truncate the table, create the contraint and then restore
with triggers disabled, it could be faster that create the contraint and
wait until it checks all table data... or not... :)



-Original Message-
From: Nilesh Govindarajan 
To: Iñigo Martinez Lasala 
Cc: Amit jain , pgsql-admin@postgresql.org
Subject: Re: [ADMIN] How to add constraints without validating data.
Date: Thu, 27 May 2010 21:45:25 +0530


How would disabling triggers help that ? He just wants to add
constraints without loss of data. I don't think he has any triggers.





Re: [ADMIN] command tag logging

2010-05-27 Thread Tom Lane
alvherre  writes:
> Excerpts from Ray Stell's message of mié may 26 17:08:33 -0400 2010:
>> I just installed a compiled from src 8.3.11.  I usually include %i, command 
>> tag,
>> in the log_line_prefix setting.  This causes some spewage I'd not seen before
>> on connection received lines as if it is dumping the environment:

> Hmm, I bet it's the recent %.*s patch.

That is in the right place, isn't it.  That would suggest that
get_ps_display() is returning a wrong length on Ray's machine.
It works okay here, but since that's platform-specific code that
hardly proves much.  Ray, what platform is this exactly?

regards, tom lane

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] command tag logging

2010-05-27 Thread alvherre
Excerpts from Tom Lane's message of jue may 27 12:49:49 -0400 2010:
> alvherre  writes:
> > Excerpts from Ray Stell's message of mié may 26 17:08:33 -0400 2010:
> >> I just installed a compiled from src 8.3.11.  I usually include %i, 
> >> command tag,
> >> in the log_line_prefix setting.  This causes some spewage I'd not seen 
> >> before
> >> on connection received lines as if it is dumping the environment:
> 
> > Hmm, I bet it's the recent %.*s patch.
> 
> That is in the right place, isn't it.  That would suggest that
> get_ps_display() is returning a wrong length on Ray's machine.
> It works okay here, but since that's platform-specific code that
> hardly proves much.  Ray, what platform is this exactly?

FWIW it fails for me too (Debian running Linux 2.6.32).  Adding some
logging to stderr results in this:

psdisp (len 2130) is: “““/pgsql/install/83_rel/bin/postmaster”””
/pgsql/install/83_rel/bin/postmasterPGDATA=/pgsql/install/83_rel/dataORBIT_SOCKETDIR=/home/alvherre/tmp/orbit-alvherreSSH_AGENT_PID=2739GPG_AGENT_INFO=/tmp/gpg-aXAHSs/S.gpg-agent:2704:1SHELL=/bin/bashTERM=xtermXDG_SESSION_COOKIE=e50959452240490c59b0366b96665400-1274967349.87074-853952583HISTSIZE=1TMPDIR=/home/alvherre/tmpGTK_RC_FILES=/etc/gtk/gtkrc:/home/alvherre/.gtkrc-1.2-gnome2WINDOWID=29360152GNOME_KEYRING_CONTROL=/home/alvherre/tmp/keyring-EUoSfgGTK_MODULES=canberra-gtk-moduleUSER=alvherrehttp_proxy=http://localhost:8118XTERM_SHELL=/bin/bashHISTFILESIZE=1LD_LIBRARY_PATH=/pgsql/install/83_rel/libLS_COLORS=no=00:fi=00:di=01;35:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.tar=01;31:*.tgz=01;31:*.tbz2=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lha=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.jpg=01
 
;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:*.tiff=01;35:SSH_AUTH_SOCK=/home/alvherre/tmp/keyring-EUoSfg/sshTMOUT=0USERNAME=alvherreSESSION_MANAGER=local/perhan:@/tmp/.ICE-unix/2689,unix/perhan:/tmp/.ICE-unix/2689PAGER=lessDESKTOP_SESSION=gnomePATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/alvherre/bin:/sbin:/usr/sbinGDM_XSERVER_LOCATION=localPX_CONFIG_ORDER=envvarPWD=/home/alvherreEDITOR=vimLANG=es_CL.UTF-8GDM_LANG=es_CL.UTF-8TZ=America/SantiagoGDMSESSION=gnomeHISTIGNORE=ls:bg:fg:cd:exit:XTERM_VERSION=XTerm(256)XTERM_LOCALE=es_CL.UTF-8HISTCONTROL=ignorespace:erasedupsHOME=/home/alvherreSHLVL=1GNOME_DESKTOP_SESSION_ID=this-is-deprecatedno_proxy=localhost,127.0.0.0/8BASH_ENV=/home/alvherre/.bashrcLOGNAME=alvherreLESS=-XRM
 
-x4VISUAL=vimXDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/gdm/DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-TnbbC5PUiR,guid=833f76565b26a89543f6aa42004f_PX_CONFIG
 
_ORDER=WINDOWPATH=7DISPLAY=:0.0HOSTFILE=/home/alvherre/.hostsXAUTHORITY=/home/alvherre/.Xauthority
 LOG:  connection received: host=[local]


Maybe the problem is the PS_PADDING setting?

I patched as below -- obviously the \0 didn't make any difference (it
was the first thing I tried), because the length, as you say, is wrong.

*** log_line_prefix(StringInfo buf)
*** 1615,1621 
--- 1615,1623 
int displen;
  
psdisp = get_ps_display(&displen);
+   fprintf(stderr, "psdisp (len %d) is: “““%s”””\n", displen, 
psdisp);
appendBinaryStringInfo(buf, psdisp, displen);
+   appendStringInfoChar(buf, '\0');
}
break;
case 'r':


-- 
Álvaro Herrera 
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] How to add constraints without validating data.

2010-05-27 Thread Nilesh Govindarajan
On Thu, May 27, 2010 at 9:49 PM, Iñigo Martinez Lasala
 wrote:
> Constraints are special triggers, but triggers anyway.
>
> So, If you truncate the table, create the contraint and then restore with
> triggers disabled, it could be faster that create the contraint and wait
> until it checks all table data... or not... :)
>
>
>
> -Original Message-
> From: Nilesh Govindarajan 
> To: Iñigo Martinez Lasala 
> Cc: Amit jain , pgsql-admin@postgresql.org
> Subject: Re: [ADMIN] How to add constraints without validating data.
> Date: Thu, 27 May 2010 21:45:25 +0530
>
> How would disabling triggers help that ? He just wants to add
> constraints without loss of data. I don't think he has any triggers.
>
>
>


I agree constraints are triggers. But as far as I know, truncating
table doesn't disable the constraints.
Its same as deleteing all rows and then altering the table.
In that manner, even my solution would be appropriate because it
creates a duplicate table with the constraints.
Whatever be the method, I don't think its possible to avoid the
constraints. Correct me if I'm wrong.

-- 
Nilesh Govindarajan
Facebook: nilesh.gr
Twitter: nileshgr
Website: www.itech7.com

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] command tag logging

2010-05-27 Thread Tom Lane
alvherre  writes:
> Excerpts from Tom Lane's message of jue may 27 12:49:49 -0400 2010:
>> That is in the right place, isn't it.  That would suggest that
>> get_ps_display() is returning a wrong length on Ray's machine.
>> It works okay here, but since that's platform-specific code that
>> hardly proves much.  Ray, what platform is this exactly?

> FWIW it fails for me too (Debian running Linux 2.6.32).

Hmm.  It seems like the %.*s change could only have affected things if
the PS display area contains \0 characters before the theoretical end
of the string.  Which it shouldn't, once we've set the display, but
Ray is only reporting this for log_connection output which might come
out before that.

In any case it strikes me that get_ps_display() is designed on the
assumption that it needn't be particularly fast, but using its result
in log_line_prefix is a place in which performance could indeed matter.
Maybe we should go to some effort to track the intended display string
length explicitly so we could avoid the mucking about in
get_ps_display().

regards, tom lane

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] command tag logging

2010-05-27 Thread Ray Stell
On Thu, May 27, 2010 at 12:49:49PM -0400, Tom Lane wrote:
> alvherre  writes:
> > Excerpts from Ray Stell's message of mi?? may 26 17:08:33 -0400 2010:
> >> I just installed a compiled from src 8.3.11.  I usually include %i, 
> >> command tag,
> >> in the log_line_prefix setting.  This causes some spewage I'd not seen 
> >> before
> >> on connection received lines as if it is dumping the environment:
> 
> > Hmm, I bet it's the recent %.*s patch.
> 
> That is in the right place, isn't it.  That would suggest that
> get_ps_display() is returning a wrong length on Ray's machine.
> It works okay here, but since that's platform-specific code that
> hardly proves much.  Ray, what platform is this exactly?

I should have included this:

   version  
 
-
 PostgreSQL 8.3.11 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 
20080704 (Red Hat 4.1.2-46)
(1 row)

[postgres ~]$ uname -a
Linux horntail.cns.vt.edu 2.6.18-194.3.1.el5PAE #1 SMP Sun May 2 04:42:25 EDT 
2010 i686 i686 i386 GNU/Linux

[postgres ~]$ cat /etc/issue
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Kernel \r on an \m

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] command tag logging

2010-05-27 Thread Tom Lane
Ray Stell  writes:
> On Thu, May 27, 2010 at 12:49:49PM -0400, Tom Lane wrote:
>> That is in the right place, isn't it.  That would suggest that
>> get_ps_display() is returning a wrong length on Ray's machine.
>> It works okay here, but since that's platform-specific code that
>> hardly proves much.  Ray, what platform is this exactly?

> [postgres ~]$ cat /etc/issue
> Red Hat Enterprise Linux Server release 5.5 (Tikanga)

OK, I can reproduce it when I try on my Fedora box.  The problem is that
log_connections emits a log message before init_ps_display() has been
called, and the ps_status.c logic isn't careful to ensure that it
returns something sane in that case.  It accidentally failed to fail
too badly before I changed the elog.c logic, because there'd be an
embedded null after the program name in most cases.  I suppose people
might even have thought that printing "postmaster" or "postgres" for
%i was intended behavior there.

I think the most useful fix is to create a static variable to hold the
notional strlen(ps_buffer), which will initialize to zero, and then
we can use that instead of groveling over the string in get_ps_display.
Should improve performance a tad as well as fixing this problem.
Will work on that.

regards, tom lane

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] command tag logging

2010-05-27 Thread Tom Lane
Ray Stell  writes:
> I just installed a compiled from src 8.3.11.  I usually include %i, command 
> tag,
> in the log_line_prefix setting.  This causes some spewage I'd not seen before
> on connection received lines as if it is dumping the environment:

Fix is here if you need it quick:
http://archives.postgresql.org/pgsql-committers/2010-05/msg00328.php

regards, tom lane

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] How to add constraints without validating data.

2010-05-27 Thread Robert Voinea
Why don't you use a partition?

Create another table that inherits from the table and add your new constraints 
to the new table.


On Thursday 27 May 2010 19:32:33 Nilesh Govindarajan wrote:
> On Thu, May 27, 2010 at 9:49 PM, Iñigo Martinez Lasala
> 
>  wrote:
> > Constraints are special triggers, but triggers anyway.
> > 
> > So, If you truncate the table, create the contraint and then restore with
> > triggers disabled, it could be faster that create the contraint and wait
> > until it checks all table data... or not... :)
> > 
> > How would disabling triggers help that ? He just wants to add
> > constraints without loss of data. I don't think he has any triggers.
> 
> I agree constraints are triggers. But as far as I know, truncating
> table doesn't disable the constraints.
> Its same as deleteing all rows and then altering the table.
> In that manner, even my solution would be appropriate because it
> creates a duplicate table with the constraints.
> Whatever be the method, I don't think its possible to avoid the
> constraints. Correct me if I'm wrong.

-- 
Robert Voinea 
Software Developer
Phone: +40 21 408 38 00 / ext. 343
Fax: +40 21 408 38 08
Local time: GMT+2
http://www.topex.ro


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin