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 1vPnxx-00F8gd-1z for pgsql-odbc@arkaria.postgresql.org; Sun, 30 Nov 2025 20:24:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vPnxt-00GzVR-2a for pgsql-odbc@arkaria.postgresql.org; Sun, 30 Nov 2025 20:24:14 +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 1vPnxt-00GzVJ-1J for pgsql-odbc@lists.postgresql.org; Sun, 30 Nov 2025 20:24:13 +0000 Received: from mail-yx1-xb12d.google.com ([2607:f8b0:4864:20::b12d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vPnxq-002Sdq-1b for pgsql-odbc@postgresql.org; Sun, 30 Nov 2025 20:24:12 +0000 Received: by mail-yx1-xb12d.google.com with SMTP id 956f58d0204a3-63f9beb2730so2625682d50.0 for ; Sun, 30 Nov 2025 12:24:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764534249; x=1765139049; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=nnvXTKHFXA+IQiHSEkwxjQ+ioDXgflpPFb+h+5L1S8M=; b=ezIa5Jodp6DoyzD3stb+fut1tP4P8tOaOUK29tdIe4eAJg5dt/h01BOn0WKpKACyQz iVpJqgCJJqUKpjMpzggmGsrbGtF8BbxrNktBBjJWdG8a6QrCjPMc+TzBrIMkMoynWccv lGMNSLROrLvY6W9qr3tgagHANYd+a7rHlrTSupHkinPMyYobKIiW+KlUi5QV5K4qKK7r 4Ti9e7OwjRkSaFGCph+O+dTve8U4JxVFyCoxp5bWlxL/bTytxqtwGvJuz/p+2Irecl9e XzrCsJJqgOzOF7TAWrsB9XmlbRyiwqIFy4c0ZHBWfhMUwuOlwRWC1rKt+9lPf1nIim24 ehsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764534249; x=1765139049; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nnvXTKHFXA+IQiHSEkwxjQ+ioDXgflpPFb+h+5L1S8M=; b=wh8Q7bQa+sUS+ScSGJZRpqHmyhqhMCVSWzoxf8F2QcInchq86y9pZsJyhoG8+v8gAL egXw3wTuzNyB8faDZKLwFLRdUclfdluDsOfi+v63TLWBUzhhnNDeG1HkOTGm0s0wwVA4 gC0RkGkYV0YuQTXYyzK/DU7S+STStI2tHZU2GzjGgcNgEr9hiRjsuJcOVAJT7syR/LD1 1teQLc3SACqWUvZhhO2Y9C7ikv6wrWH+1h4s1NuXM7TVr54VzMLbvrwCJtk1qs9AE2ic JZKPEnzUkbhjrxa9/bdTkA4+ykT2aOgjarqqTf16tPNxL/ZjhrSps9EtBSWkuHT02JS0 up/Q== X-Forwarded-Encrypted: i=1; AJvYcCWIlds61999b1a3EsNiePU1Xyf3jIxOlNQm9mDNVAbS394M8lz2FN34loO5lpqPH7HejM+Wl3Nw0XHk@postgresql.org X-Gm-Message-State: AOJu0Yw90XaOAWwA6jTDiGFGzlorsprvyBPU68MzMdsi8FkvQTPXYdkN RdRxk3gSDaH/L/E2RnyHPL04Fw5m0EHclAN/vHtXLMKdXppVp1vORg4QMLBdIASteIr3sFpGaRR eLI6fpSbpss/BrGpIkLX6HVnWjekUrx7Haw== X-Gm-Gg: ASbGncsWsiefL6lYKhq3KsQnmUfmTiHefy1jM6/wDjJFvuETNuzCLtEPGFF52TKuq7K YBZHbFZ/+nZNYQUdo7GkGT+ZCoJElXiVVfljHcoXRp43ICQQ9Uq0ubX1FuLH9CDQIJbBGhMvwCV axnGd2GpbWfPJc2sPVg5Y4/2LdrjZZR2cFhjHkm56fbhjkkYbBL6/zvzp76ZbGVuin3zpRr72MZ ar2nTk1fgj3k5FLizPJHjZu2Ke+4SOzLAe9C8ZPVZt7mV91EXn6Lb8qxhIH9vvjrb8= X-Google-Smtp-Source: AGHT+IEGBI1ThVGYk5kqwvX2c5iaHg5uwngdgHngY+B7q2ukAStoi4uAThYFAwWozMk1kKbUg3zpE4Pc1XpBRDVXpJY= X-Received: by 2002:a05:690c:6f8e:b0:77f:a301:4634 with SMTP id 00721157ae682-78ab6f19dbemr188667697b3.45.1764534249551; Sun, 30 Nov 2025 12:24:09 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Igor Korot Date: Sun, 30 Nov 2025 12:23:59 -0800 X-Gm-Features: AWmQ_bnghKtWuZ9RUdbQYAUHXhtsiayJynkdYn-HP34nkTmnrCejWQKlxAEJhi4 Message-ID: Subject: Re: Catch "RAISE NOTICE" in ODBC application To: Dave Cramer , PostgreSQL ODBC list Content-Type: multipart/alternative; boundary="0000000000002378fe0644d5a570" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002378fe0644d5a570 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Dave, Let=E2=80=99s say I catch CREATE TABLE DDL command and I ran create table i= nside 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. 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. >>>> >>>> >>>> --0000000000002378fe0644d5a570 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, Dave,

Let=E2=80=99s say I catch CREATE TABLE DDL command and I ran create tab= le inside my program.

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

Now what would happen if I run CREATE TABLE in= side psql shell?

It will= raise the notice but will I be able to catch it?
Thank you.

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


On Sun, 30 Nov 2025 at 12:37, Igor Korot <ikorot01@gmail.com>= wrote:
Hi,

Will it ca= tch 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 <= ;davecramer@postgres.rocks> wrote:
ChatGPT shows this:
<= br>
SQLGetDiagRec(
=C2=A0 =C2=A0 SQL_HANDLE_STMT, =C2=A0// sta= tement 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 Sq= lState,
=C2=A0 =C2=A0 &NativeError,
=C2=A0 =C2=A0 MessageText,=C2=A0 =C2=A0 BufferLength,
=C2=A0 =C2=A0 &TextLengthPtr
);
<= /div>

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.


--0000000000002378fe0644d5a570--