Show tables ? + 2 Feature requests -- CREATE TABLE

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Sep 19 08:56:38 CDT 2007


On 19/9/07 4:06 PM, "Bart Pietercil" <bart.pietercil at gmail.com> wrote:

Hi Bart,

>>> 2) Feature request: When running the show tables query the result
>>> includes a field called text where , for views, the create statement
>>> is stored.

>>> Would it be possible to do the same (store the create statement in
>>> the text field) for tables. This would make it easier to copy tables
>>> from one db to another, instead of dumping a table to disk (sql) and
>>> the opening the .sql file copying the create statement and pasting
>>> this in the SQL editor.

>>> I do realise that the create statement would need to include the
>>> alter table statement in order to define the links.
 
>> Strictly speaking - it  is  impossible.  Look - there is a single
>> way to
>> create  an  view  -  CREATE  VIEW  statement.  But  it  could  be some
>> dependency for the tables.
>> Example: Assume we have two tables t1 and t2. T2 has ObjectPtr pointed
>> to  table t1. Now you want to get a single statement which can be used
>> for t2 creation. Something like this:
>> 
>> CREATE TABLE t2 ( fPtr ObjectPtr REFERENCES t1 ON DELETE SET NULL );
>> 
>> But there is no guarantee that table t1 exists - right?

>> So it is not so simple and can not be expressed in a single statement.
>> You  can  try  to  make  SQL dump for some database and you will see -
>> there are some "ALTER TABLE" statements presented in most of cases.

> Agree, but it still would be handy. I mean now I dump the db and by
> hand collect all relevant statements to rebuild a table in another db.
> 
> So in SQL Editor I get
> 
> create .....
> 
> alter objptr.... constrain
> for each objectptr and I verify if tables that are referenced exist
> in the new db
> 
> It would be handy to collect these statements with one click and then
> paste the result in the sql editor where they can be edited and
> modified where necessary

Okay Bart,

This is not easy task, we need all think about it...

As I see you need it to maintain two different Vservers. Yes?

I remember few months ago, you have point some Postgre related utility,
which do diagrams and some scripts. Diagrams we have implement more or less,
so now Vstudio guys can try do second feature.


IMHO in ideal the task which you describe above should looks as easy as
    
    Drag and Drop of table T2 from db1 to db2 window.

Agree?

    and Valentina Studio then should show any helper dialogs to help
    resolve complex issues with dependencies around this table.
  


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list