Обсуждение: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

Поиск
Список
Период
Сортировка

configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Andre Mikulec
Дата:


Hi,

I am trying to configure PostgreSQL with the plperl language available.

Here is my ./configure line

TargetUser@TARGETMACH /c/postgres-master_0ab9c56_debug
$ ./configure PERL=/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin --with-perl --with-includes=/c/EnterpriseDB/Langu
agePack/9.5/x64/Perl-5.20/lib/CORE:/c/Users/TargetUser/Documents/zlib-1.2.8-win32-x86_64/include --with-libraries=/c
/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin:/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE:/c/Users/Anony
mousUser/Documents/zlib-1.2.8-win32-x86_64/bin:/c/Users/TargetUser/Documents/zlib-1.2.8-win32-x86_64/lib --host=x86_
64-w64-mingw32 --prefix=/usr/local/pgsql_0ab9c56_debug --disable-rpath --enable-depend --enable-cassert --enable-debug
--with-extra-version=_CFLAGS_O_0ab9c56 CFLAGS="-O -fno-omit-frame-pointer"  2>&1 | tee configure_OPTIONS.txt

I am getting the error message.

*** The installed version of Perl, /c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin, is too old to use with PostgreSQL.
*** Perl version 5.8 or later is required, but this is .
configure: WARNING:
*** Without Perl you will not be able to build PostgreSQL from Git.
*** You can obtain Perl from any CPAN mirror site.
*** (If you are using the official distribution of PostgreSQL then you do not
*** need to worry about this, because the Perl output is pre-generated.)
configure: error: Perl not found

Why does it say, "Perl version 5.8 or later is required, but this is ."?

I do not know what to do next.

Please help.

Thank you,
Andre Mikulec
Andre_Mikulec@Hotmail.com









Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Tom Lane
Дата:
Andre Mikulec <andre_mikulec@hotmail.com> writes:
> I am getting the error message.

> *** The installed version of Perl, /c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin, is too old to use with
PostgreSQL.
> *** Perl version 5.8 or later is required, but this is .
> configure: WARNING:
> *** Without Perl you will not be able to build PostgreSQL from Git.
> *** You can obtain Perl from any CPAN mirror site.
> *** (If you are using the official distribution of PostgreSQL then you do not
> *** need to worry about this, because the Perl output is pre-generated.)
> configure: error: Perl not found

> Why does it say, "Perl version 5.8 or later is required, but this is ."?

It's trying to extract the Perl version number from the output of
"perl -v", and evidently failing to find one.  What does "perl -v"
print with that version of Perl?

            regards, tom lane


Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Andre Mikulec
Дата:

Tom,


I m getting this.

TargetUser@TARGETMACH ~
$ perl -v
This is perl, v5.8.8 built for msys-64int

5.8.8 is not right. See later emails.

Andre Mikulec
Andre_Mikulec@Hotmail.com



From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Thursday, October 20, 2016 9:54 AM
To: Andre Mikulec
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .
 
Andre Mikulec <andre_mikulec@hotmail.com> writes:
> I am getting the error message.

> *** The installed version of Perl, /c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin, is too old to use with PostgreSQL.
> *** Perl version 5.8 or later is required, but this is .
> configure: WARNING:
> *** Without Perl you will not be able to build PostgreSQL from Git.
> *** You can obtain Perl from any CPAN mirror site.
> *** (If you are using the official distribution of PostgreSQL then you do not
> *** need to worry about this, because the Perl output is pre-generated.)
> configure: error: Perl not found

> Why does it say, "Perl version 5.8 or later is required, but this is ."?

It's trying to extract the Perl version number from the output of
"perl -v", and evidently failing to find one.  What does "perl -v"
print with that version of Perl?

                        regards, tom lane

Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
John R Pierce
Дата:
On 10/20/2016 10:37 PM, Andre Mikulec wrote:
>
> I m getting this.
>
> TargetUser@TARGETMACH ~
> $ perl -v
> This is perl, v5.8.8 built for msys-64int
>
> 5.8.8 is not right. See later emails.

try  /c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin/perl -v

as the perl in your default system path is probably NOT the same as the
one specified in your ./configure building.

my guess is, its barfing on a version number <= 10 due to bad logic...



--
john r pierce, recycling bits in santa cruz



Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Andre Mikulec
Дата:


I corrected 'PERL=' to include the executable.
I tried again.

./configure PERL=/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin/perl5.20.3.exe --with-perl --with-includes=/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE:/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/include --with-libraries=/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin:/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE:/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/bin:/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/lib  --host=x86_64-w64-mingw32 --prefix=/usr/local/pgsql_0ab9c56_debug --disable-rpath --enable-depend --enable-cassert --enable-debug --with-extra-version=_CFLAGS_O_0ab9c56 CFLAGS="-O -fno-omit-frame-pointer"  2>&1 | tee configure_OPTIONS_EnterpriseDB_PERL_without_SUBDIR_sys.txt

