Re: [Bacula-users] Postgres functions for interpreting the bacula "LStat" column
2008-12-19 14:21:02
The advantage of a "C" stored procedure is speed:
bacula=# SELECT MAX('a'||bacula_lstat_mtime(lstat)) FROM file WHERE
fileid<1000000 ;
max
-------------------------
a2008-02-27 20:24:10-05
(1 row)
Time: 70.689 ms
bacula=# SELECT MAX(base64_decode_lstat(12,lstat)*interval '1 second' +
timestamptz 'epoch') FROM file WHERE fileid<1000000 ;
max
------------------------
2008-02-27 20:24:10-05
(1 row)
Time: 762.390 ms
Otherwise, the PL/perl function does the same thing; thanks for the pointer!
ebollengier wrote:
>
> You can also use the bweb pure PL function for that (see
> bweb/scripts/bweb-postgresql.sql).
>
> DavidLeeLambert wrote:
>> I was looking into making queries for a particular file in a Bacula
>> Postgres database, and came up with the attached functions. [...]
--
David Lee Lambert
Software Developer, Precision Motor Transport Group, LLC
------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
|
|
|