phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] Patches for PostgreSQL??


From: Dave Hall
Subject: Re: [Phpgroupware-developers] Patches for PostgreSQL??
Date: Wed, 26 Nov 2003 06:51:39 +1100

Brian Johnson <address@hidden> wrote:

> I think we're kind of going in the same direction with this .. all 
> apps need to have
> their SQL rewritten where this problem occurs

There are other SQL issues which have been addressed in the 16 branch. 
It is a slow process to fix all of the code, but it is being done slowly
as we find problems.

> 
> I think it has been done with the core apps, and can be done for 
> other apps as
> problems are encountered

I do not have pgsql setup - and I am unlikely to do this for a while. 
At the same time everytime I make a change to a file, I check the SQL
and make the changes, other devs are doing this too.

> 
> Perhaps a section on SQL writing should be included in the dev 
> docs on the wiki
> 1. this
> 2. don't include semi colons at end
> 3. urls to function for mysql, msql, and pgsql for cross comparison
> etc
> 
> 
> Dani Oderbolz (address@hidden) wrote:
> >
> >Brian Johnson wrote:
> >
> >>The 'cause' is postgresl 7.3
> >>
> >>They decided to change how they handle empty fields in this version
> >>
> >Its true that this Postgres change (ACK that they changed it) 
> causes many problems.
> >But it cuases problems with queries which are, say, less than 
> optimal.>Many people confuse '' by NULL for example, but this just 
> is not the same!
> >
> >Consider this code for example:
> >
> >./phpgwapi/setup/tables_update_0_9_10.inc.php:                  
> $db2->query("SELECT
> account_lid FROM phpgw_accounts WHERE 
> account_lid='$group_name'",__LINE__,__FILE__);>
> >
> >So, if  account_lid is not set you get this:
> >SELECT account_lid FROM phpgw_accounts WHERE account_lid=''
> >
> >
> >The resultset will contain all rows, whose account
> >is an empty string - which is allowed!
> >So logically, this is really bad.
> >The *Intention* however was this:
> >SELECT account_lid FROM phpgw_accounts WHERE account_lid IS NULL
> >
> >Which cannot occour, because account_lid has a NOT NULL Constraint.
> >
> >See the problem?
> >
> >
> >Cheers,
> >Dani
> >
> >
> >
> >
> >_______________________________________________
> >Phpgroupware-developers mailing list
> >address@hidden
> >http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
> >
> 
> 
> 
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
> 

Attachment: dave.hall.vcf
Description: Card for <dave.hall@mbox.com.au>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]