Thread: Debian w/ DBI/DBD

Debian w/ DBI/DBD

From
Jason
Date:
hi,

I think I have DBI and DBD installed OK, and postgres seems to be
working OK.  But, I can not access DBI from a perl script.  I get a
DBI/Pg.pm not found, then asked if I have it installed.  Is there some
magical trick to this under Debian 2.1, or have I missed a package along
the way.

Thanks,
    Jason

--
.............
......... Jason C. Leach
...... University College of the Cariboo
... jcl@mail.ocis.net
.. http://www.ocis.net/~jcl
.

The Search for Extraterrestrial Intelligence from Home:
http://setiathome.ssl.berkeley.edu



Re: [GENERAL] Debian w/ DBI/DBD

From
Charles Tassell
Date:
If you installed Postgres from source instead of getting a prebuilt
package, you probably have to, as root,  go into your src/interfaces/perl5
dir and type "make install"  This is because the perl include dirs are
usually only writable by root, so when you do a "make install" as the
postgres user, the Pg module can't be installed.

If you installed a package, I dunno.  Try getting the source and doing a
"./configure --with-perl; cd interfaces/perl5; make install" as root.

At 04:45 AM 11/21/99, Jason wrote:
>hi,
>
>I think I have DBI and DBD installed OK, and postgres seems to be
>working OK.  But, I can not access DBI from a perl script.  I get a
>DBI/Pg.pm not found, then asked if I have it installed.  Is there some
>magical trick to this under Debian 2.1, or have I missed a package along
>the way.
>
>Thanks,
>     Jason
>
>--
>.............
>......... Jason C. Leach
>...... University College of the Cariboo
>... jcl@mail.ocis.net
>.. http://www.ocis.net/~jcl
>.
>
>The Search for Extraterrestrial Intelligence from Home:
>http://setiathome.ssl.berkeley.edu
>
>
>
>************


Re: [GENERAL] logging stuff in the right sequence.

From
Lincoln Yeoh
Date:
Hi,

I'm trying to set up logging tables and need a bit of help.

I would like to ensure that things are stored so that they can be retrieved
in the correct sequence.

The example at http://www.postgresql.org/docs/postgres/rules17277.htm
says:
CREATE TABLE shoelace_log (
        sl_name    char(10),      -- shoelace changed
        sl_avail   integer,       -- new available value
        log_who    name,          -- who did it
        log_when   datetime       -- when
    );

 CREATE RULE log_shoelace AS ON UPDATE TO shoelace_data
        WHERE NEW.sl_avail != OLD.sl_avail
        DO INSERT INTO shoelace_log VALUES (
                                        NEW.sl_name,
                                        NEW.sl_avail,
                                        getpgusername(),
                                        'now'::text
                                    );

However is there a guarantee that datetime is sufficient for correct order
if an item is updated by different people one after the other at almost the
same time?

I would prefer something like

CREATE TABLE shoelace_log (
     log_sequence serial        -- sequence of events
        sl_name    char(10),      -- shoelace changed
        sl_avail   integer,       -- new available value
        log_who    name,          -- who did it
        log_when   datetime,       -- when
    );

 CREATE RULE log_shoelace AS ON UPDATE TO shoelace_data
        WHERE NEW.sl_avail != OLD.sl_avail
        DO INSERT INTO shoelace_log VALUES (
                                        NEW.sl_name,
                                        NEW.sl_avail,
                                        getpgusername(),
                                        'now'::text
                                    );

However I notice there isn't a column name specification in the DO INSERT
INTO, how would I format the INSERT INTO statement so that log_sequence is
not clobbered? Can I use the normal INSERT into format and specify the
columns? I haven't managed to get it to work that way. Would defining the
sequence at the end of the table help? That would be untidy tho ;).

Can/should I use now() instead of 'now'::text?

The serial type is an int4. Hmm, there actually may be more than 2 billion
updates to keep track off :). But I suppose we could cycle the logs and
resequence.

Cheerio,

Link.




Re: [GENERAL] Debian w/ DBI/DBD

From
Stephane Bortzmeyer
Date:
On Sunday 21 November 1999, at 16 h 45, the keyboard of Jason
<jcl@mail.ocis.net> wrote:

> I think I have DBI and DBD installed OK, and postgres seems to be
> working OK.  But, I can not access DBI from a perl script.  I get a
> DBI/Pg.pm not found,

Install the 'libdbd-pg-perl' package.