[GENERAL] InputStream as parameter not supported
I'm using the JDBC driver 7.1. I'm trying to write data into prepared statements using InputStreams. When I use the sample program with a simple example, it works great. When I use the 'real world' code, I get the above error. Are there any known flaws or exceptions in the 7.1 JDBC driver that would occassionally produce the InputStream as parameter not supported error? Thanks -- Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
[GENERAL] Re: InputStream as parameter not supported
Okay, I have found an old posting from Tom about setBytes that said you had to use explicit begin and ends. So I started sending explicit BEGIN and COMMIT statements to the backend and it worked. But why do you have to use explicit BEGIN and COMMIT statements if you have autocommit turned off? I appearantly have to send both a COMMIT statement to the back end and then execute the Connection's commit() method to get the transactions committed. Why is that? Thanks, -- Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer Travis Bauer ([EMAIL PROTECTED]) wrote: I'm using the JDBC driver 7.1. I'm trying to write data into prepared statements using InputStreams. When I use the sample program with a simple example, it works great. When I use the 'real world' code, I get the above error. Are there any known flaws or exceptions in the 7.1 JDBC driver that would occassionally produce the InputStream as parameter not supported error? Thanks ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[GENERAL] Re: PL/Perl Question
I think this is problematic with the default compilation fo PL/Perl. The perl interpretor you get in a plperl function is inside of a "sandbox" (can't remember the official name) where it is limited to only a relatively small set of functions. I don't think that SQL commands are included. -- -------- Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer Hitesh Patel ([EMAIL PROTECTED]) wrote: I need to be able to execute SQL commands from inside a plperl function and can't figure if I can do this. Also.. after executing the query I need to be able to grab the number of tuples returned and there values.. how would I go about doing this.. any help would be appreciated. -- Hitesh Patel [EMAIL PROTECTED] ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl
[GENERAL] plperl and sqrt.
I have plperl compiled, installed, and generally working on Solaris. But when I try to execute the sqrt function, an error is issued: ERROR: creation of function failed: sqrt trapped by operation mask at (eval 10) line 4. The number after eval changes depending on where I put the line of code which calls sqrt. Can someone tell me how to get around this? Thanks, -- Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
Re: [GENERAL] [HACKERS] pg_connect error
When you compiles php, did you ./configure with --with-pgsql? If you did not compile php explicitly telling it to includ pgsql support, it probably didn't. Travis Brian Edginton ([EMAIL PROTECTED]) wrote: I'm trying to use the php/postgresql interface via my apache server. When I try and load a page containing: ?php $db = pg_connect( "database=mydb owner=me" ) or die ( "could not connect" ) ? (both the database and owner are valid and tested via psql) apache complains: /usr/libexec/ld.so: Undefined symbol "_PQconnectdb" called from httpd:/usr/lib/apache/modules/libphp4.so at 0x4030a394 I have verified through ldconfig that libpq.so.2.0 is being loaded into hints, what am I missing? Thanks, edge
Re: [GENERAL] web programming
I'm using postgres through JDBC as the backend for my research so I have a great interest in having a better driver. I'll pitch in. Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On 17 Oct 2000, Gunnar R|nning wrote: The Hermit Hacker [EMAIL PROTECTED] writes: Agreed. JDBC needs a major development push. I've chatted with Peter about this over the past week, and mentioned that bringing in a second developer with CVS access might be an option to pursue ... the fun part is, who else has both the time and the knowledge to deal with committing changes to the source tree? Agreed that the JDBC needs more attention. Maybe post an announcement for a co-maintainer, reviewer and developer for the JDBC driver ? Other things that might also help is consider the structure of the project. Maybe one should create a JDBC subproject where latest and greatest information abut JDBC is available. Having a mailing list dedicated to JDBC could be step in this direction, but FAQs, status information, todos, etc. would also be helpful. The idea is to create a "subcommunity" of PostgreSQL for the people interested in JDBC. regards, Gunnar
Re: [GENERAL] Re: R: PostgreSQL book
I'll second Bookpool for computer books. I've used them a couple of times and they are good. Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On Wed, 11 Oct 2000, Daniel Freedman wrote: I stopped buying from and supporting Amazon.com over both their one-click patent (enforced against Barnes Noble and now recently, very publicly, licensed to apple.com even though Bezos stated to Tim O'Reilly in a public discussion on business patents that it would be used for _defensive_ purposes only) and their newer patent on affiliate shopping networks. Other people have mentioned the obvious barnesandnoble.com. I wanted to suggest that people check out bookpool.com. I've found terrific discounts from them (O'Reilly books are normally 40% off) and their shipping is dirt-cheap with no handling surcharges. All the books I've received have always been in very good condition. Take care, Daniel
[GENERAL] Lock problem on Solaris
When I start postmaster, I get the following: IpcSemaphoreCreate: semget failed (No space left on device) key = ... I know that this is caused by not having enough semaphores and can be fixed by increasing some settings. However, it normall works fine with the setting, and a nasty crash killed it this morning. I think that for some reason, some semaphores are still being held. I have ps -aux'd and killed all the postgresql processes, and have erased all my files in the /tmp directory. What else can I do? Thanks, Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
Re: [GENERAL] Lock problem on Solaris
Tom, Thanks. Running ipcclean fixed it right away. Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On Mon, 9 Oct 2000, Tom Lane wrote: Travis Bauer [EMAIL PROTECTED] writes: When I start postmaster, I get the following: IpcSemaphoreCreate: semget failed (No space left on device) key = ... However, it normall works fine with the setting, and a nasty crash killed it this morning. I think that for some reason, some semaphores are still being held. Sounds likely. The standard utility programs ipcs and ipcrm will help you clean up --- see their man pages. (You probably will need to zap the old shared-memory segments as well as the old semaphores; these tools will handle both tasks.) Our distribution includes a shell script "ipcclean" that purports to do this for you, but I wouldn't trust it too far, since the output format of ipcs is somewhat platform-specific. regards, tom lane
Re: [GENERAL] Command names
It would probably be easy to create a link, or a script called pg_XXX that executes the command XXX. I'd rather have createdb instead of pg_createdb just because it's easier to type. A script that creates the pg_ command names could be written and made available at someone's web site for people who wanted it. Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On Thu, 28 Sep 2000, Keith L. Musser wrote: I know all of you are accustomed to the command line interface for pgsql. (Of course, some of you created it!) However, I'd be interested if anyone else feels the way I do I would prefer to have a consistent set of names for the commands. For example, I propose the following: Instead of thisuse this. createdbpg_createdb createuser pg_createuser destroydb pg_destroydb initdbpg_initdb initlocation pg_initlocation pgaccess pg_accessgui pgadminpg_admin pg_dump pg_dump pg_dumpallpg_dumpall postgrespg_single postmasterpg_master psql pg_access vacuumdb pg_vacuumdb ??? pg_help (list all these commands) Not that it is terribly difficult the way it is. But I simply think that a consistent set of names would help new users, and help to prevent conflicts with other commands in the PATH. Any comments? - Keith Keith L. Musser Integrated Dynamics, Inc. 812-371- email: [EMAIL PROTECTED]
[GENERAL] Change to DatabaseMetaData.java for the jdbc2 driver (fwd)
I sent this to PATCHES last week, but it did not show up on the list. Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer -- Forwarded message -- Date: Thu, 31 Aug 2000 12:26:59 -0500 (EST) From: Travis Bauer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Change to DatabaseMetaData.java for the jdbc2 driver This is a patch which lets the DatabaseMetaData return the object type when getTables() is called. It does not really fix any bug, but it fills in some functionality that should be there anyway. The diff included here is off of the CVS as of just now :) Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer Index: DatabaseMetaData.java === RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java,v retrieving revision 1.2 diff -u -r1.2 DatabaseMetaData.java --- DatabaseMetaData.java 2000/07/20 15:30:05 1.2 +++ DatabaseMetaData.java 2000/08/31 17:24:03 @@ -1651,7 +1651,7 @@ f[4] = new Field(connection, new String("REMARKS"), iVarcharOid, 32); // Now form the query -StringBuffer sql = new StringBuffer("select relname,oid from pg_class where ("); +StringBuffer sql = new StringBuffer("select relname,oid,relkind from pg_class +where ("); boolean notFirst=false; for(int i=0;itypes.length;i++) { if(notFirst) @@ -1687,10 +1687,25 @@ remarks = defaultRemarks; dr.close(); + String relKind; + switch (r.getBytes(3)[0]) { + case 'r': + relKind = "TABLE"; + break; + case 'i': + relKind = "INDEX"; + break; + case 'S': + relKind = "SEQUENCE"; + break; + default: + relKind = null; + } + tuple[0] = null;// Catalog name tuple[1] = null;// Schema name - tuple[2] = r.getBytes(1); // Table name - tuple[3] = null;// Table type + tuple[2] = r.getBytes(1); // Table name + tuple[3] = relKind.getBytes(); // Table type tuple[4] = remarks; // Remarks v.addElement(tuple); }
Re: [GENERAL] Error with tcp/ip networking
Well, there were two other copies of postgress running, and at least one was tying up port 5432, but . . . I couldn't see them with 'ps' or 'ps -a', netstat did not list them as using a port, but it did list something as having "Active UNIX domain sockets," listing the tmp files I had deleted yesterday as the socket location (it didn't name postmaster with them). I found it by making my xterm quit long and running top. The showed up as being owned by me. Now I'm back in business, but I don't understand why they didn't show up in ps or ps -a. Thanks,. -------- Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On Thu, 31 Aug 2000, Tom Lane wrote: Well, the /tmp files are for non-TCP (Unix socket) communication, so they're not relevant to this failure. The postmaster is complaining because it can't get ownership of the 5432 TCP port number. I'm betting that you have another postmaster process still hanging around, or else (much less likely, but possible) some unrelated program that happens to have grabbed onto the 5432 TCP port number. Try using 'netstat' to see if 5432 is in use... regards, tom lane
[GENERAL] Cursors and JDBC
Does the JDBC driver support the user of cursors in postgresql 7.0.2? Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
Re: [GENERAL] sql question
Thanks, Now that you mention it, I even remember reading it in the book! Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On Wed, 12 Jul 2000, Ross J. Reedstrom wrote: SELECT CASE WHEN y1 THEN x ELSE 0 END FROM t1; From page 33 of Bruce's book, at:
Re: [GENERAL] Slashdot discussion
Once I ran into a guy who said that the postgres rpm was broken in Red Hat 5.2. This was when I was first getting into postgres. I spent some time with it and realized that there were a number of things that had to be done before it would work: creating the postgres users, initializing the database, getting something into rc.d so it would boot up automatically. The RPM was not broken, but it was a pain to get postgres running unless you spent some time reading about it. My experience with MySQL was less painful, although dealing with user permissions was more complex. Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On Tue, 11 Jul 2000, Peter Eisentraut wrote: Is anyone else noticing this: Everytime this sort of thing comes up a number of people invariably tell that they are using MySQL because it's easier to install, and that PostgreSQL is difficult ("a pain") to install. I've studied the MySQL installation instructions, and they don't strike me as inherently simpler. Is it only perception, or what can we do better?
Re: [GENERAL] view permissions problem - featuer or bug?
That part works okay, but here is a more complicated situation that doesn't: create user user1; create table t1 (x int, y int); create table t2 (a int, y int); create view v1 as select * from t1 where x in (select a from t2); -- create view v2 as select * from v1 where x3; revoke all on t1 from public; revoke all on t2 from public; revoke all on v1 from public; revoke all on v2 from public; grant select on v2 to user1; \c - user1 select * from v2; v1: Permission denied. The problem occurs because of the nested select underlined above. Since user1 has permissions on v2, he should be able to execute v2's select statement. V2 accesses another view v1. V1 accesses t1, which causes no problems since t1 is a table. But if v1 has a nested select statement (or calls a function which executes a select statement), you get a permission denied error. The workaround I did was to create a bunch of extra subview which user1 has access to. This works, but seems like the above scenerio shouldn't be causes the permission violation. Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer table big_customer_db is owned by user "master" you create a view "active_customer_list" also owned by "master" now, if you grant someone access to the view, they will be able to get the data in it, even though they can't query big_customer_db directly. Is this what you want? HTH, -- Martijn van Oosterhout [EMAIL PROTECTED] http://cupid.suninternet.com/~kleptog/
[GENERAL] view permissions problem - featuer or bug?
I have a set of tables and some views which perform calculations on those table to which no one except the group officestaff has any permissions. No problem. I tried to create views to which some particular client would have permissions. These views would be filtered versions of the private views. Herein lies the problem. If any of those underlying veiws call functions that access tables to which the user does not have permissions, or if any of those underlying views have sub-select statements (such as "where x in (select . . . )") the user gets access denied errors. Is this a feature or a bug? On the one hand, it certainly provides tight security. However, it seems like if you give someone permissions on a view, that view ought to be allows to perform whatever it needs to get the data back out regardless of other underlying permissions. -------- Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
[GENERAL] Hiding table structure
How do I prevent users from seeing the names of tables/structure of tables on which they do not have permission to perform operations. I would like to make the database appear, to clients, to only contain the view to which they have permissions, and nothing else. Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
[GENERAL] Precision of calculated numeric fields
Consider the following: trbauer=# create table t1 (x numberic(3,2)); trbauer=# \d t1 Attribute | Type | Modifier X | numeric(3,2) | trbauer=# create view v1 as select x*2 from t1; trbauer=# \d v1 Attribute | Type | Modifier --- ?column? | numeric(65535,65531) | How do I get the precision on the calculated numeric field to be something sane, like 3,2? This is important for three reasons: 1.MSAccess chokes on views containing these fields (citing the precision size). 2. The jdbc driver takes _forever_ to retrieve these fields into big decimal. 3. I really don't want to reconfigure my database to use floating points :) Thanks, Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
Re: [GENERAL] Precision of calculated numeric fields
Is this the mod field of the Field class in JDBC2? Does -1 alway mean, for numeric types, that the precision is undefined? If so, I could patch up the ResultSet class to function properly. I traced through the ResultSet code this morning. Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On Tue, 6 Jun 2000, Tom Lane wrote: Sounds like the jdbc driver also gets confused when it sees typmod -1 for a numeric field.
Re: [GENERAL] 7.0 installation problem, help please :-(
That's odd. This is the error I got compiling pgsql 6.5 on Solaris. I never resolved the problem. However, the 7.0 source did not give this error. Maybe this is a stupid question, but are you sure you have the most recent source code? Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On Tue, 23 May 2000, Chris Chan wrote: I'm pgsql newbie. I try to install the pgsql 7.0 on my Solaris 8 x86 server but fail. The following is the error message: stringinfo.c: In function `appendStringInfo': stringinfo.c:104: `va_list' undeclared (first use in this function) stringinfo.c:104: (Each undeclared identifier is reported only once stringinfo.c:104: for each function it appears in.) stringinfo.c:104: parse error before `args' stringinfo.c:121: warning: implicit declaration of function `va_start' stringinfo.c:121: `args' undeclared (first use in this function) stringinfo.c:124: warning: implicit declaration of function `va_end' gmake[2]: *** [stringinfo.o] Error 1 gmake[2]: Leaving directory `/usr/share/src/postgresql-7.0/src/backend/lib' gmake[1]: *** [lib.dir] Error 2 gmake[1]: Leaving directory `/usr/share/src/postgresql-7.0/src/backend' gmake: *** [all] Error 2
Re: [GENERAL]
Ooops. I have to withdraw that comment. I spent hours the other day beating my head against the wall over this. I was sure that it didn't work . . . Sorry, Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On Wed, 24 May 2000, Ross J. Reedstrom wrote: On Wed, May 24, 2000 at 12:45:59PM -0500, Travis Bauer wrote: One problem you may have with this is that if a function accesses some table, the user who uses that function must also have permissions on the table. I have a similar problem. I'd like to give permissions on a view, but not on the table underlying the view (the view serves to filter out some records the user shouldn't see). I can't give permission to use view without giving permission to use the table. Have you tried it? This is one of the things views are for. The view accesses it's underlying tables as the user who created the view, as far as I recall. I, for example, have an entire database where every table has a 'pub' boolean. I've created views that return only rows with pub = 't', and given the anonymous user (which the web server connect as) select privileges only on the view.
Re: [GENERAL] RPM troubleshoot
If you are trying to install the most recent version, you could try rpm -Uvh Depending on what distribution you are using and how it is configured, Postgresql may be installed. However, on earlier version of RedHat (can't quite remember which), although postgresql was installed, it took a bit of tweaking the system startup scripts, environment variables, create the user postgres, and run initdb to get it working. Some people found it confusing. I talked to guy in town who said he was in a discussion on the internet where the concluded the earlier RPMS were broken for RedHat. They weren't, but the initialization process was confusing people. Conclusion: Even if postgresql is installed on your system from a previous version, re-install it with the new rpms. It's easier to get running, and works much better. Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer Original Message Date: Fri, 19 May 2000 23:19:25 PDT From: "santosh behera" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Hi everybody, Can any body help me is troubleshooting my PostgreSQL installation !.when giving rpms postgr*.rpm it replies postgreSQL already installed. No daemon of postmaster is running. Please help me how i can be sure if at all this is installed and start a session .
[GENERAL] Error in manual
Thanks for the help on the libperl question. I bet recompiling the sources will fix my problem. There is an error in the example in the file: triggers20290.htm. All the elog statements list "WARN" as the first parameter. However WARN is not defined in elog.h (or, it seems, anywhere else). In my code, I just used NOTICE instead and it worked okay. On another note, I noticed that when you load a dynamically loaded c library using the create funtion statement in psql, the library is never reloaded unless you quit psql and restart it, even if you "drop function", change the library, and recreate the function. This is good for making the code work fast (you don't want postgress to keep checking to see if the library has changed), but this should probably be noted somewhere in the programmers manual. If you don't know this, debugging a c function can be quite frustrating. -------- Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
[GENERAL] getting libperl.so
I'd like to write some functions in embedded perl. I have installed Mandrake from the RPMS recommended on this list a few days ago ( They worked great, by the way). I have also downloaded the source so I can compile plperl.so. But I can't because appearantly libperl.so is not configured properly on my machine. I'm using Mandrake 7.0, and the only copy of libperl.so that I can find is in: /usr/lib/apache (thanks to the mod-perl rpm). How do I get libperl.so so I can compile plperl? Thanks, Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
[GENERAL] array data types and performance
Two questions: 1. Is there a way to make an "Array field," where you could refer to something like afield[1], afield[2], . . . and have them each be an integer or some other base data type? 2. If not, I think something equivalent could be accomplished using composite data types written in C++. If there a performance cost to using routines in shared libraries? -------- Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
Re: [GENERAL] Problems compiling version 7
I have tr version 1.22 (GNU texutils). It is located in /usr/bin, and is found by my login shell (cshrc). How could I check the locale setting? Thanks, Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer On Tue, 9 May 2000, Tom Lane wrote: checking for gzcat... (cached) /usr/local/gnu/bin/gzcat checking for perl... (cached) perl configure: error: Can't find method to convert from upper to lower case with tr I'm compiling this in Red Hat 6.0 Weird. Do you not have 'tr' in your PATH? You wouldn't be running with some bizarre LOCALE setting, by any chance?