Relevant output is the following.

checking whether to build Perl modules... yes

configure: using perl 5.20.3
checking for Perl archlibexp... C:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib
checking for Perl privlibexp... C:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib
checking for Perl useshrplib... true
checking for flags to link embedded Perl... -LC:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE -lperl520

checking for perl.h... yes
checking for libperl... yes

configure: using CPPFLAGS= -I./src/include/port/win32 -DEXEC_BACKEND  -I/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE -I/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/include

configure: using LDFLAGS= -Wl,--allow-multiple-definition -Wl,--disable-auto-import  -L/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin -L/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE -L/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/bin -L/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/lib -Wl,--as-needed

I try to 'make'

make 2>&1 | tee make_ALONE_OPTIONS_EnterpriseDB_PERL_without_SUBDIR_sys.txt 

But now within the 'make', I am getting complaints 
saying "warning: win32_FUNCTION redefined."

x86_64-w64-mingw32-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O -fno-omit-frame-pointer  -I../../src/port  -I../../src/include -I./src/include/port/win32 -DEXEC_BACKEND  -I/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE -I/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/include "-I../../src/include/port/win32" -DBUILDING_DLL -c path.c -o path_srv.o
In file included from c:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE/netdb.h:10:0,
                 from ../../src/include/port.h:17,
                 from ../../src/include/c.h:1105,
                 from ../../src/include/postgres.h:47,
                 from path.c:17:
c:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE/sys/socket.h:272:0: warning: "socket" redefined
 #define socket  win32_socket
 
In file included from ../../src/include/c.h:101:0,
                 from ../../src/include/postgres.h:47,
                 from path.c:17:
../../src/include/pg_config_os.h:379:0: note: this is the location of the previous definition
 #define socket(af, type, protocol) pgwin32_socket(af, type, protocol)
 
In file included from c:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE/netdb.h:10:0,
                 from ../../src/include/port.h:17,
                 from ../../src/include/c.h:1105,
                 from ../../src/include/postgres.h:47,
                 from path.c:17:
c:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE/sys/socket.h:273:0: warning: "bind" redefined
 #define bind  win32_bind

These complaints go on and on, but they are all similar.
They seem to be complaints about networking functions begin re-defined

win32_*
E.g. win32_connect

These function headers are found in the python subdirectory and files.

CORE/sys/socket.h
CORE/netdb.h

They were most like likely included by using the

./configure line --with-includes option

--with-includes=/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE

Note, perl.h lives in lib/CORE, so I am not sure about removing that option.

Eventually, these complaints lead to . . .

