At 09:39 AM 20-08-2001 -0700, Mikheev, Vadim wrote:
>> If it does then one of the things I'd use it for is to insert
>> unique data without having to lock the table or rollback on
>> failed insert (unique index still kept as a guarantee).
>
>(Classic example how could be used SAVEPOINTs -:))

I guess so. But this could be faster.

>So, in your application you would first lock a key in excl mode
>(for duration of transaction), than try to select and insert unless
>found? (Note that this will not work with serializable isolevel.)

yep:
lock "tablename.colname.val=1"
select count(*) from tablename where colname=1
If no rows, insert, else update.
(dunno if the locks would scale to a scenario with hundreds of concurrent
inserts - how many user locks max?).

Why wouldn't it work with serializable isolevel?

Anyway, I believe that isolevel doesn't really serialise things in this
case (inserting a unique row) so it wouldn't matter to me.

Regards,
Link.


Tue, 21 Aug 2001 14:26:06 +0800
Lincoln Yeoh <lyeoh@pop.jaring.my>
RE: User locks code
Hi all,

I'm currently trying to develop a log analyzer for PostgreSQL logs and at
the first
stage I'm finding a little problem with the postgresql.conf option
log_timestamp.

The problem is that if this option is set to false we have no idea of when
the backend
is started:

DEBUG:  database system was shut down at 2001-08-20 21:51:54 CEST
DEBUG:  CheckPoint record at (0, 126088776)
DEBUG:  Redo record at (0, 126088776); Undo record at (0, 0); Shutdown TRUE
DEBUG:  NextTransactionId: 489793; NextOid: 77577
DEBUG:  database system is in production state

Is it possible to have it into the last line as we have the information of
the database
shutdown timestamp in the first line ?

Also, an other question is why using timestamp into the other log instead of
the value
of  time  in  seconds  since  the  Epoch like the time() function do ?

I don't know if it is speedest or not but if timestamp is system local
dependant
I think it should be very difficult to me to have a portable log analyzer...

Regards,

Gilles Darold


Tue, 21 Aug 2001 09:45:50 +0200
Gilles DAROLD <gilles@darold.net>
Postgresql log analyzer
Gilles DAROLD writes:

> Is it possible to have it into the last line as we have the information of
> the database
> shutdown timestamp in the first line ?

We not just turn time stamping on?

> Also, an other question is why using timestamp into the other log instead of
> the value
> of  time  in  seconds  since  the  Epoch like the time() function do ?

Because humans generally reckon time the former way.

> I don't know if it is speedest or not but if timestamp is system local
> dependant
> I think it should be very difficult to me to have a portable log analyzer...

In the current system, the timestamp is not locale dependent, but that
doesn't mean that it could be in the future.  (I wouldn't find it
particularly useful, because the current format is internationally
readable.)

What *is* locale dependent are the messages, though.  Not sure how you
plan to deal with that.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Tue, 21 Aug 2001 17:49:42 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Postgresql log analyzer
Hi all,

Here is a first draft generated by a log analyzer for postgres I've wrote today:

    http://www.samse.fr/GPL/log_report/

In all this html report there is what I'm able to extract minus the statistics.

I need to know what people want to see reported to have a powerfull log analyzer,

I can spend this week do do that...

Peter, sorry for my poor english that what I mean is that if you don't activated
the
log_timestamp option we have no idea when the postmaster have been started
(or at least doing a ls -la on /tmp/.s.PGSQL.5432). Other things was just
question
and you answer them, thanks.

Regards



Tue, 21 Aug 2001 20:35:25 +0200
Gilles DAROLD <gilles@darold.net>
Re: [HACKERS] Postgresql log analyzer
Gilles DAROLD wrote:
> 
> Hi all,
> 
> Here is a first draft generated by a log analyzer for postgres I've wrote today:
> 
>     http://www.samse.fr/GPL/log_report/
> 
> In all this html report there is what I'm able to extract minus the statistics.
> 
> I need to know what people want to see reported to have a powerfull log analyzer,

I like what you have there so far.

For my own use I would like to see the ability to turn some of these off,
and also perhaps a summary page that you would click through to the more
detailed reports.

The 'query' page is kind of complicated too.  Would it be possible to put
that into a table layout as well?
+-------------------------------+
|select...                      |
+----+----+----+--------+-------+
|stat|stat|stat|stat ...|       |
+----+----+----+--------+-------+

sort of layout.

It would be nice to see an EXPLAIN on the query page, but you would want
this to be an option, I guess.  I imagine you could do this by getting the
EXPLAIN at log analysis time if it isn't in the logs.

Cheers,
					Andrew.
-- 
_____________________________________________________________________
        Andrew McMillan, e-mail: Andrew @ catalyst . net . nz
Catalyst IT Ltd, PO Box 10-225, Level 22, 105 The Terrace, Wellington
Me: +64(21)635-694,  Fax:+64(4)499-5596, Office: +64(4)499-2267xtn709

Wed, 22 Aug 2001 08:03:26 +1200
Andrew McMillan <andrew@catalyst.net.nz>
Re: [HACKERS] Postgresql log analyzer
Hi all,

I have updated the drafts for pg log analyzer especially for EXPLAIN  output.
What do you want to see as statistics result. Currently I only output the following:

- scan type
- startup cost
- total cost
- number of rows returned
- and the width

There's certainly other usefull information but I don't know. Please let me know !

Note:

This is a simple draft to show what can be done, as a general purpose it will include:

- A configuration file (to choose what should be reported, paths, etc...)
   or/and command line args
- An index page with resume of all reports
- Incremental scan working on full or rotate log

For other good requests it's done...

Let me know any other requests otherwise I will publish the first release at least on
monday
if not tomorow !

    http://www.samse.fr/GPL/log_report/

Regards,

Gilles Darold

Andrew McMillan wrote:

> Gilles DAROLD wrote:
> >
> > Hi all,
> >
> > Here is a first draft generated by a log analyzer for postgres I've wrote today:
> >
> >     http://www.samse.fr/GPL/log_report/
> >
> > In all this html report there is what I'm able to extract minus the statistics.
> >
> > I need to know what people want to see reported to have a powerfull log analyzer,
>
> I like what you have there so far.
>
> For my own use I would like to see the ability to turn some of these off,
> and also perhaps a summary page that you would click through to the more
> detailed reports.
>
> The 'query' page is kind of complicated too.  Would it be possible to put
> that into a table layout as well?
> +-------------------------------+
> |select...                      |
> +----+----+----+--------+-------+
> |stat|stat|stat|stat ...|       |
> +----+----+----+--------+-------+
>
> sort of layout.
>
> It would be nice to see an EXPLAIN on the query page, but you would want
> this to be an option, I guess.  I imagine you could do this by getting the
> EXPLAIN at log analysis time if it isn't in the logs.
>
> Cheers,
>                                         Andrew.
> --
> _____________________________________________________________________
>         Andrew McMillan, e-mail: Andrew @ catalyst . net . nz
> Catalyst IT Ltd, PO Box 10-225, Level 22, 105 The Terrace, Wellington
> Me: +64(21)635-694,  Fax:+64(4)499-5596, Office: +64(4)499-2267xtn709
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html




Thu, 23 Aug 2001 14:35:47 +0200
Gilles DAROLD <gilles@darold.net>
Re: Postgresql log analyzer