Skip site navigation (1) Skip section navigation (2)

Re: ERROR: invalid datatype 'FILE'

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: ERROR: invalid datatype 'FILE'
Date: 2011-02-09 10:57:30
Message-ID: iitruq$2sf$1@reversiblemaps.ath.cx (view raw or flat)
Thread:
Lists: pgsql-novice
On 2011-02-01, Amish <amish(dot)pandya(at)in(dot)com> wrote:
>
> Hi

> EXEC SQL BEGIN DECLARE SECTION;
> struct  rid_ds
> {
>         double de_re_rid;
>         double de_re_xrid;
>         FILE   *fp;
> } dbinfo_t;
> dbinfo_t dbval;
> EXEC SQL END DECLARE SECTION;

> ERROR: invalid datatype 'FILE'

it looks to me like ecpg doesn't know how to convert FILE*
into an SQL value.

I'd say try it without the "EXEC SQL BEGIN DECLARE SECTION;"
but from inspection it appears not to be valid C either.

> The same code compiles using esqlc without any problem. Is there any way to
> fix about error 

start by reading the the esqlc manual to figure out how the rules
of C change inside "EXEC SQL BEGIN DECLARE SECTION;".

file:///usr/share/doc/postgresql-doc-8.4/html/ecpg-preproc.html

suggests that "EXEC SQL INCLUDE stdio.h" might help 
but that's not going to fix the broken C code two lines after the
error it's finding.


-- 
⚂⚃ 100% natural

In response to

pgsql-novice by date

Next:From: Jasen BettsDate: 2011-02-09 12:00:14
Subject: Re: Backing up several PostgreSQL databases
Previous:From: matty jonesDate: 2011-02-08 20:04:37
Subject: table design

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group