Re: Copy/Paste table(s) functions - Mailing list pgadmin-hackers

From Guillaume Lelarge
Subject Re: Copy/Paste table(s) functions
Date
Msg-id 4D96E01B.70403@lelarge.info
Whole thread Raw
In response to Copy/Paste table(s) functions  (Vladimir Kokovic <vladimir.kokovic@gmail.com>)
Responses Re: Copy/Paste table(s) functions  (Vladimir Kokovic <vladimir.kokovic@gmail.com>)
List 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

pgadmin-hackers by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: gin/gist indexes show twice
Next
From: "pgAdmin Trac"
Date:
Subject: Re: [pgAdmin III] #310: Handle pg_service.conf file to register a server