x86_64-w64-mingw32-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O -fno-omit-frame-pointer   -shared -static-libgcc -o libpq.dll  fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o fe-protocol2.o fe-protocol3.o pqexpbuffer.o fe-secure.o libpq-events.o chklocale.o inet_net_ntop.o noblock.o pgstrcasecmp.o pqsignal.o thread.o crypt.o inet_aton.o strlcpy.o getaddrinfo.o open.o system.o win32error.o win32setlocale.o snprintf.o encnames.o wchar.o ip.o md5.o pgsleep.o win32.o libpqrc.o pthread-win32.o libpqdll.def -L../../../src/port -L../../../src/common -Wl,--allow-multiple-definition -Wl,--disable-auto-import  -L/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin -L/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE -L/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/bin -L/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/lib -Wl,--as-needed    -lshell32 -lws2_32 -lsecur32  -lpgcommon  -lz -lws2_32 -lm -lws2_32 -Wl,--out-implib=libpq.a
fe-connect.o: In function `internal_cancel':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3241: undefined reference to `win32_socket'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3247: undefined reference to `win32_connect'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3313: undefined reference to `win32_closesocket'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3263: undefined reference to `win32_htonl'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3264: undefined reference to `win32_htonl'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3265: undefined reference to `win32_htonl'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3266: undefined reference to `win32_htonl'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3269: undefined reference to `win32_send'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3286: undefined reference to `win32_recv'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3295: undefined reference to `win32_closesocket'
fe-connect.o: In function `pqDropConnection':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:406: undefined reference to `win32_closesocket'
fe-connect.o: In function `PQconnectPoll':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:1714: undefined reference to `win32_socket'
fe-connect.o: In function `connectNoDelay':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:1097: undefined reference to `win32_setsockopt'
fe-connect.o: In function `PQconnectPoll':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:1859: undefined reference to `win32_connect'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:1925: undefined reference to `win32_getsockopt'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:1958: undefined reference to `win32_getsockname'
fe-misc.o: In function `pqSocketPoll':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:1171: undefined reference to `win32_select'
fe-misc.o: In function `pqGetInt':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:284: undefined reference to `win32_ntohs'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:291: undefined reference to `win32_ntohl'
fe-misc.o: In function `pqPutInt':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:320: undefined reference to `win32_htons'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:325: undefined reference to `win32_htonl'
fe-misc.o: In function `pqPutMsgEnd':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:603: undefined reference to `win32_htonl'
collect2.exe: error: ld returned 1 exit status
make[3]: *** [libpq.dll] Error 1
make[3]: Leaving directory `/c/postgres-master_0ab9c56_debug/src/interfaces/libpq'
make[2]: *** [all-libpq-recurse] Error 2
make[2]: Leaving directory `/c/postgres-master_0ab9c56_debug/src/interfaces'
make[1]: *** [all-interfaces-recurse] Error 2
make[1]: Leaving directory `/c/postgres-master_0ab9c56_debug/src'
make: *** [all-src-recurse] Error 2

Thanks,
Andre Mikulec
Andre_Mikulec@Hotmail.com



From: Andre Mikulec <andre_mikulec@hotmail.com>
Sent: Friday, October 21, 2016 1:37 AM
To: Tom Lane
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .
 

Tom,


I m getting this.

TargetUser@TARGETMACH ~
$ perl -v
This is perl, v5.8.8 built for msys-64int

5.8.8 is not right. See later emails.

Andre Mikulec
Andre_Mikulec@Hotmail.com



From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Thursday, October 20, 2016 9:54 AM
To: Andre Mikulec
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .
 
Andre Mikulec <andre_mikulec@hotmail.com> writes:
> I am getting the error message.

> *** The installed version of Perl, /c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin, is too old to use with PostgreSQL.
> *** Perl version 5.8 or later is required, but this is .
> configure: WARNING:
> *** Without Perl you will not be able to build PostgreSQL from Git.
> *** You can obtain Perl from any CPAN mirror site.
> *** (If you are using the official distribution of PostgreSQL then you do not
> *** need to worry about this, because the Perl output is pre-generated.)
> configure: error: Perl not found

> Why does it say, "Perl version 5.8 or later is required, but this is ."?

It's trying to extract the Perl version number from the output of
"perl -v", and evidently failing to find one.  What does "perl -v"
print with that version of Perl?

                        regards, tom lane

Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Adrian Klaver
Дата:
On 10/23/2016 04:05 PM, Andre Mikulec wrote:
>
> I corrected 'PERL=' to include the executable.
> I tried again.
>

Where did you get the Postgres source you are trying to build?




--
Adrian Klaver
adrian.klaver@aklaver.com


Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Andre Mikulec
Дата:


Never mind. I figured it out.

Soon, I will write up a summary.

Andre Mikulec
Andre_Mikulec@Hotmail.com



From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Sunday, October 23, 2016 7:18 PM
To: Andre Mikulec; pgsql-general@postgresql.org
Cc: Tom Lane
Subject: Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .
 
On 10/23/2016 04:05 PM, Andre Mikulec wrote:
>
> I corrected 'PERL=' to include the executable.
> I tried again.
>

Where did you get the Postgres source you are trying to build?




--
Adrian Klaver
adrian.klaver@aklaver.com

Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Andre Mikulec
Дата:


Never mind.  I figured it out.

Soon I will write up a summary.
 
Andre Mikulec
Andre_Mikulec@Hotmail.com  


From: Andre Mikulec <andre_mikulec@hotmail.com>
Sent: Sunday, October 23, 2016 7:05 PM
To: pgsql-general@postgresql.org
Cc: Tom Lane
Subject: Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .
 


I corrected 'PERL=' to include the executable.
I tried again.

./configure PERL=/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin/perl5.20.3.exe --with-perl --with-includes=/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE:/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/include --with-libraries=/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin:/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE:/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/bin:/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/lib  --host=x86_64-w64-mingw32 --prefix=/usr/local/pgsql_0ab9c56_debug --disable-rpath --enable-depend --enable-cassert --enable-debug --with-extra-version=_CFLAGS_O_0ab9c56 CFLAGS="-O -fno-omit-frame-pointer"  2>&1 | tee configure_OPTIONS_EnterpriseDB_PERL_without_SUBDIR_sys.txt

Relevant output is the following.

checking whether to build Perl modules... yes

configure: using perl 5.20.3
checking for Perl archlibexp... C:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib
checking for Perl privlibexp... C:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib
checking for Perl useshrplib... true
checking for flags to link embedded Perl... -LC:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE -lperl520

checking for perl.h... yes
checking for libperl... yes

configure: using CPPFLAGS= -I./src/include/port/win32 -DEXEC_BACKEND  -I/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE -I/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/include

configure: using LDFLAGS= -Wl,--allow-multiple-definition -Wl,--disable-auto-import  -L/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin -L/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE -L/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/bin -L/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/lib -Wl,--as-needed

I try to 'make'

make 2>&1 | tee make_ALONE_OPTIONS_EnterpriseDB_PERL_without_SUBDIR_sys.txt 

But now within the 'make', I am getting complaints 
saying "warning: win32_FUNCTION redefined."

x86_64-w64-mingw32-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O -fno-omit-frame-pointer  -I../../src/port  -I../../src/include -I./src/include/port/win32 -DEXEC_BACKEND  -I/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE -I/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/include "-I../../src/include/port/win32" -DBUILDING_DLL -c path.c -o path_srv.o
In file included from c:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE/netdb.h:10:0,
                 from ../../src/include/port.h:17,
                 from ../../src/include/c.h:1105,
                 from ../../src/include/postgres.h:47,
                 from path.c:17:
c:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE/sys/socket.h:272:0: warning: "socket" redefined
 #define socket  win32_socket
 
In file included from ../../src/include/c.h:101:0,
                 from ../../src/include/postgres.h:47,
                 from path.c:17:
../../src/include/pg_config_os.h:379:0: note: this is the location of the previous definition
 #define socket(af, type, protocol) pgwin32_socket(af, type, protocol)
 
In file included from c:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE/netdb.h:10:0,
                 from ../../src/include/port.h:17,
                 from ../../src/include/c.h:1105,
                 from ../../src/include/postgres.h:47,
                 from path.c:17:
c:/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE/sys/socket.h:273:0: warning: "bind" redefined
 #define bind  win32_bind

These complaints go on and on, but they are all similar.
They seem to be complaints about networking functions begin re-defined

win32_*
E.g. win32_connect

These function headers are found in the python subdirectory and files.

CORE/sys/socket.h
CORE/netdb.h

They were most like likely included by using the

./configure line --with-includes option

--with-includes=/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE

Note, perl.h lives in lib/CORE, so I am not sure about removing that option.

Eventually, these complaints lead to . . .

x86_64-w64-mingw32-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O -fno-omit-frame-pointer   -shared -static-libgcc -o libpq.dll  fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o fe-protocol2.o fe-protocol3.o pqexpbuffer.o fe-secure.o libpq-events.o chklocale.o inet_net_ntop.o noblock.o pgstrcasecmp.o pqsignal.o thread.o crypt.o inet_aton.o strlcpy.o getaddrinfo.o open.o system.o win32error.o win32setlocale.o snprintf.o encnames.o wchar.o ip.o md5.o pgsleep.o win32.o libpqrc.o pthread-win32.o libpqdll.def -L../../../src/port -L../../../src/common -Wl,--allow-multiple-definition -Wl,--disable-auto-import  -L/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin -L/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/lib/CORE -L/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/bin -L/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/lib -Wl,--as-needed    -lshell32 -lws2_32 -lsecur32  -lpgcommon  -lz -lws2_32 -lm -lws2_32 -Wl,--out-implib=libpq.a
fe-connect.o: In function `internal_cancel':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3241: undefined reference to `win32_socket'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3247: undefined reference to `win32_connect'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3313: undefined reference to `win32_closesocket'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3263: undefined reference to `win32_htonl'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3264: undefined reference to `win32_htonl'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3265: undefined reference to `win32_htonl'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3266: undefined reference to `win32_htonl'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3269: undefined reference to `win32_send'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3286: undefined reference to `win32_recv'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:3295: undefined reference to `win32_closesocket'
fe-connect.o: In function `pqDropConnection':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:406: undefined reference to `win32_closesocket'
fe-connect.o: In function `PQconnectPoll':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:1714: undefined reference to `win32_socket'
fe-connect.o: In function `connectNoDelay':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:1097: undefined reference to `win32_setsockopt'
fe-connect.o: In function `PQconnectPoll':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:1859: undefined reference to `win32_connect'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:1925: undefined reference to `win32_getsockopt'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-connect.c:1958: undefined reference to `win32_getsockname'
fe-misc.o: In function `pqSocketPoll':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:1171: undefined reference to `win32_select'
fe-misc.o: In function `pqGetInt':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:284: undefined reference to `win32_ntohs'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:291: undefined reference to `win32_ntohl'
fe-misc.o: In function `pqPutInt':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:320: undefined reference to `win32_htons'
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:325: undefined reference to `win32_htonl'
fe-misc.o: In function `pqPutMsgEnd':
c:\postgres-master_0ab9c56_debug\src\interfaces\libpq/fe-misc.c:603: undefined reference to `win32_htonl'
collect2.exe: error: ld returned 1 exit status
make[3]: *** [libpq.dll] Error 1
make[3]: Leaving directory `/c/postgres-master_0ab9c56_debug/src/interfaces/libpq'
make[2]: *** [all-libpq-recurse] Error 2
make[2]: Leaving directory `/c/postgres-master_0ab9c56_debug/src/interfaces'
make[1]: *** [all-interfaces-recurse] Error 2
make[1]: Leaving directory `/c/postgres-master_0ab9c56_debug/src'
make: *** [all-src-recurse] Error 2

