Discussion:
Postres support
Sigurd Nes
2008-06-18 08:15:49 UTC
Permalink
Hi all,

I propose to drop support for postgres prior to 8.2

There was a change in behavior regarding the use of oid that has impact on class.db.inc.php (the get_last_insert_id) and class.schema_proc_pgsql.inc.php for retrieving various meta data.

How about it

Regards

Sigurd
Dave Hall
2008-06-18 10:33:26 UTC
Permalink
Post by Sigurd Nes
Hi all,
I propose to drop support for postgres prior to 8.2
There was a change in behavior regarding the use of oid that has impact on class.db.inc.php (the get_last_insert_id) and class.schema_proc_pgsql.inc.php for retrieving various meta data.
How about it
Project policy has always been to support what debian stable ships.
They currently ship 7.3 so the answer is no
http://packages.debian.org/stable/postgresql

Cheers

Dave
Benoit Hamet
2008-06-18 11:22:56 UTC
Permalink
Hi all,
Post by Dave Hall
Post by Sigurd Nes
Hi all,
I propose to drop support for postgres prior to 8.2
There was a change in behavior regarding the use of oid that has impact on class.db.inc.php (the get_last_insert_id) and class.schema_proc_pgsql.inc.php for retrieving various meta data.
Can you give concrete example of problems ?
Post by Dave Hall
Post by Sigurd Nes
How about it
Project policy has always been to support what debian stable ships.
They currently ship 7.3 so the answer is no
Well, that's not true :). It's 7.4 (at least here in France :). [thus
the answer is still no]

This is causing me trouble anyway, with the change of the account_pwd
size ... this version of pgsql doesn't support the
"ALTER TABLE table ALTER COLUMN column TYPE type;" SQL ...
The only way to do it (on a non living system) is to dump the db, change
the value of the CREATE table and restore the db ... which isn't so bad
since then you have a db backup :).

That's perhaps an idea for the GSoc setup :) (update tables process).
- do a backup :
- Modify the schema there.
- Reload the whole tables ...
* caught * caught * ... hum sorry, I'm a little bit tired :).

Regards.

Caeies.
Sigurd Nes
2008-06-18 13:01:05 UTC
Permalink
Sent: 2008-06-18 13:22:56 CEST
Subject: Re: [phpGroupWare-developers] Postres support / update DB to 0.9.18.015
Can you give concrete example of problems ?
I don't have access to a pre 8.2 - but I think you can test the reporting of constraints by navigate to setup/sqltoarray.php?appname=<your favorite>&submit=True

you might want to have fk, uc, and ix on (some of) your tables.

I had some problems with reporting on fk for version later than 8.2.
I'm not sure (haven't looked into it recently )that adodb's MetaForeignKeys returned a desired result.

There is some code from phpPgAdmin - that could be used - but that one assumes that you are looking at nspname='public'

Regards

Sigurd
Benoit Hamet
2008-06-18 14:50:05 UTC
Permalink
Hi Sigurd,
Post by Sigurd Nes
Sent: 2008-06-18 13:22:56 CEST
Subject: Re: [phpGroupWare-developers] Postres support / update DB to 0.9.18.015
Can you give concrete example of problems ?
I don't have access to a pre 8.2 - but I think you can test the reporting of constraints by navigate to setup/sqltoarray.php?appname=<your favorite>&submit=True
you might want to have fk, uc, and ix on (some of) your tables.
Well, in my light application, no apps are using fk ... so was hard to
test. Anyway I add the constraints for acl_account to references
account_id into phpgw_account.account_id : Here the output on a pgsql 7.4 :
'phpgw_acl' => array(
'fd' => array(
'acl_account' => array('type' => 'int', 'precision' => 4,'nullable' =>
True),
'acl_rights' => array('type' => 'int', 'precision' => 4,'nullable' =>
True),
'acl_grantor' => array('type' => 'int', 'precision' => 4,'nullable' =>
True),
'acl_type' => array('type' => 'int', 'precision' => 2,'nullable' => True),
'location_id' => array('type' => 'int', 'precision' => 4,'nullable' =>
True)
),
'pk' => array(),
'fk' => array('phpgw_accounts' => array('acl_account' => 'account_id')),
'ix' => array(acl_account),
'uc' => array()
),

So it's working for install before 8.2
Post by Sigurd Nes
I had some problems with reporting on fk for version later than 8.2.
Hu, So I misunderstood you're previous point. You want to support pgsql
only until 8.2 ???
Post by Sigurd Nes
I'm not sure (haven't looked into it recently )that adodb's MetaForeignKeys returned a desired result.
There is some code from phpPgAdmin - that could be used - but that one assumes that you are looking at nspname='public'
Sorry, I guess I'm totaly lost ...

In your first mail you were saying :
"
I propose to drop support for postgres prior to 8.2

