Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQ0wX-005mdv-1h for pgsql-odbc@arkaria.postgresql.org; Mon, 01 Dec 2025 10:15:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQ0wV-001xab-0u for pgsql-odbc@arkaria.postgresql.org; Mon, 01 Dec 2025 10:15:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQ0wU-001xaT-2x for pgsql-odbc@lists.postgresql.org; Mon, 01 Dec 2025 10:15:39 +0000 Received: from pgintl.fastcrypt.com ([149.56.129.164]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQ0wR-002YTD-2C for pgsql-odbc@postgresql.org; Mon, 01 Dec 2025 10:15:37 +0000 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by pgintl.fastcrypt.com (Postfix) with ESMTPSA id BF00620229 for ; Mon, 1 Dec 2025 05:15:34 -0500 (EST) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-949033fb2a9so188360539f.2 for ; Mon, 01 Dec 2025 02:15:34 -0800 (PST) X-Gm-Message-State: AOJu0Yz21mZ1KHDEDusOLOsiu1ztlq5ctKAIKUnVMagQGt+Rjb9ca8dT hyUq/EoPXLKjSdaN2BHIJAkLi8mVI3CguYyUrKaz3AsxMkaXm6voutK+8WIty4rt6MmZy98JSwY V5GfjE0EobrsS4vYhdDxKmZWbPSwG5t8= X-Google-Smtp-Source: AGHT+IHULnCx9fT8SkQiLSoHXlNNXkZtvuStjdbWQ9op+N1FbtXMyPSab4utRN3pBnM21B8l72yOszg8ZfIj5I3U/4g= X-Received: by 2002:a02:c9ce:0:b0:5b7:50dc:2ecb with SMTP id 8926c6da1cb9f-5b999784160mr14452777173.18.1764584134064; Mon, 01 Dec 2025 02:15:34 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dave Cramer Date: Mon, 1 Dec 2025 05:15:18 -0500 X-Gmail-Original-Message-ID: X-Gm-Features: AWmQ_bmecz-RGtSSWtv_VCzneXJyjFbxVq97lclM7YEZ_FitQFUwXTjXJCs-Su4 Message-ID: Subject: Re: Catch "RAISE NOTICE" in ODBC application To: Igor Korot Cc: PostgreSQL ODBC list Content-Type: multipart/alternative; boundary="0000000000007cbfb00644e142dc" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007cbfb00644e142dc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 30 Nov 2025 at 15:24, Igor Korot wrote: > Hi, Dave, > > Let=E2=80=99s say I catch CREATE TABLE DDL command and I ran create table= inside > my program. > > It will be caught and I can process it with that call. > > Now what would happen if I run CREATE TABLE inside psql shell? > > It will raise the notice but will I be able to catch it? > > Thank you. > As I said, I have no idea. You could just try it. You should ask on the general list. Dave > > > On Sun, Nov 30, 2025 at 12:10=E2=80=AFPM Dave Cramer > wrote: > >> I have no idea what psql will do >> Dave Cramer >> www.postgres.rocks >> >> >> On Sun, 30 Nov 2025 at 12:37, Igor Korot wrote: >> >>> Hi, >>> >>> Will it catch it if the event occur inside the application only or from >>> psql as well? >>> >>> Thank you. >>> >>> >>> On Sun, Nov 30, 2025 at 3:31=E2=80=AFAM Dave Cramer >>> wrote: >>> >>>> ChatGPT shows this: >>>> >>>> SQLGetDiagRec( >>>> SQL_HANDLE_STMT, // statement handle >>>> hstmt, >>>> iRecord, // record number, starting at 1 >>>> SqlState, >>>> &NativeError, >>>> MessageText, >>>> BufferLength, >>>> &TextLengthPtr >>>> ); >>>> >>>> Notices will have: >>>> >>>> - >>>> >>>> SqlState =3D "00000" >>>> - >>>> >>>> NativeError =3D 0 >>>> - >>>> >>>> MessageText =3D "" >>>> >>>> >>>> - >>>> >>>> Dave Cramer >>>> www.postgres.rocks >>>> >>>> >>>> On Sun, 30 Nov 2025 at 02:58, Igor Korot wrote: >>>> >>>>> Hi, ALL, >>>>> How do I do that? >>>>> >>>>> Google showed only the libpq way... >>>>> >>>>> Thank you. >>>>> >>>>> >>>>> --0000000000007cbfb00644e142dc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable



On Sun, 30 Nov 2025 at 15:24, Igor Korot <ikorot01@gmail.com> wrote:
Hi, Dave,

Let=E2=80=99s say I catch CREATE TABL= E DDL command and I ran create table inside my program.

It will be caught and I can process it with= that call.

Now what wou= ld happen if I run CREATE TABLE inside psql shell?
<= br>
It will raise the notice but will I be able to c= atch it?

Thank you.


As I said, I have no idea.= You could just try it.

You should ask on the gene= ral list.

Dave=C2=A0


On Sun, Nov 30, 2025= at 12:10=E2=80=AFPM Dave Cramer <davecramer@postgres.rocks> wrote:
=
I have no idea what psql will do
Dave Cramer
www= .postgres.rocks


On Sun, 30 Nov 2025 at 12:37, Ig= or Korot <ikorot= 01@gmail.com> wrote:
Hi,

Will it catch it if the event occur inside the application only o= r from psql as well?

Tha= nk you.


On Sun, Nov 30, 2025 at 3:31=E2=80= =AFAM Dave Cramer <davecramer@postgres.rocks> wrote:
ChatGPT sh= ows this:

SQLGetDiagRec(
=C2=A0 =C2=A0 SQL_HAND= LE_STMT, =C2=A0// statement handle
=C2=A0 =C2=A0 hstmt,
=C2=A0 =C2=A0= iRecord, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0// record number, starting at 1=
=C2=A0 =C2=A0 SqlState,
=C2=A0 =C2=A0 &NativeError,
=C2=A0 = =C2=A0 MessageText,
=C2=A0 =C2=A0 BufferLength,
=C2=A0 =C2=A0 &Te= xtLengthPtr
);

Notices will have:

  • SqlState =3D "00000"

  • NativeError =3D 0

  • MessageText =3D "<your NOTICE text>"

Dave Cramer
www.postgres.rocks


=
On Sun, 30= Nov 2025 at 02:58, Igor Korot <ikorot01@gmail.com> wrote:
Hi, ALL,
How do I do that?

Google showed only the libpq way...

Thank you.


--0000000000007cbfb00644e142dc--