Thanks,
Andre Mikulec
Andre_Mikulec@Hotmail.com



From: Andre Mikulec <andre_mikulec@hotmail.com>
Sent: Friday, October 21, 2016 1:37 AM
To: Tom Lane
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .
 

Tom,


I m getting this.

TargetUser@TARGETMACH ~
$ perl -v
This is perl, v5.8.8 built for msys-64int

5.8.8 is not right. See later emails.

Andre Mikulec
Andre_Mikulec@Hotmail.com



From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Thursday, October 20, 2016 9:54 AM
To: Andre Mikulec
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .
 
Andre Mikulec <andre_mikulec@hotmail.com> writes:
> I am getting the error message.

> *** The installed version of Perl, /c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin, is too old to use with PostgreSQL.
> *** Perl version 5.8 or later is required, but this is .
> configure: WARNING:
> *** Without Perl you will not be able to build PostgreSQL from Git.
> *** You can obtain Perl from any CPAN mirror site.
> *** (If you are using the official distribution of PostgreSQL then you do not
> *** need to worry about this, because the Perl output is pre-generated.)
> configure: error: Perl not found

> Why does it say, "Perl version 5.8 or later is required, but this is ."?

It's trying to extract the Perl version number from the output of
"perl -v", and evidently failing to find one.  What does "perl -v"
print with that version of Perl?

                        regards, tom lane

Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Adrian Klaver
Дата:
On 10/24/2016 11:01 AM, Andre Mikulec wrote:
>
> Never mind.  I figured it out.
>
> Soon I will write up a summary.

What I am not understanding is why you are building from source and not
using the pre-built packages that:

BigSQL:

https://www.bigsql.org/postgresql/installers.jsp

or

EDB:

http://www.enterprisedb.com/products-services-training/pgdownload#windows

provide with their Windows binaries?

>
> Andre Mikulec
> Andre_Mikulec@Hotmail.com
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Andre Mikulec
Дата:


May strait answer is true.


1. I need to change the width of all of my tables because I have very wide data.  There is a compile-time parameter for that.

2. I need to debug, compile and install a modified version of the PostgreSQL extension pl/r.
 

Andre Mikulec
Andre_Mikulec@Hotmail.com



From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Monday, October 24, 2016 2:10 PM
To: Andre Mikulec; pgsql-general@postgresql.org
Cc: Tom Lane
Subject: Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .
 
On 10/24/2016 11:01 AM, Andre Mikulec wrote:
>
> Never mind.  I figured it out.
>
> Soon I will write up a summary.

What I am not understanding is why you are building from source and not
using the pre-built packages that:

BigSQL:

https://www.bigsql.org/postgresql/installers.jsp

www.bigsql.org
PostgreSQL Installers. These enterprise-class 64-bit PostgreSQL binaries are always free and Open Source. They are tested to run on Centos 6+, Ubuntu 12.04+, OSX 10.9 ...




or

EDB:

http://www.enterprisedb.com/products-services-training/pgdownload#windows

provide with their Windows binaries?

>
> Andre Mikulec
> Andre_Mikulec@Hotmail.com
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com

Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
John R Pierce
Дата:
On 10/24/2016 1:19 PM, Andre Mikulec wrote:

May strait answer is true.


1. I need to change the width of all of my tables because I have very wide data.  There is a compile-time parameter for that.

2. I need to debug, compile and install a modified version of the PostgreSQL extension pl/r.

please don't reply to an existing thread with a completely new topic.     your questions have nothing to do with "Subject: Re: [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is ."





-- 
john r pierce, recycling bits in santa cruz

Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Adrian Klaver
Дата:
On 10/24/2016 01:19 PM, Andre Mikulec wrote:
>
> May strait answer is true.
>
>
> 1. I need to change the width of all of my tables because I have very
> wide data.  There is a compile-time parameter for that.

Beyond my knowledge, but I understand the custom compile now.

>
> 2. I need to debug, compile and install a modified version of the
> PostgreSQL extension pl/r.
>
>
> Andre Mikulec
> Andre_Mikulec@Hotmail.com
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: configure PostgreSQL with PERL: Perl version 5.8 or later is required, but this is .

От
Adrian Klaver
Дата:
On 10/24/2016 01:49 PM, John R Pierce wrote:
> On 10/24/2016 1:19 PM, Andre Mikulec wrote:
>>
>> May strait answer is true.
>>
>>
>> 1. I need to change the width of all of my tables because I have very
>> wide data.  There is a compile-time parameter for that.
>>
>> 2. I need to debug, compile and install a modified version of the
>> PostgreSQL extension pl/r.
>
> please don't reply to an existing thread with a completely new
> topic.     your questions have nothing to do with *"Subject:* Re:
> [GENERAL] configure PostgreSQL with PERL: Perl version 5.8 or later is
> required, but this is ."

