Re: [HACKERS] [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL

2017-05-07 Thread Francis ANDRE


Le 02/05/2017 à 13:22, Michael Paquier a écrit :
> On Tue, May 2, 2017 at 6:35 PM, zosrothko  wrote:
>> Hi
>>
>> I made an extension of VisualStudio that precompiles automaticaly C or
>> C++ source with PostgreSQL Embedded SQL. The extension is made of the 3
>> files joined and I have no idea where they should be placed in the
>> PostgreSQL source tree.
>>
>> Anybody interested in pushing this extension?
> The PostgreSQL uses a set of scripts in src/tools/msvc/ to generate
> things compiled with visual studio, so instinctively you would be
> looking at working on that. Honestly, just by looking at the files you
> are proposing, it is hard to make an idea of why this would be useful
> for ECPG, and please note as well that there are guidelines for
> submitting patches:
> https://wiki.postgresql.org/wiki/Submitting_a_Patch
>
> The source code of ecpg is located in src/interfaces/ecpg by the way.
> If you are interested to work on it, that's the place where to look at
> first.
I need to add those three files in the installation process. Where
should go those files?

 1.  in C:\Program Files (x86)\PostgreSQL\9.5\bin
 2. or should I put those files in a share/contrib directory?

Where is located the configuration file to change for putting those
files in the Windows distribution?

FA



Re: [HACKERS] [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL

2017-05-07 Thread zosrothko


Le 02/05/2017 à 13:22, Michael Paquier a écrit :
> On Tue, May 2, 2017 at 6:35 PM, zosrothko  wrote:
>> Hi
>>
>> I made an extension of VisualStudio that precompiles automaticaly C or
>> C++ source with PostgreSQL Embedded SQL. The extension is made of the 3
>> files joined and I have no idea where they should be placed in the
>> PostgreSQL source tree.
>>
>> Anybody interested in pushing this extension?
> The PostgreSQL uses a set of scripts in src/tools/msvc/ to generate
> things compiled with visual studio, so instinctively you would be
> looking at working on that. Honestly, just by looking at the files you
> are proposing, it is hard to make an idea of why this would be useful
> for ECPG, and please note as well that there are guidelines for
> submitting patches:
> https://wiki.postgresql.org/wiki/Submitting_a_Patch
>
> The source code of ecpg is located in src/interfaces/ecpg by the way.
> If you are interested to work on it, that's the place where to look at
> first.
I need to add those three files in the distribution process for Windows.
Where should go those files?

 1.  in C:\Program Files (x86)\PostgreSQL\9.5\bin
 2. or should I put those files in a share/contrib directory?

Where is located the installation builder files to change for putting
those files in the Windows distribution?

Zos



Re: [HACKERS] [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL

2017-05-02 Thread zosrothko
Le 02/05/2017 à 13:22, Michael Paquier a écrit :
> The PostgreSQL uses a set of scripts in src/tools/msvc/ to generate
> things compiled with visual studio, so instinctively you would be
> looking at working on that. Honestly, just by looking at the files you
> are proposing, it is hard to make an idea of why this would be useful
> for ECPG, and please note as well that there are guidelines for
> submitting patches:
> https://wiki.postgresql.org/wiki/Submitting_a_Patch
Please find below a log of building a VS2017 project named PGembeddedSQL
using the joined ECPG extension.

Building the PGEmbeddedSQL.vcxproj with msbuild calls automatically the
ecpg precompiler to precompile the PGEmbeddedSQL.pgc source and produces
PGembeddedSQL.cxx, which in turn is compiled and linked to produce de
PGembeddedSQL.exe

C:\MXW\Clients\PagesJaunes\SQLDynamic\SQLDynamic>dir
 Le volume dans le lecteur C n'a pas de nom.
 Le numéro de série du volume est 6FAB-AFA0

 Répertoire de C:\MXW\Clients\PagesJaunes\SQLDynamic\SQLDynamic

02/05/2017  14:08  .
02/05/2017  14:08  ..
27/04/2017  17:11  Debug
27/04/2017  15:28 2 648 PGEmbeddedSQL.pgc
27/04/2017  15:13 9 557 PGEmbeddedSQL.vcxproj
27/04/2017  15:10 1 302 PGEmbeddedSQL.vcxproj.filters
27/04/2017  15:13   682 PGEmbeddedSQL.vcxproj.user

C:\MXW\Clients\PagesJaunes\SQLDynamic\SQLDynamic>msbuild
PGEmbeddedSQL.vcxproj
Microsoft (R) Build Engine, version 15.1.548.43366
Copyright (C) Microsoft Corporation. Tous droits réservés.

La génération a démarré 02/05/2017 14:09:56.
Projet
"C:\MXW\Clients\PagesJaunes\SQLDynamic\SQLDynamic\PGEmbeddedSQL.vcxproj"
sur le noud 1 (cibl
es par défaut).
InitializeBuildStatus:
  Création de
"C:\temp\postgres\Debug\PGEmbeddedSQL.tlog\unsuccessfulbuild", car
"AlwaysCreate" a é
  té spécifié.
EcpgTarget:
  Process "PGEmbeddedSQL.pgc" ecpg file
  cmd.exe /C
"C:\Users\FrancisANDRE\AppData\Local\Temp\tmpfdb390c096f443e5b56d9ee962f8dafd.cmd"

  ecpg.exe -o PGEmbeddedSQL.cxx  PGEmbeddedSQL.pgc

ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe /c
/ZI /nologo /W3 /WX- /Od /Oy
  - /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc
/RTC1 /MDd /GS /fp:precise /Zc:
  wchar_t /Zc:forScope /Zc:inline /GR /Fo"C:\temp\postgres\Debug\\"
/Fd"C:\temp\postgres\Debug\vc14
  0.pdb" /Gd /TP /analyze- /errorReport:queue PGEmbeddedSQL.cxx
  PGEmbeddedSQL.cxx
Link:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe
/ERRORREPORT:QUEUE /OUT:"C:\t
  emp\postgres\PGEmbeddedSQLd.exe" /INCREMENTAL /NOLOGO libecpg.lib
libpq.lib kernel32.lib user32.l
  ib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib o
  dbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib s
  hell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
/MANIFEST /MANIFESTUAC:"level=
  'asInvoker' uiAccess='false'" /manifest:embed /DEBUG
/PDB:"C:\temp\postgres\PGEmbeddedSQLd.pdb" /
  SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT
/IMPLIB:"C:\temp\postgres\PGEmbeddedSQLd.lib" /
  MACHINE:X86 C:\temp\postgres\Debug\PGEmbeddedSQL.obj
  PGEmbeddedSQL.vcxproj -> C:\temp\postgres\PGEmbeddedSQLd.exe
  PGEmbeddedSQL.vcxproj -> C:\temp\postgres\PGEmbeddedSQLd.pdb (Full PDB)
FinalizeBuildStatus:
  Suppression du fichier
"C:\temp\postgres\Debug\PGEmbeddedSQL.tlog\unsuccessfulbuild".
  Mise à jour de l'horodatage
"C:\temp\postgres\Debug\PGEmbeddedSQL.tlog\PGEmbeddedSQL.lastbuildsta
  te".
Génération du projet
"C:\MXW\Clients\PagesJaunes\SQLDynamic\SQLDynamic\PGEmbeddedSQL.vcxproj"
termi
née (cibles par défaut).


La génération a réussi.
0 Avertissement(s)
0 Erreur(s)

Temps écoulé 00:00:02.63

Without the extension, you would have to precompile the
PGembeddedSQL.pcg by hand

HTH

Francis
>
> The source code of ecpg is located in src/interfaces/ecpg by the way.
> If you are interested to work on it, that's the place where to look at
> first.



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL

2017-05-02 Thread Francis ANDRE
Hi

I made an extension of VisualStudio that precompiles automaticaly C or
C++ source with PostgreSQL Embedded SQL. The extension is made of the 3
files joined and I have no idea where they should be placed in the
PostgreSQL source tree.

Anybody interested in pushing this extension?

FA



ecpg.props
Description: XML document

http://schemas.microsoft.com/developer/msbuild/2003;>
  


  EcpgTarget

  
  
$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml
  
  

  


  
@(Ecpg, '|')
  




  
  

$(ComputeLinkInputsTargets);
ComputeEcpgOutput;
  

$(ComputeLibInputsTargets);
ComputeEcpgOutput;
  
  
  

  
  
  
  


  

http://schemas.microsoft.com/winfx/2006/xaml; xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback">
  

  


  

  General

  
  

  Ecpg Options

  
  

  Command Line

  


https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
  DisplayName="Output File Name"
  Description="Specifies that ecpg should write all its output to the given filename"
  Switch="o [value]"
  />

	  https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
		Description="Define a C preprocessor symbol."
		Switch="D [value]"
  />

	  https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
		Description="Specify an additional include path, used to find files included via EXEC SQL INCLUDE. Defaults are . (current directory), /usr/local/include, the PostgreSQL include directory which is defined at compile time (default: /usr/local/pgsql/include), and /usr/include, in that order."
		Switch="D [value]"
  />


	  https://www.gnu.org/software/ecpg/manual/html_node/Understanding.html#Understanding;
  Switch="v" />

https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
  Switch="t" />

	https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
	Switch="c" />

	 https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
	  Switch="i" />

	  https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
  DisplayName="RunTime"
  Description="Selects run-time behavior. Option can be one of the following:
		no_indicator:	Do not use indicators but instead use special values to represent null values. Historically there have been databases using this approach.
		prepare:		Prepare all statements before using them. Libecpg will keep a cache of prepared statements and reuse a statement if it gets executed again. If the cache runs full, libecpg will free the least used statement.
		questionmarks:	Allow question mark as placeholder for compatibility reasons. This used to be the default long ago.">

  
  
  
 

	  https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
  DisplayName="CompatibilityMode"
  Description="Set a compatibility mode. mode can be INFORMIX or INFORMIX_SE.">

		  
		  
	  

	  
  

  





  
Execute Before
  
  
Specifies the targets for the build customization to run before.
  
  

  
  

  


  
Execute After
  
  
Specifies the targets for the build customization to run after.
  
  

  
  

  





  
Additional Options
  
  
Additional Options
  

  
  
  
  
   
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL

2017-05-02 Thread Michael Paquier
On Tue, May 2, 2017 at 6:35 PM, zosrothko  wrote:
> Hi
>
> I made an extension of VisualStudio that precompiles automaticaly C or
> C++ source with PostgreSQL Embedded SQL. The extension is made of the 3
> files joined and I have no idea where they should be placed in the
> PostgreSQL source tree.
>
> Anybody interested in pushing this extension?

The PostgreSQL uses a set of scripts in src/tools/msvc/ to generate
things compiled with visual studio, so instinctively you would be
looking at working on that. Honestly, just by looking at the files you
are proposing, it is hard to make an idea of why this would be useful
for ECPG, and please note as well that there are guidelines for
submitting patches:
https://wiki.postgresql.org/wiki/Submitting_a_Patch

The source code of ecpg is located in src/interfaces/ecpg by the way.
If you are interested to work on it, that's the place where to look at
first.
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL

2017-05-02 Thread zosrothko
Hi

I made an extension of VisualStudio that precompiles automaticaly C or
C++ source with PostgreSQL Embedded SQL. The extension is made of the 3
files joined and I have no idea where they should be placed in the
PostgreSQL source tree.

Anybody interested in pushing this extension?

zos




ecpg.props
Description: XML document

http://schemas.microsoft.com/developer/msbuild/2003;>
  


  EcpgTarget

  
  
$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml
  
  

  


  
@(Ecpg, '|')
  




  
  

$(ComputeLinkInputsTargets);
ComputeEcpgOutput;
  

$(ComputeLibInputsTargets);
ComputeEcpgOutput;
  
  
  

  
  
  
  


  

http://schemas.microsoft.com/winfx/2006/xaml; xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback">
  

  


  

  General

  
  

  Ecpg Options

  
  

  Command Line

  


https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
  DisplayName="Output File Name"
  Description="Specifies that ecpg should write all its output to the given filename"
  Switch="o [value]"
  />

	  https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
		Description="Define a C preprocessor symbol."
		Switch="D [value]"
  />

	  https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
		Description="Specify an additional include path, used to find files included via EXEC SQL INCLUDE. Defaults are . (current directory), /usr/local/include, the PostgreSQL include directory which is defined at compile time (default: /usr/local/pgsql/include), and /usr/include, in that order."
		Switch="D [value]"
  />


	  https://www.gnu.org/software/ecpg/manual/html_node/Understanding.html#Understanding;
  Switch="v" />

https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
  Switch="t" />

	https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
	Switch="c" />

	 https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
	  Switch="i" />

	  https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
  DisplayName="RunTime"
  Description="Selects run-time behavior. Option can be one of the following:
		no_indicator:	Do not use indicators but instead use special values to represent null values. Historically there have been databases using this approach.
		prepare:		Prepare all statements before using them. Libecpg will keep a cache of prepared statements and reuse a statement if it gets executed again. If the cache runs full, libecpg will free the least used statement.
		questionmarks:	Allow question mark as placeholder for compatibility reasons. This used to be the default long ago.">

  
  
  
 

	  https://www.postgresql.org/docs/9.5/static/app-ecpg.html;
  DisplayName="CompatibilityMode"
  Description="Set a compatibility mode. mode can be INFORMIX or INFORMIX_SE.">

		  
		  
	  

	  
  

  





  
Execute Before
  
  
Specifies the targets for the build customization to run before.
  
  

  
  

  


  
Execute After
  
  
Specifies the targets for the build customization to run after.
  
  

  
  

  





  
Additional Options
  
  
Additional Options
  

  
  
  
  
   

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers