Re: [Gambas-user] Database manager Save Table problem

2009-09-11 Thread Benoît Minisini
  Benoît Minisini a écrit :
  ...
 
   Apparently on other database systems, two index can have the same name
   provided they are on different tables.
 
  ? strange (and I'm not sure this fit in SQLs standards)
 
  However, in PG, you can't have a doublon, either it is from tables,
   indexes, sequences (exception for functions, unless args are the same)
   unless your items are in different schemas.
 
   I will modify the postgresql driver to add the table name before each
   index, it should solve the problem.
 
  Be careful because this is PG's standard naming system; an index is
  automatically named as:
  tablename_columnname_key (..._pkey for primary keys)
 
 Yep. Modifying the driver is not the solution at all. I must modify the IDE
 instead...
 

I modified the algorithm used by the database manager to save table definition 
so that index names do not conflict. The fix is in revision 2330 for Gambas 2.

I will make a 2.16.1 release soon.

Regards,

-- 
Benoît Minisini

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Database manager Save Table problem

2009-09-10 Thread Richard Frost
I m a new Gambas2 user, and I am not sure where little things like 
this should be posted, so if it should be somewhere else, please let me 
know.

My system is Ubuntu Jaunty 9.04, Gambas2-2.15.2, Postgresql

In the Database Manager, when I save changes to a table which has an 
index defined, I get an error message that the index already exists.

Looking at the code, in FTable.class, function WriteTable,  there are 
two WriteTableDef  calls, the first which creates a temporary table 
(which it deletes afterward), and then a call to write the actual table.

Postgres evidently requires index names to be unique within the 
database, so the create of the temporary table fails as it tries to 
create another index with the same name, and which of course then it 
does not process the write of the actual table.

It works fine if I delete the indexes first, then save the table, then 
add the indexes back (until I save it again).

My guess is that the write of the temporary table exists to ensure there 
aren't any problems in the table definition before the actual table is 
written.

Anyone have any good ideas about a way around this (changing 
FTable.class) ?

And, how does a user ask if the changes could be incorporated in Gambas ?

Thanks for the help, Dick

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Database manager Save Table problem

2009-09-10 Thread Charlie Reinl
Am Donnerstag, den 10.09.2009, 12:08 -0400 schrieb Richard Frost:
 I m a new Gambas2 user, and I am not sure where little things like 
 this should be posted, so if it should be somewhere else, please let me 
 know.
 
 My system is Ubuntu Jaunty 9.04, Gambas2-2.15.2, Postgresql
 
 In the Database Manager, when I save changes to a table which has an 
 index defined, I get an error message that the index already exists.
 
 Looking at the code, in FTable.class, function WriteTable,  there are 
 two WriteTableDef  calls, the first which creates a temporary table 
 (which it deletes afterward), and then a call to write the actual table.
 
 Postgres evidently requires index names to be unique within the 
 database, so the create of the temporary table fails as it tries to 
 create another index with the same name, and which of course then it 
 does not process the write of the actual table.
 
 It works fine if I delete the indexes first, then save the table, then 
 add the indexes back (until I save it again).
 
 My guess is that the write of the temporary table exists to ensure there 
 aren't any problems in the table definition before the actual table is 
 written.
 
 Anyone have any good ideas about a way around this (changing 
 FTable.class) ?
 
 And, how does a user ask if the changes could be incorporated in Gambas ?
 
 Thanks for the help, Dick
Salut Dick,

for your pb I'v no answer, but

but for your Q: here you are right, 
you found it, ...had you hints ?


-- 
Amicalment
Charlie


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Database manager Save Table problem

2009-09-10 Thread Benoît Minisini
 I m a new Gambas2 user, and I am not sure where little things like
 this should be posted, so if it should be somewhere else, please let me
 know.
 
 My system is Ubuntu Jaunty 9.04, Gambas2-2.15.2, Postgresql
 
 In the Database Manager, when I save changes to a table which has an
 index defined, I get an error message that the index already exists.
 
 Looking at the code, in FTable.class, function WriteTable,  there are
 two WriteTableDef  calls, the first which creates a temporary table
 (which it deletes afterward), and then a call to write the actual table.
 
 Postgres evidently requires index names to be unique within the
 database, so the create of the temporary table fails as it tries to
 create another index with the same name, and which of course then it
 does not process the write of the actual table.

Apparently on other database systems, two index can have the same name 
provided they are on different tables.

I will modify the postgresql driver to add the table name before each index, 
it should solve the problem.

And, as usual, someone finds a bug just after a new version is released. :-)

