[GENERAL] htonl necesssary for PQexecParams input?

2006-06-22 Thread Kevin Jenkins
Previously I was getting a bad result when calling PQexecParams with binary results because PostgreSQL stores its data big endian. So I had to do ntohl on the result to get it to little endian. My question is, do I also need to do htonl then, as in this scenario? outStr[0]="blah"; outLengths[

[GENERAL] Junk binary date?

2006-06-20 Thread Kevin Jenkins
I call PQexecParams with the last parameter as 1 to return binary data. I then get this data with: fileLengthPtr = PQgetvalue(result, rowIndex, fileLengthColumnIndex); memcpy(&fileLength, fileLengthPtr, sizeof(fileLength)); The value being returned is of type integer. It should have the value

Re: [GENERAL] ERROR: there is no parameter $1

2006-06-19 Thread Kevin Jenkins
Tom Lane wrote: Kevin Jenkins <[EMAIL PROTECTED]> writes: I get ERROR: there is no parameter $1. INSERT INTO FileVersionHistory(applicationID, filename, createFile, changeSetID, userName) VALUES (1,$1::text,FALSE,9,'postgres'); outTemp[0]=deletedFiles.fileList[fileLis

[GENERAL] ERROR: there is no parameter $1

2006-06-19 Thread Kevin Jenkins
Hi, I'm using PQexecParams so I can upload filenames including path that have '\' characters. It works everywhere else I used it but not with this query. I get ERROR: there is no parameter $1. INSERT INTO FileVersionHistory(applicationID, filename, createFile, changeSetID, userName) VALUE

[GENERAL] Tips for storing files in the database

2006-06-18 Thread Kevin Jenkins
Is there a way to send and read binary data directly from memory, without escaping characters, for SELECT and INSERT queries? This is for a file repository, such as in source control. I saw in the manual the section on bytea and binary data, but I don't want to go through hundreds of megabytes

[GENERAL] SQL query question

2006-06-17 Thread Kevin Jenkins
NULL DEFAULT 0," "changeSetID integer NOT NULL," "userName text NOT NULL," "CONSTRAINT file_has_data CHECK ( createFile=FALSE OR ((content IS NOT NULL) AND (contentHash IS NOT NULL) AND (patch IS NOT NULL)) )" ");" "COMMIT;"; Add an application