Re: ECPG Documentation Improvement

From: Mark Richardson <markmapo(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: Satoshi Nagayasu <satoshi(dot)nagayasu(at)gmail(dot)com>
Subject: Re: ECPG Documentation Improvement
Date: 2010-06-17 19:27:33
Message-ID: 695459.74507.qm@web53308.mail.re2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs 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(dot)nagayasu(at)gmail(dot)com> wrote:

From: Satoshi Nagayasu <satoshi(dot)nagayasu(at)gmail(dot)com>
Subject: [INTERFACES] ECPG Documentation Improvement
To: pgsql-interfaces(at)postgresql(dot)org, pgsql-docs(at)postgresql(dot)org
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "Michael Meskes" <meskes(at)postgresql(dot)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(dot)nagayasu(at)gmail(dot)com>

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Satoshi Nagayasu 2010-06-18 08:05:53 Re: ECPG Documentation Improvement
Previous Message Satoshi Nagayasu 2010-06-17 09:07:05 ECPG Documentation Improvement

Browse pgsql-interfaces by date

  From Date Subject
Next Message Satoshi Nagayasu 2010-06-18 08:05:53 Re: ECPG Documentation Improvement
Previous Message Satoshi Nagayasu 2010-06-17 09:07:05 ECPG Documentation Improvement