agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Jeong yeon-jeong <yjjeong@asadal.cs.pusan.ac.kr>
To: postgres@postgres.Berkeley.EDU
Date: Tue, 23 May 95 03:05:01 KDT
Message-ID: <9505221705.AA02165@asadal.cs.pusan.ac.kr> (raw)

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/



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: yjjeong@asadal.cs.pusan.ac.kr
  Subject: Re: 
  In-Reply-To: <9505221705.AA02165@asadal.cs.pusan.ac.kr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox