Re: ECPG Documentation Improvement - Mailing list pgsql-interfaces

From Mark Richardson
Subject Re: ECPG Documentation Improvement
Date
Msg-id 695459.74507.qm@web53308.mail.re2.yahoo.com
Whole thread Raw
In response to ECPG Documentation Improvement  (Satoshi Nagayasu <satoshi.nagayasu@gmail.com>)
Responses Re: ECPG Documentation Improvement
Re: ECPG Documentation Improvement
List pgsql-interfaces
Here's some info that I found...
 
For conversion of Sybase .pc files to postgres .pgc files, you have to parse the .pc file and change from sybase format to postgres format.  We used a simple script but here's what we changed the following (sybase is first column, postgres is second - quotes are used just to indicate the entire string, you don't need them in the search/replace)
"INCLUDE SQLCA" "INCLUDE sqlca"
"SQLCA" "struct sqlca_t"
"CS_BIT" "bool"
"CS_CHAR" "char"
"CS_INT" "int"
"CS_TINYINT" "short"
"CS_SMALLINT" "short"
"CS_REAL" "float"
"CS_FLOAT" "double"
"CS_LONG_LONG" "long long"
"CS_LONG" "int"
"CS_BINARY" "char"
"CS_TEXT" "char"
"ISOLATION LEVEL 0" "ISOLATION LEVEL READ COMMITTED"
"ISOLATION LEVEL 1" "ISOLATION LEVEL READ COMMITTED"
"ISOLATION LEVEL 2" "ISOLATION LEVEL SERIALIZABLE"
"SQL CONNECT :" "SQL CONNECT TO :dbName_ USER:"
"CHAINED OFF" "CHAINED TO OFF"
"CHAINED ON" "CHAINED TO ON"
 
 
I also looked up the boolean type for ecpg, the problem is in postgres 8.0.1 (maybe later)
postgresql/src/interfaces/ecpglib/execute.c line 775 (case ECPGt_bool)
the line was
sprintf(mallocedval, "'%c'", (*((char *) var->value)) ? 't' : 'f');
changed it to
sprintf(mallocedval, "'%c'", (*((char *) var->value)) ? '1' : '0');
 
If you have more questions I can dig in the code and find answers for you.
Mark
--- On Thu, 6/17/10, Satoshi Nagayasu <satoshi.nagayasu@gmail.com> wrote:

From: Satoshi Nagayasu <satoshi.nagayasu@gmail.com>
Subject: [INTERFACES] ECPG Documentation Improvement
To: pgsql-interfaces@postgresql.org, pgsql-docs@postgresql.org
Cc: "Bruce Momjian" <bruce@momjian.us>, "Michael Meskes" <meskes@postgresql.org>
Date: Thursday, June 17, 2010, 3:07 AM

Hi all,

I'm trying to improve the ECPG documents for the ECPG application
developrs, because some of my clients want more detailed information
when they develop (or migrate) an embeded SQL applications.
Of course, I want to contribute this work to the official manual.

So I have one thing to introduce to you, and thing to ask you.

At first, I've done writing ECPG directives.
I think it could be useful for the ECPG application developers,
similar to the SQL reference section in the official manual.

ecpgdocs @ GoogleCode (I'm working here.)
http://code.google.com/p/ecpgdocs/

ecpgdocs downloads (You can find the current document.)
http://code.google.com/p/ecpgdocs/downloads/list?deleted=1&ts=1276763948

However, I'm not familiar with ECPG details or internals,
so here is one asking, I hope someone to review my documents
and give some feedback to me.

Feedbacks which I'm expecting are:

- Is this document useful?
- Missing directives.
- Missing or wrong synopsis.
- More appropriate descriptions on parameters or examples.
- How to contribute this to the official manual.
- Correcting English. (sorry for my poor English.)
- etc...

Honestly, I'm not familiar with the documentation acceptance/review process,
so any advice and/or comments are welcome.

Regards,
--
NAGAYASU Satoshi <satoshi.nagayasu@gmail.com>

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

pgsql-interfaces by date:

Previous
From: Satoshi Nagayasu
Date:
Subject: ECPG Documentation Improvement
Next
From: Satoshi Nagayasu
Date:
Subject: Re: ECPG Documentation Improvement