Re: 7.3 LOCK TABLE problem

Поиск
Список
Период
Сортировка
От Chris Gamache
Тема Re: 7.3 LOCK TABLE problem
Дата
Msg-id 20030127210415.1459.qmail@web13805.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: 7.3 LOCK TABLE problem  (Neil Conway <neilc@samurai.com>)
Ответы Re: 7.3 LOCK TABLE problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Sorry... wrote the code specifically for the email, and didn't run it through
the perl -c syntax checker. I was merely trying to get the general idea of the
process of the script. Consider "my $procid = $$;" in the code somewhere, and
for argument's sake, all the ;'s and {'s and }'s in the right places.

IMO, this isn't a perl problem unless the problem is an incompatiblity in the
"PgSQL" module with 7.3.1.

If I can reproduce this on a clean install of PostgreSQL, then what next?

CG

--- Neil Conway <neilc@samurai.com> wrote:
> On Mon, 2003-01-27 at 15:21, Chris Gamache wrote:
> >     BEGIN;
> >     LOCK TABLE queue IN EXCLUSIVE MODE;
> >     UPDATE queue
> >       set status=$$
> >     WHERE id = (SELECT min(id)
> >        FROM queue
> >        WHERE status=0);
>
> This is unrelated, but note that the sub-select would probably be faster
> written as:
>
> SELECT id FROM queue WHERE status = 0 ORDER BY id ASC LIMIT 1;
>
> As this form of the query can use a btree index on "id" if one's
> present.
>
> >     SELECT id, data
> >     FROM queue
> >     WHERE status=$procid;
>
> My Perl's a bit rusty, but AFAICS $procid is undefined. Perhaps 'perl
> -w' and "use strict;" would be a good idea?
>
> Cheers,
>
> Neil
>
> --
> Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC
>
>
>


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: JDBC driver
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Inherited tables and NOT NULL (pg 7.2.1)