Re: SQLCODE==-209

From: John Summerfield <pgtest(at)os2(dot)ami(dot)com(dot)au>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: John Summerfield <pgtest(at)os2(dot)ami(dot)com(dot)au>, PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: SQLCODE==-209
Date: 2001-09-17 04:23:34
Message-ID: Pine.LNX.4.33.0109171213010.22666-100000@dugite.os2.ami.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

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 generated by 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 (I have another insert working).

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Lockhart 2001-09-17 06:26:31 Re: dynamic-static date once again
Previous Message Tom Lane 2001-09-16 21:53:02 Re: libpd - PQfinish() - crashes client application in some cases

Browse pgsql-patches by date

  From Date Subject
Next Message Barry Lind 2001-09-17 04:38:03 Re: [PATCHES] isNullable()
Previous Message Gavin Sherry 2001-09-17 02:20:52 Re: attribute names & typecast/psql default port