Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs

From: David Hartwig <daveh(at)insightdist(dot)com>
To: "Jose' Soares Da Silva" <sferac(at)bo(dot)nettuno(dot)it>, Byron Nikolaidis <byronn(at)insightdist(dot)com>, interfaces postgres <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs
Date: 1998-06-12 14:38:55
Message-ID: 35813D7F.2E097E35@insightdist.com (view raw or flat)
Thread:
Lists: pgsql-interfacespgsql-sql
Oops!  Here's a better way without the shared module.

-- Overload int4eq

create function int4eq(xid,int4)
  returns bool
  as ''
  language 'internal';

create operator = (
        leftarg=xid,
        rightarg=int4,
        procedure=int4eq,
        commutator='=',
        negator='<>',
        restrict=eqsel,
        join=eqjoinsel
        );


David Hartwig wrote:

> Here is is what you will need.   I hope you know how to compile a shared lib for your
> platform.  This can be an adventure if you have not done it before.     You will have to
> adjust the path in the CREATE FUNCTION statement to your lib dir.   Run the SQL after you
> compile and install the shared lib.     To test, do something like:
>
>     SELECT * FROM foo WHERE xmin = {some_constant}
>
> I plan to submit a patch to make this a part of the 6.4 base release.
>
> Jose' Soares Da Silva wrote:
>
> > On Thu, 11 Jun 1998, Byron Nikolaidis wrote:
> >
> > > Jose',
> > >
> > > I got row versioning working with the "xmin" field.  Since it is a system column, and
> > > automatically updates, you would not need triggers all over the place on every table.
> > > I made it a datasource option called "Row Versioning".
> > >
> > > It works well with Access except for two minor caveats:
> > >
> > > 1)  The driver has to report the 'xmin' field in SQLColumns.  There is no way around
> > > that I can see.  Access, thus displays it.  Users can of course hide the column if they
> > > hate looking at it.  And Access won't let you type into this field which is good.
> > >
> > > 2) You have to create an '=' operator for the xid type on the postgres side since one
> > > does not already exist.  I have the code to do it if you are interested (it is very
> > > small).  For 6.4, we would make sure this operator is added.
> > >
> > Ok Byron, I think this is a good solution.
> > In this way we don't need to add a TIMESTAMP to every table there's already a
> > XMIN present.
> > In any way, what's happen with TIMESTAMPs ? May we have Access recognize it as
> > DATETIME or we can't because Access beleaves that's a ROWVER ?
> > I would like to try it. Please Byron may you send me the code for '=' operator
> > for xid type.
> >                                                          Jose'
>
>   ------------------------------------------------------------------------
> /*      Insight Distribution Systems - System V - Apr 1998      */
> static char accntnum_c[] = "@(#)accntnum.c      1.1 /sccs/sql/extend/s.accntnum.c 4/28/98 09:06:54";
>
> #include <stdio.h>                              /* for sprintf() */
> #include <string.h>
> #include "postgres.h"
> #include "utils/palloc.h"
>
> bool
> xidint4_eq(int32 arg1, int32 arg2)
> {
>         return (arg1 == arg2);
> }
>
>   ------------------------------------------------------------------------
> --   Insight Distribution Systems - System V - Apr 1998
> --   %W% :%P% %G% %U%"
>
> create function xidint4_eq(xid,int4)
>   returns bool
>   as '/ceo/pgsql/lib/xidint4.so'
>   language 'c';
>
> create operator = (
>         leftarg=xid,
>         rightarg=int4,
>         procedure=xidint4_eq,
>         commutator='=',
>         negator='<>',
>         restrict=eqsel,
>         join=eqjoinsel
>         );




In response to

pgsql-interfaces by date

Next:From: David HartwigDate: 1998-06-12 15:58:17
Subject: Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs
Previous:From: Byron NikolaidisDate: 1998-06-12 13:57:22
Subject: Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs

pgsql-sql by date

Next:From: Jackson, DeJuanDate: 1998-06-12 15:43:41
Subject: RE: [SQL] how to bulky-copy data in postgreSql
Previous:From: Byron NikolaidisDate: 1998-06-12 13:57:22
Subject: Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group