| From: | Igor Korot <ikorot01(at)gmail(dot)com> |
|---|---|
| To: | Dave Cramer <davecramer(at)postgres(dot)rocks>, PostgreSQL ODBC list <pgsql-odbc(at)postgresql(dot)org> |
| Subject: | Re: Catch "RAISE NOTICE" in ODBC application |
| Date: | 2025-11-30 20:23:59 |
| Message-ID: | CA+FnnTzpGzMLMMH1HU_cF5y=MmydwVSuffmfhvDsAdqK9WAQcA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-odbc |
Hi, Dave,
Let’s 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.
On Sun, Nov 30, 2025 at 12:10 PM Dave Cramer <davecramer(at)postgres(dot)rocks>
wrote:
> I have no idea what psql will do
> Dave Cramer
> www.postgres.rocks
>
>
> On Sun, 30 Nov 2025 at 12:37, Igor Korot <ikorot01(at)gmail(dot)com> 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 AM Dave Cramer <davecramer(at)postgres(dot)rocks>
>> 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 = "00000"
>>> -
>>>
>>> NativeError = 0
>>> -
>>>
>>> MessageText = "<your NOTICE text>"
>>>
>>>
>>> -
>>>
>>> Dave Cramer
>>> www.postgres.rocks
>>>
>>>
>>> On Sun, 30 Nov 2025 at 02:58, Igor Korot <ikorot01(at)gmail(dot)com> wrote:
>>>
>>>> Hi, ALL,
>>>> How do I do that?
>>>>
>>>> Google showed only the libpq way...
>>>>
>>>> Thank you.
>>>>
>>>>
>>>>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dave Cramer | 2025-12-01 10:15:18 | Re: Catch "RAISE NOTICE" in ODBC application |
| Previous Message | Dave Cramer | 2025-11-30 11:31:13 | Re: Catch "RAISE NOTICE" in ODBC application |