From: | Schwaighofer Clemens <clemens(dot)schwaighofer(at)tequila(dot)jp> |
---|---|
To: | Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: transfering tables into other schema |
Date: | 2009-02-18 03:42:42 |
Message-ID: | fed954960902171942s3b0a1468le3775e56c73e8519@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Feb 18, 2009 at 07:31, Ivan Sergio Borgonovo
<mail(at)webthatworks(dot)it> wrote:
> alter table y set schema new_schema;
>
> test=# SELECT * from x();
> ERROR: relation "y" does not exist
> CONTEXT: SQL statement " select a,b from x join y on x.xid=y.xid"
> PL/pgSQL function "x" line 2 at RETURN QUERY
> test=# SELECT a,b from x join new_schema.y on y.xid=x.xid;
> a | b
> ---+---
> (0 rows)
>
> I did a similar test changing x schema with similar results.
> So, pk/fk relationships survive. Function don't survive.
you just moved one table to the new schema. 'x' is still in the old,
where 'y' is in the new schema.
If you want to keep one table in "public" and the other in
"new_schema" then you have to rewrite all functions. I am not sure
about constraints, they might do that automatically.
--
[ Clemens Schwaighofer -----=====:::::~ ]
[ IT Engineer/Manager ]
[ E-Graphics Communications, TEQUILA\ Japan IT Group ]
[ 6-17-2 Ginza Chuo-ku, Tokyo 104-8167, JAPAN ]
[ Tel: +81-(0)3-3545-7703 Fax: +81-(0)3-3545-7343 ]
[ http://www.tequila.jp ]
Advertising Age Global Agency of the Year 2008
Adweek Global Agency of the Year 2008
This e-mail is intended only for the named person or entity to which
it is addressed and contains valuable business information that is
privileged, confidential and/or otherwise protected from disclosure.
Dissemination, distribution or copying of this e-mail or the
information herein by anyone other than the intended recipient, or
an employee or agent responsible for delivering the message to the
intended recipient, is strictly prohibited. All contents are the
copyright property of TBWA Worldwide, its agencies or a client of
such agencies. If you are not the intended recipient, you are
nevertheless bound to respect the worldwide legal rights of TBWA
Worldwide, its agencies and its clients. We require that unintended
recipients delete the e-mail and destroy all electronic copies in
their system, retaining no copies in any media.If you have received
this e-mail in error, please immediately notify us via e-mail to
disclaimer(at)tbwaworld(dot)com(dot) We appreciate your cooperation.
We make no warranties as to the accuracy or completeness of this
e-mail and accept no liability for its content or use. Any opinions
expressed in this e-mail are those of the author and do not
necessarily reflect the opinions of TBWA Worldwide or any of its
agencies or affiliates.
From | Date | Subject | |
---|---|---|---|
Next Message | John R Pierce | 2009-02-18 04:15:37 | Re: Strange Grant behavior in postgres 8.3 |
Previous Message | Schwaighofer Clemens | 2009-02-18 03:31:09 | Re: Strange Grant behavior in postgres 8.3 |