There was a change in behavior regarding the use of oid that has impact
on class.db.inc.php (the get_last_insert_id) and
class.schema_proc_pgsql.inc.php for retrieving various meta data.
"
Ok, you are telling us, that version > 8.2 of pgsql are not working with
the actual code ... and your solution is to drop the working code ????

Well, let me think twice about that :
- the get_last_insert_id : For me it's the adodb layer which is
responsible for these things, not "us". So if their code is broken, help
them to fix it, do not try to workaround in our code. Perhaps are we
misusing their code, in that case, we should fix it... For now I propose
that the code of that function being the following :
public function get_last_insert_id($table, $field)
{
return $this->adodb->Insert_ID($table, $field);
}
and nothing else.
If you have STRONG arguments against it, give it to all of us, and we
will discuss and see. if no I will commit this in 2 weeks.

- class.schema_proc_pgsql.inc.php : well I'm not sure that these
classes are still needed "like this" since they don't seems to use the
adodb layer but use SQL directly ... so I thing that updating them
should be done instead of only supporting a version of pgsql ... Will
try to look at it now.

Regards.

Caeies
Sigurd Nes
2008-06-18 15:35:14 UTC
Permalink
Sent: 2008-06-18 16:50:05 CEST
Subject: Re: [phpGroupWare-developers] Postres support -> Proposal
Hi Sigurd,
Post by Sigurd Nes
Sent: 2008-06-18 13:22:56 CEST
Subject: Re: [phpGroupWare-developers] Postres support / update DB to 0.9.18.015
Can you give concrete example of problems ?
I don't have access to a pre 8.2 - but I think you can test the reporting of constraints by navigate to setup/sqltoarray.php?appname=<your favorite>&submit=True
you might want to have fk, uc, and ix on (some of) your tables.
Well, in my light application, no apps are using fk ... so was hard to
test. Anyway I add the constraints for acl_account to references
'phpgw_acl' => array(
'fd' => array(
'acl_account' => array('type' => 'int', 'precision' => 4,'nullable' =>
True),
'acl_rights' => array('type' => 'int', 'precision' => 4,'nullable' =>
True),
'acl_grantor' => array('type' => 'int', 'precision' => 4,'nullable' =>
True),
'acl_type' => array('type' => 'int', 'precision' => 2,'nullable' => True),
'location_id' => array('type' => 'int', 'precision' => 4,'nullable' =>
True)
),
'pk' => array(),
'fk' => array('phpgw_accounts' => array('acl_account' => 'account_id')),
'ix' => array(acl_account),
'uc' => array()
),
So it's working for install before 8.2
Ok - that's good :)
Post by Sigurd Nes
I had some problems with reporting on fk for version later than 8.2.
Hu, So I misunderstood you're previous point. You want to support pgsql
only until 8.2 ???
Not at all :)
I want to support versions later than 8.2

But since the version we have to support is 7.4 - I'm withdrawing the original proposal.
Post by Sigurd Nes
I'm not sure (haven't looked into it recently )that adodb's MetaForeignKeys returned a desired result.
There is some code from phpPgAdmin - that could be used - but that one assumes that you are looking at nspname='public'
Sorry, I guess I'm totaly lost ...
"
I propose to drop support for postgres prior to 8.2
There was a change in behavior regarding the use of oid that has impact
on class.db.inc.php (the get_last_insert_id) and
class.schema_proc_pgsql.inc.php for retrieving various meta data.
"
Ok, you are telling us, that version > 8.2 of pgsql are not working with
the actual code ... and your solution is to drop the working code ????
It's working just fine (for post 8.2 anyway - don't know about pre-versions) - thought it might be a bit simplified.
- the get_last_insert_id : For me it's the adodb layer which is
responsible for these things, not "us". So if their code is broken, help
them to fix it, do not try to workaround in our code. Perhaps are we
misusing their code, in that case, we should fix it... For now I propose
public function get_last_insert_id($table, $field)
{
return $this->adodb->Insert_ID($table, $field);
}
and nothing else.
If you have STRONG arguments against it, give it to all of us, and we
will discuss and see. if no I will commit this in 2 weeks.
Then you will have support for pre 8.2 only - and that would be a sad situation.

and for mssql you will need something like (tested and working):
<code>
if(!isset($table) || $table == '' || !isset($field) || $field == '')
{
return -1;
}
$result = @mssql_query("select @@identity", $this->adodb->_queryID);
if(!$result)
{
return -1;
}
return mssql_result($result, 0, 0);

</code>

That's my argument - don't know if it is a STRONG one :)
- class.schema_proc_pgsql.inc.php : well I'm not sure that these
classes are still needed "like this" since they don't seems to use the
adodb layer but use SQL directly ... so I thing that updating them
should be done instead of only supporting a version of pgsql ... Will
try to look at it now.
In my experience - you can use adodb for some of it - but not everything - expecting it to work for both pre and post 8.2

