pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Valerio Santinelli <tanis@mediacom.it>
To: jose' soares <sferac@bo.nettuno.it>
Cc: 'pgsql-interfaces@postgreSQL.org' <pgsql-interfaces@postgreSQL.org>
Cc: Michael Davis <michael.davis@prevuenet.com>
Subject: Re: [INTERFACES] Foreign Keys
Date: Thu, 04 Mar 1999 09:01:54 -0100
Message-ID: <36DE7632.F0CFF0AC@mediacom.it> (raw)
References: <93C04F1F5173D211A27900105AA8FCFC145219@lambic.prevuenet.com>
	<36DC61D6.6DF4E87D@insightdist.com>
	<36DD1FD2.11561615@mediacom.it>
	<36DD3669.3A62A57F@bo.nettuno.it>
	<36DD6CEC.967BBD0C@bo.nettuno.it>



jose' soares wrote:

> > Valerio Santinelli ha scritto:
> >
> > > Byron Nikolaidis wrote:
> > >
> > > > Michael Davis wrote:
> > > >
> > > > > Here is the psqlodbc.log file.  The first time the form opens, it correctly
> > > > > opens the first rentalorder.  I immediately moved to the new record in
> > > > > Access which opens a message box with an ODBC error (no description).  I the
> > > > > blank rental order looks okay but the rental order lines records all have
> > > > > errors.  Even if I move back to a valid record, the order lines will show
> > > > > only errors.
> > > > >
> > > > The second problem is this:
> > > >
> > > > conn=153237224, query='SELECT "RentalOrders"."rentalorderlinesid" FROM "rentalorderlines"
> > > > "RentalOrders" WHERE ("rentalorderid" =  NULL ) '
> > > > ERROR from backend during send_query: 'ERROR:  parser: parse error at or near "null"'
> > > > STATEMENT ERROR: func=SC_execute, desc='', errnum=1, errmsg='Error while executing the query'
> > > >
> > > > Since postgres will not recognize the syntax (where 'col' = null)...  it only recognizes
> > > > "isnull".  I was hoping someone would have added the ability for the parser to handle this at
> > > > some point (Hey Dave, maybe you could contribute something here man :-).
> > >
> > > The second problem is affecting my system as well.. do you think that there's a way around it without waiting for someone to patch the PostgreSQL code ?
> > >
> > > --
> > >
> > >
> > > Valerio Santinelli a.k.a. TANiS
> > > [tanis@mediacom.it]+:+[http://www.mediacom.it/~tanis]
> >
> > When I started to use Access97 with PostgreSQL I had this problem too and I made a change to ./src/backend/parser/gram.y
> > to make Access recognize the syntax  "column_name" = NULL and it works fine now.
> > Here attached the patch to gram.y.
> >
> > Buona fortuna.
> >
> > -Jose'-
> > "No other success in life can compensate for failure in the home" (David O. McKay)
>
> Sorry, I forgot attachment.
> -Jose'-
>
>   ------------------------------------------------------------------------
> *** ./src/backend/parser/gram.old.y     Wed Mar  3 15:03:27 1999
> --- ./src/backend/parser/gram.y Wed Dec  2 12:54:12 1998
> ***************
> *** 3323,3328 ****
> --- 3323,3330 ----
>                                 {       $$ = makeA_Expr(OP, "<", $1, $3); }
>                 | a_expr '>' a_expr
>                                 {       $$ = makeA_Expr(OP, ">", $1, $3); }
> +               | a_expr '=' NULL_P
> +                               {       $$ = makeA_Expr(ISNULL, NULL, $1, NULL); }
>                 | a_expr '=' a_expr
>                                 {       $$ = makeA_Expr(OP, "=", $1, $3); }
>                 | ':' a_expr

Thanks. That was what i was looking for. It's been real useful!
I also put this other line to handle the inverse case (NULL = field)

               | NULL_P '=' a_expr
                               {       $$ = makeA_Expr(ISNULL, NULL, $3, NULL);


--

C'ya!

Valerio Santinelli a.k.a. TANiS
[tanis@mediacom.it]+:+[http://www.mediacom.it/~tanis]





view thread (24+ messages)  latest in thread

Message-ID: <36DE7632.F0CFF0AC@mediacom.it>
Permalink:  ../36DE7632.F0CFF0AC@mediacom.it/
Also on:    postgresql.org/message-id/36DE7632.F0CFF0AC@mediacom.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tanis@mediacom.it, sferac@bo.nettuno.it, michael.davis@prevuenet.com
  Subject: Re: [INTERFACES] Foreign Keys
  In-Reply-To: <36DE7632.F0CFF0AC@mediacom.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox