Re: Copy/Paste table(s) functions

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Vladimir Kokovic <vladimir(dot)kokovic(at)gmail(dot)com>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Copy/Paste table(s) functions
Date: 2011-04-02 08:36:43
Message-ID: 4D96E01B.70403@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Le 31/03/2011 13:31, Vladimir Kokovic a écrit :
> Hi,
>
> Finally I've made Copy/Paste table(s) operations !
>

Great.

> Usage is very simple and intuitive:
> on right mouse menu for selected connected table or schema select
> 'Copy table(s)' and than on other connected schema on right mouse menu
> select 'Paste table(s).
>
> Source target server-db might be different but always connected.
>

I tried it and had different issues.

Why should the schema be different? you should better ask the name of
the new object. Moreover, if I try to paste on another database, we
shouldn't care that the schema is the same. IMNSHO, you should get rid
of this check. And if it happens that the table you copy has the same
name than another table in the same schema, then ask the user to type
the new name.

If I copy a table (which is on the public schema) on another schema, I
always end up with the message "ERROR: relation "table_name" already
exists"). Schema is not added to the table name, so it fails. If I copy
from schema s1 to schema s2, it works.

I don't like the way you create the sequence, even if Im' not sure there
is a better way.

The way you check for same database and same host is wrong. This is your
check:

if (sourceconn->GetDbname() + sourceconn->GetHost() ==
targetconn->GetDbname() + targetconn->GetHost())

Let's say I have this:
* source database: base1
* source host: host1
* dest database: bas
* dest host: e1host1

Of course, it is a really stupid example. But with your check, pgAdmin
thinks they are the same, even if they aren't.

When I finally succeded to copy a table, I found that the browser isn't
refreshed.

Well, all this is not to discourage you with this tool. I needed some
time to agree that it would be a great tool. But it needs more work.

Thanks for working on it.

Oh, and try to find a way to get rid of the gotos. It hurts my eyes :)

--
Guillaume
http://www.postgresql.fr
http://dalibo.com

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message pgAdmin Trac 2011-04-02 13:53:50 Re: [pgAdmin III] #310: Handle pg_service.conf file to register a server
Previous Message Guillaume Lelarge 2011-04-02 07:52:57 Re: gin/gist indexes show twice