pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: kadib001@gmail.com
Subject: BUG #16165: Query Works fine but spam so many LOG: unrecognized win32 error code: 38
Date: Sat, 14 Dec 2019 03:44:37 +0000
Message-ID: <16165-4b1f5eb62a95c727@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16165
Logged by:          Sasuke Vita
Email address:      kadib001@gmail.com
PostgreSQL version: 12.1
Operating system:   Windows Server 2016
Description:        

i just realize when see postgre log, seeing so many spam log, it was query
for insertbulk from my app.

i try to manual produce the error using PGAdmin 4.16, then execute sql:

CREATE TABLE "#LOG_TEMP"
	 (
	 "TerminalId" integer NOT NULL,
	 "PIN" character varying(20) COLLATE pg_catalog."default" NOT NULL,
	 "AttDate" date NOT NULL,
	 "AttHourMinute" time without time zone NOT NULL,
	 "AttTime" time without time zone NOT NULL,
	 "InOutMode" integer NOT NULL,
	 "VerifyMode" smallint NOT NULL,
	 "WorkCode" integer
	 );
	INSERT INTO
"#LOG_TEMP"("TerminalId","PIN","AttDate","AttHourMinute","AttTime","InOutMode","VerifyMode","WorkCode")
	VALUES(436,'203030029','2020-01-01','12:34:00','12:34:56',1,0,NULL),
	(436,'203030029','2020-01-01','13:34:00','13:34:56',1,0,NULL);
	
	WITH "cte" AS ( SELECT ROW_NUMBER() OVER(PARTITION BY "TerminalId", "PIN",
"AttDate", "AttHourMinute" ORDER BY "AttDate" DESC, "AttTime" DESC) AS
"RN",
	"TerminalId", "PIN", "AttDate", "AttHourMinute", "AttTime", "InOutMode",
"VerifyMode", "WorkCode" FROM "#LOG_TEMP" )
	INSERT INTO "IClock"."LOG_TEMP"("TerminalId",
"PIN","AttDate","AttHourMinute","AttTime","InOutMode","VerifyMode","WorkCode","CreateBy","CreateDate")
	SELECT t."TerminalId", t."PIN", t."AttDate", t."AttHourMinute",
t."AttTime", t."InOutMode", t."VerifyMode", t."WorkCode", '#TEMPORARY',
'2020-01-01 00:00:00'
	FROM (SELECT * FROM "cte" WHERE "RN" = 1) t
	WHERE NOT EXISTS (SELECT 1 FROM "IClock"."LOG_TEMP" WHERE
t."TerminalId"="TerminalId" AND t."PIN"="PIN" AND t."AttDate"="AttDate" AND
t."AttHourMinute"="AttHourMinute");
	
	DROP TABLE "#LOG_TEMP";

then got log message unrecognized win32 error code: 38

2019-12-14 09:12:49.377 +07 [12128] LOG:  unrecognized win32 error code:
38
2019-12-14 09:12:49.377 +07 [12128] STATEMENT:  CREATE TABLE "#LOG_TEMP"
	 (
	 "TerminalId" integer NOT NULL,
	 "PIN" character varying(20) COLLATE pg_catalog."default" NOT NULL,
	 "AttDate" date NOT NULL,
	 "AttHourMinute" time without time zone NOT NULL,
	 "AttTime" time without time zone NOT NULL,
	 "InOutMode" integer NOT NULL,
	 "VerifyMode" smallint NOT NULL,
	 "WorkCode" integer
	 );
	INSERT INTO
"#LOG_TEMP"("TerminalId","PIN","AttDate","AttHourMinute","AttTime","InOutMode","VerifyMode","WorkCode")
	VALUES(436,'203030029','2020-01-01','12:34:00','12:34:56',1,0,NULL),
	(436,'203030029','2020-01-01','13:34:00','13:34:56',1,0,NULL);
	
	WITH "cte" AS ( SELECT ROW_NUMBER() OVER(PARTITION BY "TerminalId", "PIN",
"AttDate", "AttHourMinute" ORDER BY "AttDate" DESC, "AttTime" DESC) AS
"RN",
	"TerminalId", "PIN", "AttDate", "AttHourMinute", "AttTime", "InOutMode",
"VerifyMode", "WorkCode" FROM "#LOG_TEMP" )
	INSERT INTO "IClock"."LOG_TEMP"("TerminalId",
"PIN","AttDate","AttHourMinute","AttTime","InOutMode","VerifyMode","WorkCode","CreateBy","CreateDate")
	SELECT t."TerminalId", t."PIN", t."AttDate", t."AttHourMinute",
t."AttTime", t."InOutMode", t."VerifyMode", t."WorkCode", '#TEMPORARY',
'2020-01-01 00:00:00'
	FROM (SELECT * FROM "cte" WHERE "RN" = 1) t
	WHERE NOT EXISTS (SELECT 1 FROM "IClock"."LOG_TEMP" WHERE
t."TerminalId"="TerminalId" AND t."PIN"="PIN" AND t."AttDate"="AttDate" AND
t."AttHourMinute"="AttHourMinute");
	
	
	DROP TABLE "#LOG_TEMP";

the query works fine, but why spam logs, LOG:  unrecognized win32 error
code: 38?



view thread (2+ messages)  latest in thread

Message-ID: <16165-4b1f5eb62a95c727@postgresql.org>
Permalink:  ../16165-4b1f5eb62a95c727@postgresql.org/
Also on:    postgresql.org/message-id/16165-4b1f5eb62a95c727@postgresql.org

 · 

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-bugs@postgresql.org
  Cc: noreply@postgresql.org, kadib001@gmail.com
  Subject: Re: BUG #16165: Query Works fine but spam so many LOG: unrecognized win32 error code: 38
  In-Reply-To: <16165-4b1f5eb62a95c727@postgresql.org>
  References: <16165-4b1f5eb62a95c727@postgresql.org>

* 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