Re: SQLCODE==-209 - Mailing list pgsql-bugs

From John Summerfield
Subject Re: SQLCODE==-209
Date
Msg-id Pine.LNX.4.33.0109171213010.22666-100000@dugite.os2.ami.com.au
Whole thread Raw
In response to Re: SQLCODE==-209  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-bugs
On Thu, 13 Sep 2001, Peter Eisentraut wrote:


> John Summerfield writes:
>
> > I'm using 7.2devel from CVS, and as I've already reported, the documentation doesn't build.
>
> http://www.ca.postgresql.org/devel-corner/docs/postgres/index.html

I don't normally have web access. I'd much prefer the build instructions include how to build the documentation.

>
> > Consequently I'm forced to rely on documentation for 7.1.2/3 which
> > does not mention -209, at least in the ecpg documentation I'm looking
> > at,
>
> 7.2 doesn't document it either...
>
>

I've not had anyone explain what it means yet. I've resorted to examining source code (while it might be the utimate
documentation,it's not ideal). I've found several places it can arise, but I still have no idea what the error is. 


The key seems to be the meaning of the technical term "indicator."


On a related matter, (I know it's related because it comes from the code which fails with this error), I think the code
generatedby ecpg is wrong: 

        /* exec sql begin declare section */




#line 134 "yahoo.load.pgc"
   char * name  = fileName ;

#line 135 "yahoo.load.pgc"
   int  i_filesize   ;

#line 136 "yahoo.load.pgc"
   int  i_records  = transactionRecords ;
/* exec sql end declare section */
#line 137 "yahoo.load.pgc"

        struct stat fileinfo;
        if (-1 == stat(name,&fileinfo))
        {
            fprintf(stderr, "Error checking file info for %s: %s\n",
                name, strerror(errno));
        }
        i_filesize=fileinfo.st_size;
        printf("name(%s), size(%d) records(%d)\n",name, i_filesize, i_records);






{ ECPGdo(__LINE__, NULL, "insert into tsj0601_loaded_files ( name  , filesize  , records  ) values ( ? , ? , ? )",
    ECPGt_char,&(name),0L,1L,1*sizeof(char),  <---- whoops
    ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
    ECPGt_int,&(i_filesize),1L,1L,sizeof(int),
    ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
    ECPGt_int,&(i_records),1L,1L,sizeof(int),
    ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 152 "yahoo.load.pgc"


I think this is not going to pick up the string *name. Either ecpg should reject this, or generate something like

        ECPGt_char,(name),0L,1L,1*strlen(name))

but then I'm not much of a C programmer.

I'm going to assume that my definition of name offends ecpg and gives rise to the error -209, and try to work round it
(Ihave another insert working). 

pgsql-bugs by date:

Previous
From: Justin Clift
Date:
Subject: Re: WAL Log numbering
Next
From: John Summerfield
Date:
Subject: CVS rejected me