mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Make Windows 10 the minimal runtime requirement for WIN32
This commit bumps the runtime value of _WIN32_WINNT to be 0x0A00 for any builds on Windows. Hence, this makes Windows 10 the minimal requirement when running PostgreSQL under WIN32, be it for builds of Cygwin, MinGW or Visual Studio. The previous minimal runtime version was either Windows Vista when building with at least Visual Studio 2015 or Windows XP for the rest. Windows 10 is the most modern version supported by Microsoft, and per discussion, as we don't have buildfarm members that run older versions anymore, this is the minimal supported version that suits better for our needs. This will actually make easier the development of some patches, two being async I/O and large page handling by avoiding a lot of compatibility gotchas, on platforms that have most likely few users anyway. It is possible to remove MIN_WINNT in win32.h and the macros IsWindowsXXXOrGreater() that were used in the code at runtime to check which version of Windows was getting used. The change in pg_locale.c comes from Juan. Note that all my tests passed, and that the CI is green. The buildfarm will quickly tell if this needs more adjustments. Author: Michael Paquier, Juan José Santamaría Flecha Reviewed-by: Thomas Munro Discussion: https://postgr.es/m/Yo7tHKD8VCkeNi71@paquier.xyz
This commit is contained in:
@ -82,11 +82,7 @@
|
|||||||
as well as standalone Windows SDK releases 8.1a to 10.
|
as well as standalone Windows SDK releases 8.1a to 10.
|
||||||
64-bit PostgreSQL builds are supported with
|
64-bit PostgreSQL builds are supported with
|
||||||
<productname>Microsoft Windows SDK</productname> version 8.1a to 10 or
|
<productname>Microsoft Windows SDK</productname> version 8.1a to 10 or
|
||||||
<productname>Visual Studio 2013</productname> and above. Compilation
|
<productname>Visual Studio 2013</productname> and above.
|
||||||
is supported down to <productname>Windows 7</productname> and
|
|
||||||
<productname>Windows Server 2008 R2 SP1</productname> when building with
|
|
||||||
<productname>Visual Studio 2013</productname> to
|
|
||||||
<productname>Visual Studio 2022</productname>.
|
|
||||||
<!--
|
<!--
|
||||||
For 2013 requirements:
|
For 2013 requirements:
|
||||||
https://docs.microsoft.com/en-us/visualstudio/productinfo/vs2013-sysrequirements-vs
|
https://docs.microsoft.com/en-us/visualstudio/productinfo/vs2013-sysrequirements-vs
|
||||||
@ -358,8 +354,7 @@ $ENV{MSBFLAGS}="/m";
|
|||||||
<title>Special Considerations for 64-Bit Windows</title>
|
<title>Special Considerations for 64-Bit Windows</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
PostgreSQL will only build for the x64 architecture on 64-bit Windows, there
|
PostgreSQL will only build for the x64 architecture on 64-bit Windows.
|
||||||
is no support for Itanium processors.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -2136,7 +2136,7 @@ export MANPATH
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<productname>PostgreSQL</productname> can be expected to work on these operating
|
<productname>PostgreSQL</productname> can be expected to work on these operating
|
||||||
systems: Linux (all recent distributions), Windows (XP and later),
|
systems: Linux (all recent distributions), Windows (10 and later),
|
||||||
FreeBSD, OpenBSD, NetBSD, macOS, AIX, HP/UX, and Solaris.
|
FreeBSD, OpenBSD, NetBSD, macOS, AIX, HP/UX, and Solaris.
|
||||||
Other Unix-like systems may also work but are not currently
|
Other Unix-like systems may also work but are not currently
|
||||||
being tested. In most cases, all CPU architectures supported by
|
being tested. In most cases, all CPU architectures supported by
|
||||||
@ -2323,16 +2323,15 @@ ERROR: could not load library "/opt/dbs/pgsql/lib/plperl.so": Bad address
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <command>adduser</command> command is not supported; use
|
The <command>adduser</command> command is not supported; use
|
||||||
the appropriate user management application on Windows NT,
|
the appropriate user management application on Windows.
|
||||||
2000, or XP. Otherwise, skip this step.
|
Otherwise, skip this step.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <command>su</command> command is not supported; use ssh to
|
The <command>su</command> command is not supported; use ssh to
|
||||||
simulate su on Windows NT, 2000, or XP. Otherwise, skip this
|
simulate su on Windows. Otherwise, skip this step.
|
||||||
step.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
@ -290,23 +290,6 @@ startup_hacks(const char *progname)
|
|||||||
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
|
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
|
||||||
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
|
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
|
||||||
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
|
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
|
||||||
|
|
||||||
#if defined(_M_AMD64) && _MSC_VER == 1800
|
|
||||||
|
|
||||||
/*----------
|
|
||||||
* Avoid crashing in certain floating-point operations if we were
|
|
||||||
* compiled for x64 with MS Visual Studio 2013 and are running on
|
|
||||||
* Windows prior to 7/2008R2 SP1 on an AVX2-capable CPU.
|
|
||||||
*
|
|
||||||
* Ref: https://connect.microsoft.com/VisualStudio/feedback/details/811093/visual-studio-2013-rtm-c-x64-code-generation-bug-for-avx2-instructions
|
|
||||||
*----------
|
|
||||||
*/
|
|
||||||
if (!IsWindows7SP1OrGreater())
|
|
||||||
{
|
|
||||||
_set_FMA3_enable(0);
|
|
||||||
}
|
|
||||||
#endif /* defined(_M_AMD64) && _MSC_VER == 1800 */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
|
||||||
|
@ -1719,7 +1719,7 @@ get_collation_actual_version(char collprovider, const char *collcollate)
|
|||||||
else
|
else
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errmsg("could not load locale \"%s\"", collcollate)));
|
(errmsg("could not load locale \"%s\"", collcollate)));
|
||||||
#elif defined(WIN32) && _WIN32_WINNT >= 0x0600
|
#elif defined(WIN32)
|
||||||
/*
|
/*
|
||||||
* If we are targeting Windows Vista and above, we can ask for a name
|
* If we are targeting Windows Vista and above, we can ask for a name
|
||||||
* given a collation name (earlier versions required a location code
|
* given a collation name (earlier versions required a location code
|
||||||
@ -1747,7 +1747,7 @@ get_collation_actual_version(char collprovider, const char *collcollate)
|
|||||||
collcollate,
|
collcollate,
|
||||||
GetLastError())));
|
GetLastError())));
|
||||||
}
|
}
|
||||||
collversion = psprintf("%d.%d,%d.%d",
|
collversion = psprintf("%ld.%ld,%ld.%ld",
|
||||||
(version.dwNLSVersion >> 8) & 0xFFFF,
|
(version.dwNLSVersion >> 8) & 0xFFFF,
|
||||||
version.dwNLSVersion & 0xFF,
|
version.dwNLSVersion & 0xFF,
|
||||||
(version.dwDefinedVersion >> 8) & 0xFFFF,
|
(version.dwDefinedVersion >> 8) & 0xFFFF,
|
||||||
|
@ -1896,16 +1896,7 @@ CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo, bool as_ser
|
|||||||
/* Verify that we found all functions */
|
/* Verify that we found all functions */
|
||||||
if (_IsProcessInJob == NULL || _CreateJobObject == NULL || _SetInformationJobObject == NULL || _AssignProcessToJobObject == NULL || _QueryInformationJobObject == NULL)
|
if (_IsProcessInJob == NULL || _CreateJobObject == NULL || _SetInformationJobObject == NULL || _AssignProcessToJobObject == NULL || _QueryInformationJobObject == NULL)
|
||||||
{
|
{
|
||||||
/*
|
/* Log error if we can't get version */
|
||||||
* IsProcessInJob() is not available on < WinXP, so there is no need
|
|
||||||
* to log the error every time in that case
|
|
||||||
*/
|
|
||||||
if (IsWindowsXPOrGreater())
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Log error if we can't get version, or if we're on WinXP/2003 or
|
|
||||||
* newer
|
|
||||||
*/
|
|
||||||
write_stderr(_("%s: WARNING: could not locate all job object functions in system API\n"), progname);
|
write_stderr(_("%s: WARNING: could not locate all job object functions in system API\n"), progname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1946,19 +1937,6 @@ CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo, bool as_ser
|
|||||||
JOB_OBJECT_UILIMIT_EXITWINDOWS | JOB_OBJECT_UILIMIT_READCLIPBOARD |
|
JOB_OBJECT_UILIMIT_EXITWINDOWS | JOB_OBJECT_UILIMIT_READCLIPBOARD |
|
||||||
JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS | JOB_OBJECT_UILIMIT_WRITECLIPBOARD;
|
JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS | JOB_OBJECT_UILIMIT_WRITECLIPBOARD;
|
||||||
|
|
||||||
if (as_service)
|
|
||||||
{
|
|
||||||
if (!IsWindows7OrGreater())
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* On Windows 7 (and presumably later),
|
|
||||||
* JOB_OBJECT_UILIMIT_HANDLES prevents us from
|
|
||||||
* starting as a service. So we only enable it on
|
|
||||||
* Vista and earlier (version <= 6.0)
|
|
||||||
*/
|
|
||||||
uiRestrictions.UIRestrictionsClass |= JOB_OBJECT_UILIMIT_HANDLES;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_SetInformationJobObject(job, JobObjectBasicUIRestrictions, &uiRestrictions, sizeof(uiRestrictions));
|
_SetInformationJobObject(job, JobObjectBasicUIRestrictions, &uiRestrictions, sizeof(uiRestrictions));
|
||||||
|
|
||||||
securityLimit.SecurityLimitFlags = JOB_OBJECT_SECURITY_NO_ADMIN | JOB_OBJECT_SECURITY_ONLY_TOKEN;
|
securityLimit.SecurityLimitFlags = JOB_OBJECT_SECURITY_NO_ADMIN | JOB_OBJECT_SECURITY_ONLY_TOKEN;
|
||||||
|
@ -11,24 +11,13 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure _WIN32_WINNT has the minimum required value.
|
* Make sure _WIN32_WINNT has the minimum required value.
|
||||||
* Leave a higher value in place. When building with at least Visual
|
* Leave a higher value in place. The minimum requirement is Windows 10.
|
||||||
* Studio 2015 the minimum requirement is Windows Vista (0x0600) to
|
|
||||||
* get support for GetLocaleInfoEx() with locales. For everything else
|
|
||||||
* the minimum version is Windows XP (0x0501).
|
|
||||||
*/
|
*/
|
||||||
#if defined(_MSC_VER) && _MSC_VER >= 1900
|
#ifdef _WIN32_WINNT
|
||||||
#define MIN_WINNT 0x0600
|
|
||||||
#else
|
|
||||||
#define MIN_WINNT 0x0501
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT < MIN_WINNT
|
|
||||||
#undef _WIN32_WINNT
|
#undef _WIN32_WINNT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _WIN32_WINNT
|
#define _WIN32_WINNT 0x0A00
|
||||||
#define _WIN32_WINNT MIN_WINNT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We need to prevent <crtdefs.h> from defining a symbol conflicting with
|
* We need to prevent <crtdefs.h> from defining a symbol conflicting with
|
||||||
|
Reference in New Issue
Block a user