Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 12E88632A1B for ; Wed, 24 Feb 2010 00:50:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 33643-03 for ; Wed, 24 Feb 2010 04:50:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from web95315.mail.in2.yahoo.com (web95315.mail.in2.yahoo.com [203.104.18.215]) by mail.postgresql.org (Postfix) with SMTP id 3020A6327AA for ; Wed, 24 Feb 2010 00:50:24 -0400 (AST) Received: (qmail 58852 invoked by uid 60001); 24 Feb 2010 04:43:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1266986622; bh=wC9h2jbo3npUOyWt6hdyHN84wCJ52bDCuxB/PJ49+AU=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=kQAb4YaWYouIs6LSI7wafkhUFkCH96mNt8V7h8w1MRdigRvyqH8LfC862Y0+3nGouJx6Ei/vtbbZ6E8oGdkGQvYVi1KQ2mCVA/x+UBDK/I7xjZ9vel42JTg2/IvXyEFHT4/noBD/+WY7PJRiqRWl2jyp307rpEcK1NvBYEk70Nk= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=kbMHoGp2Wkc1Qle5i+QYLDmosIMuFVBg4ppkk5EZgAy0TGt9YDNlAjSDFsif27R/xGsx3JLHqYvNMa2deAMJpqczQhYU2ofzDtTzbvl9MGJcY65zYieDxkvhkune10RPmGqcSnOk0AoboizHtVLz2i4fuh5oKFBrII7yGxw8DVQ=; Message-ID: <166209.57794.qm@web95315.mail.in2.yahoo.com> X-YMail-OSG: uBNklsEVM1nRM9uKdJ9rJwB7wVlxSK3L8rv7BwljHsJpH2STsr5bHO7GBbGL1.Eqp7v9ZyK8gQkVCS11uIxSYXO.A.o1rW6CX4M.NrBkPyCg24MUnQKAo3MoOz19Z6_BBd.dhBtECAX7.MUvDyJrPRupkWybfwm1TL.1mYRNSGuv7QiEkAVLFAlc8ZWLwH1l5kag1gly6aEpspD29e9eXOZNT6mh4WQb0zMCOrjqHMn84qU5N1LO_rT81PI535Y4nOyR4ai_ Received: from [192.168.8.58] by web95315.mail.in2.yahoo.com via HTTP; Wed, 24 Feb 2010 10:13:41 IST X-Mailer: YahooMailClassic/9.2.12 YahooMailWebService/0.8.100.260964 Date: Wed, 24 Feb 2010 10:13:41 +0530 (IST) From: Thillai Selvan Subject: Re: [GENERAL] how do I do dump and restore without bugging with constraint? To: "Net Tree Inc." , pgsql-admin@postgresql.org, pgsql-general@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1598437888-1266986621=:57794" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=-10 required=5 tests=BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201002/188 X-Sequence-Number: 33791 --0-1598437888-1266986621=:57794 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I have tried like this. But in my case it is not working when trying to access a column that is not= exists in the table. Example: CREATE TABLE test_str (te_id text); INSERT INTO test_str VALUES ('a'); INSERT INTO test_str VALUES ('b'); INSERT INTO test_str VALUES ('c'); SELECT t.name from test_str t; I am getting error like this. ERROR:=A0 column t.name does not exist --- On Wed, 24/2/10, Net Tree Inc. wrote: From: Net Tree Inc. Subject: Re: [GENERAL] how do I do dump and restore without bugging with co= nstraint? To: pgsql-admin@postgresql.org, pgsql-general@postgresql.org Date: Wednesday, 24 February, 2010, 1:57 AM I see something related with Deferrable and Initially deferrable that seems like something could avoid constraints when dumping and restore, but it has to modify the table or re-create all of them to have such option (maybe is what you referraled "table definitions"). Is it what it can be use for to avoid during dumping and restoring?=20 DEFERRABLE NOT DEFERRABLE This controls whether the constraint can be deferred. A constraint that is not deferrable will be checked immediately after every command. Checking of constraints that are deferrable can be postponed until the end of the transaction (using the SET CONSTRAINTS command). NOT DEFER= RABLE is the default. Only foreign key constraints currently accept this clause. All other constraint types are not deferrable. INITIALLY IMMEDIATE INITIALLY DEFERRED If a constraint is deferrable, this clause specifies the default time to check the constraint. If the constraint is INITIALLY IMMEDIATE, it is ch= ecked after each statement. This is the default. If the constraint i= s INITIALLY DEFERRED, it is checked only at the end of the tran= saction. The constraint check time can be altered with the SET CONST= RAINTS command. =20 On Tue, Feb 23, 2010 at 12:50 PM, Net Tree Inc. wrot= e: Hi all, I am dumping both schema and data from old database to new one. The new dat= abase schema is somehow contain slightly different schema then the old one.= When I do restore it shown alot errors related with constraints. How can I= dump and to restore from old to new without dealing with constraint and ju= st forces data dump to where it suppose to belong?=20 --=20 --------------------------------------- Steven Huang =0A=0A=0A The INTERNET now has a personality. YOURS! See your Yahoo! H= omepage. http://in.yahoo.com/ --0-1598437888-1266986621=:57794 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
I have tried like this.
But in my case it = is not working when trying to access a column that is not exists in the tab= le.

Example:

CREATE TABLE test_str (te_id text);

INSER= T INTO test_str VALUES ('a');
INSERT INTO test_str VALUES ('b');
INSE= RT INTO test_str VALUES ('c');

SELECT t.name from test_str t;
I am getting error like this.

ERROR:  column t.name does not e= xist



--- On Wed, 24/2/10, Net Tree Inc. <nettreeinc= @gmail.com> wrote:

From: Net Tre= e Inc. <nettreeinc@gmail.com>
Subject: Re: [GENERAL] how do I do d= ump and restore without bugging with constraint?
To: pgsql-admin@postgre= sql.org, pgsql-general@postgresql.org
Date: Wednesday, 24 February, 2010= , 1:57 AM

I see something related with Defe= rrable and Initially deferrable that seems like something could avoid constraints when dumping and restore, but it has to modify the table or re-create all of them to have such option (maybe is what you referraled "table definitions"). Is it what it can be use for to avoid during dumping and restoring?



DEFERRABLE
NOT DEFERRABLE

This controls whether the constraint can be deferred. A constraint that is not deferrable will be checked immediately after every command. Checking of constraints that are deferrable can be postponed until the end of the transaction (using the SET CONSTRAINTS command). NOT DEFERRAB= LE is the default. Only foreign key constraints currently accept this clause. All other constraint types are not deferrable.

= INITIALLY IMMEDIATE
INITIALLY DEFERRED

If a constraint is deferrable, this clause specifies the default time to check the constraint. If the constraint is INITIAL= LY IMMEDIATE, it is checked after each statement. This is the de= fault. If the constraint is INITIALLY DEFERRED= , it is checked only at the end of the transaction. The constra= int check time can be altered with the SET CONSTRAINTS command.




On Tue, Feb 23, 2010 at 12:50 PM, Ne= t Tree Inc. <nettreeinc@gmail.com> wrote:
Hi all,

I am dumping both schema and data from old datab= ase to new one. The new database schema is somehow contain slightly differe= nt schema then the old one. When I do restore it shown alot errors related = with constraints. How can I dump and to restore from old to new without dea= ling with constraint and just forces data dump to where it suppose to belon= g?







--
-----------------------= ----------------
Steven Huang

=0A
=0AYour Mail works best with the New Yahoo Optimized IE8. Get it NOW!. --0-1598437888-1266986621=:57794--