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 1lyKEM-0005it-DF for pgsql-general@arkaria.postgresql.org; Tue, 29 Jun 2021 20:21:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyKEL-0000yx-Bh for pgsql-general@arkaria.postgresql.org; Tue, 29 Jun 2021 20:21:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyKEL-0000yo-0d for pgsql-general@lists.postgresql.org; Tue, 29 Jun 2021 20:21:13 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lyKEI-0000rq-Vb for pgsql-general@lists.postgresql.org; Tue, 29 Jun 2021 20:21:12 +0000 Received: by mail-lf1-x12f.google.com with SMTP id h15so523004lfv.12 for ; Tue, 29 Jun 2021 13:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=U0aqzdHFTjSk4zvtnyuLmVrsh+yoNlPKXRxkIfMEyWg=; b=KbWZFKxM50PeMILe3eHPVEd1GRzOq/xre3qy9c2ITKF8UMkZrr3uCKQ1BMl4biPXCB 1E1ZZV6wWDY/Ib9T/Bj+QPzlRuR+hgsauebDeTXU0YOAJ5b2AFjNdicgkJN7tLB897dJ ZbCY8OHmYi3Qg8qV1KA+1litqNZLNnUpdryMu4dHxbYUOMwDvnlJYId0d2zqbbU2WuNH NmFR7NFFn5KDsidc88BjFq8bqlpWJp1h5OlRcvTML6JHnAZ5dL5IIvZaekS3RznuYjJK u8/AlcdVE2Lz0TrVLG0zkTsvFFJzKfkm+UZjpPapbKoPT84ioIGDVObWr4nQwhX6Cn2S ufRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=U0aqzdHFTjSk4zvtnyuLmVrsh+yoNlPKXRxkIfMEyWg=; b=Wo1cljEFYLWQauFm0/v26UYSP+hLocves5k9rRXsCN2PdDgNU5qgeoyqTfhSb+LsKd T5Q1xmp+OAuU7X7KjekKNINoil+ffHqEgyP0p8AqOmxfg4O6pJfs4OwzNtNr8PfZvnve Kt3IBzRvDLzoJC0elG4Z+mDaTRshVSpbC0zCDWHcjK+3ZRDf2liNBJQVC9JReMBGb0JQ TLxmTwyI0nlkA42MChyWOmC1Ow3La+FNavBWXK3b6tZUqCV/xx32/8Hj0PzwXFIQIzGs qsp70s3Ab32hSWd/OtL1PpZ5AgYu7U5djU0ApSVuuA9uK4OkF1AOSgJek9QHBaBcCu/E SL9g== X-Gm-Message-State: AOAM530vUfRy/67J+KHeUXXIt1vlQfQYOzwqJwyImEHj8yiL8YBLXxF4 PK5lyTrGUioQSWQ7M7RWp2X8fyFzODPTdg== X-Google-Smtp-Source: ABdhPJykSSV2E24/x5ZOrJ9u6oN1OnkAxp5cUwFIYXxGVD9iAYAu0drUny39oE6P025hvzZLBRzD3A== X-Received: by 2002:a19:7608:: with SMTP id c8mr24503269lff.565.1624998068741; Tue, 29 Jun 2021 13:21:08 -0700 (PDT) Received: from [192.168.88.202] ([146.66.183.77]) by smtp.gmail.com with ESMTPSA id u14sm640394ljo.78.2021.06.29.13.21.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Jun 2021 13:21:08 -0700 (PDT) To: pgsql-general@lists.postgresql.org From: George Tarasov Subject: PGDLLIMPORT: patch or not to patch Message-ID: Date: Tue, 29 Jun 2021 23:21:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dear all! (comment: my question relates only to the development area; so, please, re-post to pgsql-hackers if it is allowed). I use PostgreSQL under Windows quiet often and make my own builds in msys2/mingw64 environment. Also I often experiments with the different third-party extensions from the community. And as a result I often faces with a PGDLLIMPORT macro to link all libraries and extensions with the core postgres.exe. For some extensions it is required to patch core and these extensions insert missing PGDLLIMPORTs by itself. Other extensions are not ported under Windows and I prepare my own patches (insert PGDLLIMPORTs) to adopt its under my build environment and link shared libraries correctly. My last case was the "extern ProcessingMode Mode;" variable in the miscadmin.h which i patched by PGDLLIMPORT macro. I have discovered the same modifications in some other extensions. So, my questions are there any rules / descriptions / agreements inside the PostgreSQL Project that define which global variables inside a core code should by specified by a PGDLLIMPORT and which should not?? Or there is freedom; you need this variable in the extension (under Windows), make patch for it yourself! Or there is plan in the community that all global non-static variables should be PGDLLIMPORT-ed by default in the future?? What the right way to propose the PGDLLIMPORT patch to the master and back-ported PostgreSQL code in order to avoid dup patches in the extensions? Thank you! Regards, George Tarasov