Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id KAA05925 for postgres-redist; Mon, 22 May 1995 10:05:55 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199505221705.KAA05925@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from hyowon.cc.pusan.ac.kr (hyowon.cc.pusan.ac.kr [164.125.9.3]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id KAA05915 for <postgres@postgres.berkeley.edu>; Mon, 22 May 1995 10:05:46 -0700
Received: from asadal.cs.pusan.ac.kr by hyowon.cc.pusan.ac.kr (5.0/Hyowon-mx-1.0)
	id AA02441; Tue, 23 May 1995 02:04:24 +0900
Received: by asadal.cs.pusan.ac.kr (4.1/SMI-4.1)
	id AA02165; Tue, 23 May 95 03:05:01 KDT
Date: Tue, 23 May 95 03:05:01 KDT
From: yjjeong@asadal.cs.pusan.ac.kr (Jeong yeon-jeong)
Message-Id: <9505221705.AA02165@asadal.cs.pusan.ac.kr>
To: postgres@postgres.Berkeley.EDU
content-length: 1267
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Mon, 22 May 95 10:05:55 -0700
Resent-XMts: smtp

Hello.

When I executed the following program which was in the manual of postgres

I received the message, Error: Unexpected identifier: ?|A@.
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

But, on another host of postgres this program was executed successfully.

Please, Let me know what problems are there.

Thanks in advance.

Yeong-jeong Jeong.


#include "tmp/c.h"
#include "tmp/libpq-fe.h"
#include "tmp/libpq-fs.h"
#include "catalog/pg_lobj.h"

#define 	MYBUFSIZ	1024


main()
{
int	inv_fd;
int	fd;
char	*qry_result;
char	buf[MYBUFSIZ];
int 	nbytes;
int	tmp;

	PQsetdb("mydb");

	qry_result = PQexec("begin");
	if(*qry_result == 'E') {
	   printf("\nError in PQexec");
	   exit(1);
        }

	fd = open("my_unix_file", O_RDONLY, 0666); 
        if(fd < 0) { 
           printf("Error in unix file open");
	   exit(1);
        }

	inv_fd = p_open("/inv_file", O_CREAT | INV_WRITE, Inversion);
	if(inv_fd < 0){
           printf("Error in Inversion file open");
           exit(1);
	}

	while((nbytes = read(fd, buf, MYBUFSIZ)) > 0) {
              tmp = p_write(inv_fd, buf, nbytes);
              if(tmp < nbytes) exit(1);
	}

	(void) close(fd);
 	(void) close(inv_fd);

	qry_result = PQexec("end");
	if(*qry_result == 'E') exit(1);

	exit(0);
}

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