Regards

Sigurd
Benoit Hamet
2008-06-18 15:43:06 UTC
Permalink
Hi all,
Post by Sigurd Nes
Sent: 2008-06-18 16:50:05 CEST
Subject: Re: [phpGroupWare-developers] Postres support -> Proposal
Hi Sigurd,
Sent: 2008-06-18 13:22:56 CEST
Subject: Re: [phpGroupWare-developers] Postres support / update DB to 0.9.18.015
<snip/>
Post by Sigurd Nes
Then you will have support for pre 8.2 only - and that would be a sad situation.
<code>
if(!isset($table) || $table == '' || !isset($field) || $field == '')
{
return -1;
}
This case should never occured. If it's the case, then fix the calling
code. Anyway, why the following code is not into adodb ???
Post by Sigurd Nes
if(!$result)
{
return -1;
}
return mssql_result($result, 0, 0);
This should be contributed to adodb. Not use as a WA in our code !
Post by Sigurd Nes
</code>
That's my argument - don't know if it is a STRONG one :)
- class.schema_proc_pgsql.inc.php : well I'm not sure that these
classes are still needed "like this" since they don't seems to use the
adodb layer but use SQL directly ... so I thing that updating them
should be done instead of only supporting a version of pgsql ... Will
try to look at it now.
In my experience - you can use adodb for some of it - but not everything - expecting it to work for both pre and post 8.2
So to make it clear, adodb doesn't fully support pgsql > 8.2 nor mssql ?

regards,

Caeies
Sigurd Nes
2008-06-18 15:55:04 UTC
Permalink
Sent: 2008-06-18 17:43:06 CEST
Subject: Re: [phpGroupWare-developers] Postres support -> Proposal
So to make it clear, adodb doesn't fully support pgsql > 8.2 nor mssql ?
Yes - that is correct - at least in my experience.

Regards

Sigurd
Benoit Hamet
2008-06-23 18:09:38 UTC
Permalink
Hi All,

Sigurd, just to let you know that I posted a patch on Savannah (
http://savannah.gnu.org/patch/?6541 ) about the sqltoarray issue. Any
feedback appreciated :).

Regards.

Caeies.
Post by Sigurd Nes
Sent: 2008-06-18 17:43:06 CEST
Subject: Re: [phpGroupWare-developers] Postres support -> Proposal
So to make it clear, adodb doesn't fully support pgsql > 8.2 nor mssql ?
Yes - that is correct - at least in my experience.
Regards
Sigurd
------------------------------------------------------------------------
_______________________________________________
phpGroupWare-developers mailing list
http://lists.gnu.org/mailman/listinfo/phpgroupware-developers
Sigurd Nes
2008-06-28 00:22:02 UTC
Permalink
Post by Benoit Hamet
Hi All,
Sigurd, just to let you know that I posted a patch on Savannah (
http://savannah.gnu.org/patch/?6541 ) about the sqltoarray issue. Any
feedback appreciated :).
Any conclusion on the fk issue?

Regards

Sigurd
Benoit Hamet
2008-07-02 16:37:12 UTC
Permalink
Hi all,

Hi Sigurd,
Post by Sigurd Nes
Post by Benoit Hamet
Hi All,
Sigurd, just to let you know that I posted a patch on Savannah (
http://savannah.gnu.org/patch/?6541 ) about the sqltoarray issue. Any
feedback appreciated :).
Any conclusion on the fk issue?
I was hoping to be able to push a patch to adodb patch tracker but
unfortunately my regular work took me more time than expected, and I
wasn't able to do it. And I'm running out of the world for 3 weeks from
now ... So I guess than we will have to wait.

In all cases, this should be reported to adodb, not in our code base.

Regards.

Caeies.

Dave Hall
2008-06-18 14:22:48 UTC
Permalink
Post by Sigurd Nes
Hi all,
Post by Dave Hall
Post by Sigurd Nes
Hi all,
I propose to drop support for postgres prior to 8.2
There was a change in behavior regarding the use of oid that has impact on class.db.inc.php (the get_last_insert_id) and class.schema_proc_pgsql.inc.php for retrieving various meta data.
Can you give concrete example of problems ?
Post by Dave Hall
Post by Sigurd Nes
How about it
Project policy has always been to support what debian stable ships.
They currently ship 7.3 so the answer is no
Well, that's not true :). It's 7.4 (at least here in France :). [thus
the answer is still no]
typo, but the answer is still the same here too :)
Sigurd Nes
2008-06-18 15:49:37 UTC
Permalink
Sent: 2008-06-18 13:22:56 CEST
Subject: Re: [phpGroupWare-developers] Postres support / update DB to 0.9.18.015
Interesting version - couldn't find 0.9.18.015 on savanna - the latest I could find seemed to be 0.9.17.515

Regards

Sigurd
Loading...