Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n97KA-0004xN-KI for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Jan 2022 15:20:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n97K9-0005YN-8I for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Jan 2022 15:20:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n97K8-0005YD-Tr for pgsql-bugs@lists.postgresql.org; Sun, 16 Jan 2022 15:20:04 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n97K6-0007sT-Qu for pgsql-bugs@lists.postgresql.org; Sun, 16 Jan 2022 15:20:04 +0000 Received: by mail-pl1-x630.google.com with SMTP id g5so17678722plo.12 for ; Sun, 16 Jan 2022 07:20:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=kQ56dpPCwvu1d/97jfMbqY9aPDXyOjr28JTusxLIT2o=; b=Q28IqXgXiZcMitlb65Jr3U5F2SQz04lau3ZjhpIPjoupRIH2LsMIP2vLNkplNCNI30 0/dnq7wPEwtx5WyHEYJZXjz4W9j1/8nZdn58QMnguEHi5q2HDbynmV7dfno1CBQu6VSj o3O12nVxoX6QAsPOJaR+7xWdhCJkm1PMwLJ/D3cRBGjSkKpT//KP1XtbBWWstWKqFBHT cuLZVOKI384VOyIZmJpJAqFwHO98fORuwUFWy7XVtZ2Ej6IY2BIWLfr11Ok02skuQJPy cYhUMzqn9HeAhHniStkMGoyz7HHRV+MJwVy1Et6KNvZkUPlhlQrSIrE7CL0rzCbc9dVa Ut+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kQ56dpPCwvu1d/97jfMbqY9aPDXyOjr28JTusxLIT2o=; b=D7Xb0B/DxaBb8rxibVGWSrXiWpU788mDmBeYNi4D/GF+NrgdK7a8VDJebYsIgIdIzX 3LPX9MyubfqRcQiktDo4hgUOrkNDe8BzAyrN//RPQ0x9z8+NPCeDrKpkpVXaQeKeI/Zz LbGB9l9x9ezcuSQ5CTWA2IoSOrebfM6RQdw1HpNNKspilyFLOPzXsYgHV3nP58G1eKfm KwPZZXGk85cTWVT7KfmhHawO/LPWIPQmdFDb4nB+p8X+hcHbKSkYd/CsAjvhBcUeS8VX hgSWC/peol21joJr5d92TYhZKLU6l+t2WSVccStRPxd1mpy14yMjscHHBbrd8yG9O94V 43Fw== X-Gm-Message-State: AOAM530i+4on1SEMF/mlCkKaqRx0TwRZfkGf1LQONAiIj8Wy/aTuueSf TRuPRKmSOoPnN1lEg/SUcIs= X-Google-Smtp-Source: ABdhPJw4HqF1YCjxF49Jno8gno2BX74LXMkN6wsjmGqykB7EupyXZ8xWZs6EujN/V4QQ12GX0hvbjw== X-Received: by 2002:a17:90a:460f:: with SMTP id w15mr29925550pjg.123.1642346400599; Sun, 16 Jan 2022 07:20:00 -0800 (PST) Received: from nol (2001-b011-1005-32bb-6ef9-f4c2-2bf0-9df5.dynamic-ip6.hinet.net. [2001:b011:1005:32bb:6ef9:f4c2:2bf0:9df5]) by smtp.gmail.com with ESMTPSA id t25sm9298600pgv.9.2022.01.16.07.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jan 2022 07:20:00 -0800 (PST) Date: Sun, 16 Jan 2022 23:18:35 +0800 From: Julien Rouhaud To: Mario Emmenlauer Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17365: Error: redefinition of 'stat' in win32_port.h when including postgres.h Message-ID: <20220116151835.ro3b3shvsmmdeyt4@nol> References: <17365-c58cbf9d0c29586a@postgresql.org> <20220113122310.ay24ciikcu257nkp@jrouhaud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Sun, Jan 16, 2022 at 04:06:45PM +0100, Mario Emmenlauer wrote: > > > Actually I do not really mean to include `postgres.h`. But I do want > to identify result types with `Oid vOID = ::PQftype(mResult.get(), vColumn);` > to check the result type. And the types seem to be defined in header > `catalog/pg_type.h` which only worked when `postgres.h` was included before. > > I guess I'm off the standard track here. Its not completely mandatory for > me to identify the result types. But it was quite nice to be able to do > so. > > Is this actually unsupported? Or am I doing something wrong? It's supported and multiple clien-side programs access those constants. However you don't need to include postgres.h for that. There are examples in the tree that relies on OID defines if you want to check how it's done, for instance src/bin/pg_dump/pg_dump.c. Note that the OIDs aren't in pg_type.h anymore since pg 11. Are you still compiling against pg 10 or less?