Regards,

-- 
Benoît Minisini

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Database manager Save Table problem

2009-09-10 Thread Richard Frost
Benoît Minisini wrote:
 I m a new Gambas2 user, and I am not sure where little things like
 this should be posted, so if it should be somewhere else, please let me
 know.

 My system is Ubuntu Jaunty 9.04, Gambas2-2.15.2, Postgresql

 In the Database Manager, when I save changes to a table which has an
 index defined, I get an error message that the index already exists.

 Looking at the code, in FTable.class, function WriteTable,  there are
 two WriteTableDef  calls, the first which creates a temporary table
 (which it deletes afterward), and then a call to write the actual table.

 Postgres evidently requires index names to be unique within the
 database, so the create of the temporary table fails as it tries to
 create another index with the same name, and which of course then it
 does not process the write of the actual table.
 

 Apparently on other database systems, two index can have the same name 
 provided they are on different tables.

 I will modify the postgresql driver to add the table name before each index, 
 it should solve the problem.

 And, as usual, someone finds a bug just after a new version is released. :-)

 Regards,

   
Thanks Benoît,

Sorry about the timing of finding this (relative to the new release), I 
am a very new Gambas user.

So far it is very impressive ... thanks for your's and everyone's hard work.

I also made another post which disappeared, so I'll mention it here in 
case it helps someone else. When I first installed, and  tried to edit 
tables with the database manager, it appeared to do nothing. Eventually 
I discovered that the workspace area of the window where the table edit 
forms are was sized so narrow that it didn't show up (I had a hard time 
even noticing that it was there until I looked at the form design). By 
dragging it back towards the tree view part of the window, everything 
was just fine.

Thanks again, Dick

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Database manager Save Table problem

2009-09-10 Thread Jean-Yves F. Barbier
Benoît Minisini a écrit :
...
 Apparently on other database systems, two index can have the same name 
 provided they are on different tables.

? strange (and I'm not sure this fit in SQLs standards)

However, in PG, you can't have a doublon, either it is from tables, indexes,
sequences (exception for functions, unless args are the same) unless your
items are in different schemas.

 I will modify the postgresql driver to add the table name before each index, 
 it should solve the problem.

Be careful because this is PG's standard naming system; an index is 
automatically named as:
tablename_columnname_key (..._pkey for primary keys)

 And, as usual, someone finds a bug just after a new version is released. :-)

Yeah, Murphy's law is and endless PITA, just like french taxes spontaneous 
generation...

But cheer up, even though you're doing great ;-)

JY
-- 
Q:  Why do firemen wear red suspenders?
A:  To conform with departmental regulations concerning uniform dress.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Database manager Save Table problem

2009-09-10 Thread Benoît Minisini
 Benoît Minisini a écrit :
 ...
 
  Apparently on other database systems, two index can have the same name
  provided they are on different tables.
 
 ? strange (and I'm not sure this fit in SQLs standards)
 
 However, in PG, you can't have a doublon, either it is from tables,
  indexes, sequences (exception for functions, unless args are the same)
  unless your items are in different schemas.
 
  I will modify the postgresql driver to add the table name before each
  index, it should solve the problem.
 
 Be careful because this is PG's standard naming system; an index is
 automatically named as:
 tablename_columnname_key (..._pkey for primary keys)
 

Yep. Modifying the driver is not the solution at all. I must modify the IDE 
instead...

-- 
Benoît Minisini

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user