473,216 Members | 1,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

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_DBUSERNAME");

PGconn * conn = PQsetdbLogin(NULL, 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_WRITE);
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 2655
Colm Dobbs <Co********@aepona.com> writes:
Oid lobjId = lo_creat(conn, INV_READ|INV_WRITE);
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*******@postgresql.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
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...
9
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:...
2
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...
1
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...
1
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...
12
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...
1
by: Domagoj Čajić | last post by:
please remove me from this list, i dont know how to do it...
0
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...
2
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. ...
2
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'; ...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.