pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Brad White <b55white@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: A Small psql Suggestion
Date: Tue, 7 Feb 2023 16:05:44 -0800
Message-ID: <fe011f81-4c5f-b5d5-eaf9-d2203b18debc@aklaver.com> (raw)
In-Reply-To: <CAA_1=91r28Tr8cCXO-t=+hMSPXFvey0CSgLezfZVn851KjgcCw@mail.gmail.com>
References: <CANasJHnK72hqT2MdgoEjcFq+Q=C9DW4KQEL8w9qXony35FMP=w@mail.gmail.com>
	<CAA_1=91r28Tr8cCXO-t=+hMSPXFvey0CSgLezfZVn851KjgcCw@mail.gmail.com>

On 2/7/23 16:00, Brad White wrote:
> Front end: Access 365
> Back end: Postgres 9.4
> (I know, we are in the process of upgrading)
> 
> I'm getting some cases where the SQL sent from MS-Access is failing.
> Looking at the postgres log shows that the field names and table names 
> are not being quoted properly.
> It has been my experience that Access usually does a better job at 
> converting the queries than I would have expected, but not in this instance.
> 
> For example
> 
> Access: connection.Execute "UPDATE [" & strTable & "] SET [" & strTable 
> & "].[InsertFlag] = Null" _
>      & " WHERE ((([" & strTable & "].[InsertFlag])=" & lngCurrUID & 
> "));", , adCmdText Or adExecuteNoRecords
> Note that InsertFlag is bracketed the same way in both instances.
> 
> PSQL: UPDATE "public"."Orders" SET InsertFlag=NULL  WHERE ("InsertFlag" 
> = 166 )
> Note that InsertFlag is quoted once but not the other time.
> Of course this gives the error: column "insertflag" of relation "Order 
> Items" does not exist at character 35
> 
> Any suggestions on where to look?

1) Do not tack on to an existing thread, create a new post.

2) Where is the query coming from, manually created code or something 
ORM like?

3)
> 
> Thanks,
> Brad.

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (7+ messages)  latest in thread

Message-ID: <fe011f81-4c5f-b5d5-eaf9-d2203b18debc@aklaver.com>
Permalink:  ../fe011f81-4c5f-b5d5-eaf9-d2203b18debc@aklaver.com/
Also on:    postgresql.org/message-id/fe011f81-4c5f-b5d5-eaf9-d2203b18debc@aklaver.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, b55white@gmail.com
  Subject: Re: A Small psql Suggestion
  In-Reply-To: <fe011f81-4c5f-b5d5-eaf9-d2203b18debc@aklaver.com>
  References: <CANasJHnK72hqT2MdgoEjcFq+Q=C9DW4KQEL8w9qXony35FMP=w@mail.gmail.com> <CAA_1=91r28Tr8cCXO-t=+hMSPXFvey0CSgLezfZVn851KjgcCw@mail.gmail.com> <fe011f81-4c5f-b5d5-eaf9-d2203b18debc@aklaver.com>

* 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