They do if there is no reason to do a custom compile. As it turns out
there was a reason, so we return to regularly scheduled programing:)

>
>
>
>
>
> --
> john r pierce, recycling bits in santa cruz
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Solution: On Windows with Mingw, how to Install PostgreSQL with zlib, pltcl, plperl, and plpython

От
Andre Mikulec
Дата:


Thanks for all of the help.
Here, is the summary that I had promised.

In addition to the documentation here

https://www.postgresql.org/docs/manuals/
and
https://wiki.postgresql.org/wiki/Main_Page

I will explain how I install PostgreSQL using 
on Windows using Mingw with zlib, pltcl, plperl, and plpython.

This information presented here is only meant to explain 
solutions to things that are a little 'more difficult' on Windows.

Begin acquiring the software.

Get already compiled zlib here
ftp://ftp.zlatkovic.com/libxml/64bit/

Specifically, get exactly zlib from here.
ftp://ftp.zlatkovic.com/libxml/64bit/zlib-1.2.8-win32-x86_64.7z

(Note, the zlib home is actually here: http://www.zlib.net/)

Extract, those folders and files to a folder on disk.

For example.
C:\Users\TargetUser\Documents\zlib-1.2.8-win32-x86_64

Identify the header(include) and lib directories.

C:\Users\TargetUser\Documents\zlib-1.2.8-win32-x86_64\include 
C:\Users\TargetUser\Documents\zlib-1.2.8-win32-x86_64\lib 

Note those locations, and save that information for later

Information about the languages follow.

Get to know what the needed library versions from here.

(1) TCL with TK; 8.5
(2) Perl; 5.20
(3) Python; 3.3
http://get.enterprisedb.com/docs/README-languagepack-950.txt

(1) TCL with TK; 8.5
(2) Perl; 5.20
(3) Python; 3.3
http://get.enterprisedb.com/docs/README-edb-languagepack-9.6.txt

Get Python and Perl from the Graphical installer from here.
http://www.enterprisedb.com/products-services-training/pgdownload#windows

Download the graphical installer and 
install (1) Python and (2) PERL

Make a note of where the perl.exe and python.exe files are located.

C:\EnterpriseDB\LanguagePack\9.5\x64\Perl-5.20\bin\perl.exe
C:\EnterpriseDB\LanguagePack\9.5\x64\Python-3.3\python.exe

Do not install TCL from EnterpriseDB.

If one were TOO install the TCL from EnterpriseDB and
if one were to inspect the tclConfig.sh file that is found in the 'lib' directory,
a surprise may be seen.

The EnterpriseDB TCL tclConfig.sh file has a hard coded TCL_LIB_SPEC

  TCL_LIB_SPEC='C:\EnterpriseDB\LanguagePack\9.5\x64\Tcl-8.5\lib\tcl85.lib' 

But the TCL_LIB_SPEC actually needs to be something like

  TCL_LIB_SPEC='-LC:/Path/To/folder/lib -ltcl85'

So EnterpriseDB TCL can not be used in the compiling 
of the TCL language into PostgreSQL.
I found that to be surprising. 

Download TCL from here.
https://www.tcl.tk/software/tcltk/

Specifically here
https://www.tcl.tk/software/tcltk/8.5.html

Install those files to a convenient place.

C:\Tcl.8.5.18.0

Inspect the tclConfig.sh file that is found in the 'lib' directory
This line

  TCL_LIB_SPEC='-LC:/Tcl.8.5.18.0/lib -ltcl85'

is the form

  TCL_LIB_SPEC='-LC:/Path/To/folder/lib -ltcl85'

So, this TCL is useful

Make a note of where the tclsh.exe executable is located

C:\Tcl.8.5.18.0\bin\tclsh.exe

The pexports.exe file is needed.  This is NOT included in the
standard Mingw distribution ( but the dlltool.exe is in Mingw ).

This pexports.exe file is called a Mingw Extension.

For each language:Tcl, Perl, and Python, 
pexports ( driven and done in 'make' later ) will run the following.

pexports LANGUAGE.dll > LANGUAGE.def
dlltool --dllname LANGUAGE.dll --def LANGUAGE.def --output-lib LANGUAGE.a

Specifically,

pexports /c/Tcl.8.5.18.0/bin//tcl85.dll > tcl85.def
dlltool --dllname tcl85.dll --def tcl85.def --output-lib libtcl85.a

pexports /c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin/perl520.dll > perl520.def
dlltool --dllname perl520.dll --def perl520.def --output-lib libperl520.a

pexports C:/Windows/system32/python33.dll > python33.def
dlltool --dllname python33.dll --def python33.def --output-lib libpython33.a

Notice, that the Python33.dll comes from the C:\Windows\system32 folder
and NOT the 'same directory as the executable' that Perl and TCL use.
I found that to be surprising. 

Get pexports.exe from one of two places.  

In one place, a compiled pexports.exe can found with 
the Strawberry Perl distribution.

Specifically it is in here.

C:\Strawberry\c\bin

The other place is the source.
A person would have to manually compile and make the pexports.exe file.
The source is here.
https://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/

Copy the pexports.exe to the same place where
the Mingw dlltool.exe is located ( this is already in the Mingw PATH ).

That is specifically here.

C:\x86_64-6.2.0-release-posix-seh-rt_v5-rev0\mingw64\bin

That was the end of acquiring the software.

This is the beginning of compiling.

Prepare to start an msys shell.

Edit the msys.bat file: C:\MinGW\msys\1.0\msys.bat

Near the top of the  msys.bat file add the simple line that 
removes anything not important to the compiling process from the PATH.

set  PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\

In the MSYS shell at the command prompt($), 
place the LANGUAGE .exes in the path.

export PATH=/c/Tcl.8.5.18.0/bin:$PATH
export PATH=/c/EnterpriseDB/LanguagePack/9.5/x64/Perl-5.20/bin:$PATH
export PATH=/c/EnterpriseDB/LanguagePack/9.5/x64/Python-3.3:$PATH

Configure.
Below are the options I use and why.

Start configuration.

./configure 

Languages: their .exe files are in the path.

The ./lib and ./include locations
seems to be picked up from the location of the .exe in the PATH.
So no other ./include nor ./lib information are needed.
I found that to be slightly surprising. 

-with-tcl --with-python --with-perl 

zlib
 
--with-includes=/c/Users/TargetUser/Documents/zlib-1.2.8-win32-x86_64/include --with-libraries=/c/Users/TargetUser/Documents/zlib-1.2.8-win32-x86_64/lib 

Compile target

--host=x86_64-w64-mingw32 

Install location ( files are copied here as a result of 'make install' )

--prefix=/usr/local/pgsql_0ab9c56_debug 

Make PostgreSQL relocatable, so I can move the binaries 
to a different folder later and PostgreSQL will still start up.

--disable-rpath 

For development, if a change  is done such that something is re-compiled,
then dependent objects also get re-compiled.

--enable-depend 

Debugging help

--enable-cassert --enable-debug 

So, I can track exactly which github mirror version I have.
Also, I can track how much debugging information I have.

--with-extra-version=_CFLAGS_O_0ab9c56 

For development, turn off optimizations,
so I can see the values of 'more' variables to aid in debugging.

CFLAGS="-O -fno-omit-frame-pointer" 

So the configure line would approximately look like this.
However running it would still require it all to be on one very very long line.

./configure -with-tcl --with-python --with-perl 
--with-includes=/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/include --with-libraries=/c/Users/AnonymousUser/Documents/zlib-1.2.8-win32-x86_64/lib 
--host=x86_64-w64-mingw32 --prefix=/usr/local/pgsql_0ab9c56_debug 
--disable-rpath --enable-depend --enable-cassert --enable-debug 
--with-extra-version=_CFLAGS_O_0ab9c56 CFLAGS="-O -fno-omit-frame-pointer" 

After configuring, do the following.

Clean up with

  make clean

Make with 

  make

Check with 

  make check 

(Above) 'make check' actually makes a mini PostgreSQL,
so I make sure that I do not have another PostgreSQL up and 
listening on the same ( default ) port of 5432.

Install with 

  make install

That was the end of compiling.

This is the beginning of extension creation.

Plan to startup PostgreSQL.

Get Portable PostgreSQL from here.
https://sourceforge.net/projects/postgresqlportable/

Extract the 'startup batch' file.

Customize the startup batch as necessary.
In the 'startup batch', 
put the tclsh.exe, perl.exe,and python.exe 'paths' in the PATH.
Also, set the PYTHONHOME environment variable.

It is all explained in here.
http://get.enterprisedb.com/docs/README-languagepack-950.txt
http://get.enterprisedb.com/docs/README-edb-languagepack-9.6.txt

Place the 'startup batch' file in the parent folder, 
of the ./bin directory of PostgreSQL.

Modify the 'startup batch' environment variables including PG* postgreSQL
environment variables. 

Execute the batch to start PostgreSQL.

Run the following SQL 

create extension pltcl;
create extension plperl;
create extension plpython3u; ( or sometimes ... plythonu; )

Follow the rest of the instructions here.

https://www.postgresql.org/docs/current/static/pltcl-functions.html
https://www.postgresql.org/docs/current/static/plperl-funcs.html
https://www.postgresql.org/docs/current/static/plpython-funcs.html

This is the end of extension creation.

Consider more powerful Language distributions 
( other than the ones that were mentioned earlier )

Activestate TCL
ACTIVETCL COMMUNITY EDITION DOWNLOAD
http://www.activestate.com/activetcl/downloads

Strawberry Perl
http://strawberryperl.com/

WinPython
https://winpython.github.io/



Andre Mikulec
Andre_Mikulec@Hotmail.com


[GENERAL] trying to program in PostgreSQL C a statistics function

От
Andre Mikulec
Дата:

SUMMARY
------

I am trying to program in PostgreSQL a statistics function.

My old method in SQL is here.

select ( avg(measure) - 0.0 ) / nullif(stddev_pop(case when measure > 0.00 then 0.00 else measure end ),0) sortino_true from TABLE/VIEW;

The logic is based on 
SORTINO RATIO: ARE YOU CALCULATING IT WRONG?
SEPTEMBER 11, 2013
https://www.rcmalternatives.com/2013/09/sortino-ratio-are-you-calculating-it-wrong/

In PostgreSQL C, how do I get access to the 'X' (data) variable?

DETAILS
-------

I see a similar function with other variables in here.  
But I am not trying to re-program 'stddev_samp'.

float8_stddev_samp ( lines 2741 through 2767 )
https://github.com/postgres/postgres/blob/9a34123bc315e55b33038464422ef1cd2b67dab2/src/backend/utils/adt/float.c

  N     = transvalues[0];
  sumX  = transvalues[1];
  sumX2 = transvalues[2];

The following article explains it and this makes sense. 

Sum of Squares Formula Shortcut
https://www.thoughtco.com/sum-of-squares-formula-shortcut-3126266

I can match article symbols to PostgreSQL C varaibles.

numerator = N * sumX2 -        sumX * sumX;
            N * SIGMA(X**2) - (SIGMA(X))**2

BUT I NEED ...
--------------

However in my case, 
I have this adjustement

"case when  measure > 0.00 then 0.00 else measure end"

So the case seems that I need access to 'X'
but access to sumX and sumX2 are only shown.

How would I get accress to X?

May anyone point me to a simple good working example?

Thanks,
Andre Mikulec
Andre_Mikulec@Hotmail.com



Re: [GENERAL] trying to program in PostgreSQL C a statistics function

От
Paul Jungwirth
Дата:
Hi Andre,

I've written some C statistics functions for Postgres before, here:

https://github.com/pjungwir/aggs_for_arrays
https://github.com/pjungwir/aggs_for_vecs

They are all really simple, although they operate on arrays, so yours
should be even simpler. The second link has aggregate functions,
including one for sample variance, so that would probably be the easiest
to adapt to your own needs.

In general Postgres C functions use macros to access their arguments
(and to return something). You can read more about it here:

https://www.postgresql.org/docs/current/static/xfunc-c.html

I'm happy to help more if you need it. I've found extending Postgres in
this way to be a lot of fun and very effective at gaining performance.

Good luck!

Paul


On 06/11/2017 09:57 AM, Andre Mikulec wrote:
> SUMMARY
> ------
>
> I am trying to program in PostgreSQL a statistics function.
>
> My old method in SQL is here.
>
> select ( avg(measure) - 0.0 ) / nullif(stddev_pop(case when measure >
> 0.00 then 0.00 else measure end ),0) sortino_true from TABLE/VIEW;
>
> The logic is based on
> SORTINO RATIO: ARE YOU CALCULATING IT WRONG?
> SEPTEMBER 11, 2013
> https://www.rcmalternatives.com/2013/09/sortino-ratio-are-you-calculating-it-wrong/
>
> In PostgreSQL C, how do I get access to the 'X' (data) variable?
>
> DETAILS
> -------
>
> I see a similar function with other variables in here.
> But I am not trying to re-program 'stddev_samp'.
>
> float8_stddev_samp ( lines 2741 through 2767 )
> https://github.com/postgres/postgres/blob/9a34123bc315e55b33038464422ef1cd2b67dab2/src/backend/utils/adt/float.c
>
>   N     = transvalues[0];
>   sumX  = transvalues[1];
>   sumX2 = transvalues[2];
>
> The following article explains it and this makes sense.
>
> Sum of Squares Formula Shortcut
> https://www.thoughtco.com/sum-of-squares-formula-shortcut-3126266
>
> I can match article symbols to PostgreSQL C varaibles.
>
> numerator = N * sumX2 -        sumX * sumX;
>             N * SIGMA(X**2) - (SIGMA(X))**2
>
> BUT I NEED ...
> --------------
>
> However in my case,
> I have this adjustement
>
> "case when  measure > 0.00 then 0.00 else measure end"
>
> So the case seems that I need access to 'X'
> but access to sumX and sumX2 are only shown.
>
> How would I get accress to X?
>
> May anyone point me to a simple good working example?
>
> Thanks,
> Andre Mikulec
> Andre_Mikulec@Hotmail.com
>
>
>