Re: Disappearing Records

From: Rory Browne <rory(dot)browne(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Terry Fielder <terry(at)ashtonwoodshomes(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Disappearing Records
Date: 2005-11-01 22:59:53
Message-ID: fa07888a0511011459x1f19802dk2fe980d2a259c484@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks guys for your suggestions, but the problem turned out to be my
lack of experience(with PostgreSQL), combined with a bug in our PHP
Code.

Coming from a MySQL background, I assumed that if you "select x from
y", then y would be the name of a table. It turned out that in the
case that y was actually a view. It has a complex defination, but for
explanitory sake, lets say it was defined as:

select u.username, g.groupname from users u, groups g where u.group_id=g.id
(assuming users are in exactly one group)

If the group_id field in the users table was corrupted, and set to a
value that isn't in the groups table, then that view wouldn't return
anything.

Something like that(except that our view wasn't quite as simple) happened to me.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nels Lindquist 2005-11-01 23:03:59 Copying data from one column to another
Previous Message Tino Wildenhain 2005-11-01 22:46:41 Re: SQL injection