473,586 Members | 2,754 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

postgesql-7.3.3 lo_create/lo_open fails

Hi Guys,

I'm currenlty involved in a port of our gateway code from a Solaris 8
environment to a HP-UX11.11 incorporating postgresql-7.3.3. We're having
some problems with creation and opening of large objects and was hoping
that you may be able to shed some light on them.

I extracted the LO code into the test program as below and am able to
recreate the problems:

int
main(
int argc,
char * argv[]
)
{
char chBytes[] = "FILLER";
int iLength = strlen(chBytes) ;

char * chTempDB = NULL;
chTempDB = getenv ("CMN_DBNAME ");
char *chTempUserName =NULL;
chTempUserName = getenv ("CMN_DBUSERNAM E");

PGconn * conn = PQsetdbLogin(NU LL, NULL, NULL, NULL, chTempDB,
chTempUserName, NULL);

/*
* check to see that the backend connection was successfully made
*/
if (PQstatus(conn) == CONNECTION_BAD)
{
cout << "Large object connection is bad " << endl;
}

PGresult * res = PQexec(conn, "begin");
PQclear(res);

Oid lobjId = lo_creat(conn, INV_READ|INV_WR ITE);
if (lobjId != -1)
{
cout << "Large object ID created :" << lobjId << endl;
int lobj_fd = lo_open(conn, lobjId, INV_WRITE);
cout << "Large object file descriptor :" << lobj_fd << endl;
if (lobj_fd != -1)
{
// write the large object
int nbytes_out = lo_write(conn, lobj_fd, chBytes, iLength);
cout << "Large object written - no of bytes :" << nbytes_out << endl;
(void) lo_close(conn, lobj_fd);
}
}

res = PQexec(conn, "end");
PQclear(res);
PQfinish(conn);
}

all worked fine on the Solaris box but on the HP the lo_creat returns 0
for the oid - subsequently lo_open returns -1 when an attempt is made to
open the object.

The configuration used to install postgresql-7.3.3 on the HP environment
is as follows:

configure CC=/bin/cc AR=/bin/ar CFLAGS=+DA2.0W --without-readline
--without-zlib

Has anyone come across this problem ? Any help on this would be much
appreciated

Thanks in advance

Colm

--
*************** *************** *************** *************** **
* Colm Dobbs Email: c.*****@aepona. com *
* Software Engineer Web: www.aepona.com *
* Aepona LTD,Interpoint Building, Phone: +44 (0)2890 269186 *
* 20-24 York Street, Belfast Fax: +44 (0)2890 269111 *
* BT15 1AQ N.Ireland *
*************** *************** *************** *************** **
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #1
1 2669
Colm Dobbs <Co********@aep ona.com> writes:
Oid lobjId = lo_creat(conn, INV_READ|INV_WR ITE);
if (lobjId != -1)


This coding is wrong --- lo_creat would return 0 (InvalidOid) on
failure, not -1. As for *why* it's failing, PQerrorMessage might
offer some hint. I'm a tad surprised by that myself; never heard
of it happening with a connection not already in an error state.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1945
by: Mage | last post by:
Hello, I started to write my PostgreSQL layer. I tried pyPgSQL and PyGreSQL. I made a *very minimal* performance test and comparsion with the same thing in php. Table "movie" has 129 record and many fields. I found PyGreSQL / DB-API / fetchall horrible slow (32 sec in my test). PHP did 13 secs and it gave the result in associative array....
9
2759
by: Chad Smith | last post by:
Hello, I'm relatively new to the database world so please forgive me in advance for my ignorance. I have recently been tasked at my job with finding a tool that will perform the following tasks: 1) extract schemas from a db, 2) produce a difference report between schemas from two databases, and 3) synchronize two schemas. The purpose is for...
2
7880
by: Rick Brough | last post by:
I'm in the early stages of researching the migrating of an OLTP Oracle database (size 200+ GB) and still growing to PostgreSQL 8.x. Before I spend alot of time documenting the migration path, I'd like to know if there is a limitation to the size of a PostgeSQL database. If so, what is the limitation? Any feedback would be greatly appreciated ...
1
3244
by: James Moe | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, Postgesql v7.3.2, os/2. I am using JDBC to connect to the dbms. After a few program open/close I get the message "Sorry, too many clients already". Supposedly my database class properly closes the connection when it is removed. Maybe not. How do I see who and how many connections there...
1
1997
by: Derrick Betts | last post by:
I am using Delphi7 and PostgeSQL 7.3.2 My DB table is as such Create Table files ( emalid varchar(80), memocolumn text, savedfile oid ); I cannot post Blobs to the DB that are larger than a typical icon. If the Blob is small, it goes through just fine. When I try to send a larger objectto the DB, I get a Postgres error:
12
2245
by: Martin_Hurst | last post by:
It would appear that MySQL is making great strides into the commercial and even the enterprise arena. I am not seeing the same news coverage being said about Postgresql. I believe Postgresql has been a much better rdbms than MySQL for a long time, so then why has not Postgresql grabbed the commercial and enterprise arena before MySQL did? ...
1
2093
by: Domagoj Čajić | last post by:
please remove me from this list, i dont know how to do it...
0
1080
by: Josh Berkus | last post by:
Folks, While debugging a wireless card, I came across this interesting bit: http://portal.suse.com/sdb/en/2003/10/pohletz_desktop_90.html What it indicates is that by default SuSE 9.0 plays with the timeslice values for the Linux kernel in order to provide a "smoother" user experience. In my experience, this can be very bad news for...
2
2176
by: Phil Campaigne | last post by:
Hi All, I am seting up my web app with a tomcat/postgresql hosting service. From my psql client I type psql and then I am asked for my password. This logs me into my hosted database just fine. However, I can't log on from my webapp to the database thru jdbc like I could when my webapp/Tomcat/postgresql were on my local machine. The jdbc...
2
2502
by: chris | last post by:
Hi! Is there any Way or have somebody a Function to do something like this copy skurs from 'http://ichart.finance.yahoo.com/table.csv?s=TKAG.DE&d=10&e=15&f=2004&g=d&a=3&b=5&c=1991&ignore=.csv'; Would be great if you could help me! THX Christian Meier
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8200
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.