FW: [GENERAL] code to cancel a running query, worker thread

2006-04-20 Thread surabhi.ahuja
Help needed, i have the following peice of code, which is meant for cancelling queries in between import java.sql.*; public class QueryExecutor implements Runnable { /** * @param args */private Thread worker;private Params params;private Results results;private volatile boolean

Re: [GENERAL] postmaster services problem

2006-04-20 Thread Dave Page
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of liishyanSent: 19 April 2006 10:27To: pgsql-general@postgresql.orgSubject: [GENERAL] postmaster services problem Hi, Im having problem starting the postmaster service at my offices server now.

[GENERAL] disk full scenario

2006-04-20 Thread surabhi.ahuja
if disk is near to full and i establish a connection with postgres and read a table and then close the following error logs comes in postgreslog: 17:10:47 CDT%authenticationLOG: connection authorized: user=sdc database=dbexpress2006-04-05 17:10:47 CDT%idleLOG: disconnection: session time:

[GENERAL] Unable to connect to PostgreSQL server

2006-04-20 Thread Martin Kuria
hi, I have a problem with my postgresql database it always gives me an error: Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: FATAL: sorry, too many clients already in ~/includes/DbConnector.php on line 27 Please advice how I can manage my database to

Re: [GENERAL] some error messages in postgeslog

2006-04-20 Thread Richard Huxton
surabhi.ahuja wrote: I use PostgreSQL 8.0.0 it seems that the disk was close to full, i executed a program (in C++) which opens a connection to Postgres using PQConnectdb. and then it reads from a particluar table, and simply displays the values on the console. after doing that it will

Re: [GENERAL] Permission problem opening database

2006-04-20 Thread Richard Huxton
Dilan A wrote: When I started the postgres service and tried connecting using PgAdmin III I got the following error: An Error has occurred. FATAL: could not open relation 16627/16628/2701: Permission Denied. Any ideas on how this can be fixed. First step is to check the permissions on all

Re: [GENERAL] tomcat postgresql connectivity error

2006-04-20 Thread Richard Huxton
Danish wrote: Hi, Im trying to run a web application from tomcat which connects to a database on postgresql 8.1.3 But when it tries to connect to a database.an E 101 Exception occured while retrieving results. is shown When I checked up the logs of tomcat.I could see.. SQLException

Re: [GENERAL] Unable to connect to PostgreSQL server

2006-04-20 Thread Harald Armin Massa
Martin,please check out the server configuration documentation athttp://www.postgresql.org/docs/8.1/interactive/runtime-config-connection.html#RUNTIME-CONFIG-CONNECTION-SETTINGS your configuration file of choice is postgresql.conf within the data directory.(btw: because the default is rather big,

Re: [GENERAL] strange query filter problems

2006-04-20 Thread Jonas Henriksen
Thanks, increasing the statistics did the trick: ALTER TABLE tskjema ALTER species SET STATISTICS 999 Is there a rule of thumb to tell how to set the statistics? Jonas:)) On 4/19/06, Martijn van Oosterhout kleptog@svana.org wrote: On Wed, Apr 19, 2006 at 01:53:46PM +0200, Jonas Henriksen

Re: [GENERAL] Unable to connect to PostgreSQL server

2006-04-20 Thread Shane Ambler
Look in data/postgres.conf You will find a line there such as max_connections = 50 you will also need to check that shared_buffers is at least twice the max_connections. You can also start Postmaster with -B nBuffers -N maxbackends On 20/4/2006 17:41, Martin Kuria [EMAIL PROTECTED] wrote:

Re: [GENERAL] Categories and Sub Categories (Nested)

2006-04-20 Thread Alban Hertroys
Ian Harding wrote: You should look up the contrib module ltree which is made for this sort of thing. If you reinvent the wheel like this, you will be stuck with 2 levels. With ltree you can have as many as you need and add more at any time. It lets you query for ancestors and descendants of

Re: [GENERAL] Unable to connect to PostgreSQL server

2006-04-20 Thread Shane Ambler
You may also want to look into your php.ini settings. pgsql.max_persistent pgsql.max_links pgsql.auto_reset_persistent and PGSQL_CONNECT_FORCE_NEW are options you would want to check into. Look in data/postgres.conf You will find a line there such as max_connections = 50 you will also need

Re: [GENERAL] Calling the same function more than once with the same arguments

2006-04-20 Thread Clodoaldo Pinto
2006/4/19, Ben [EMAIL PROTECTED]: Look into the immutable flag on function creation: http://www.postgresql.org/docs/8.1/interactive/xfunc-volatility.html That is what I needed to know, Thanks. Regards, Clodoaldo Pinto ---(end of broadcast)---

Re: [GENERAL] Query to check existence of stored procedure?

2006-04-20 Thread Jim Buttafuoco
Give this function a try, examples at the end, I used Postgresql 8.1.3 -- s is the schema to look in -- f is the function name create or replace function isfunctionavailable(s text,f text) returns bool as $$ declare ans bool; begin select into ans true from pg_proc p join pg_namespace n

Re: [GENERAL] Calling the same function more than once with the

2006-04-20 Thread Scott Marlowe
On Wed, 2006-04-19 at 18:23, Tom Lane wrote: Clodoaldo Pinto [EMAIL PROTECTED] writes: I'm building a function caller() in which a certain function called() will be called many times in from clauses with the same arguments and I'm wondering if is there a performance penalty for that or if

Re: FW: [GENERAL] code to cancel a running query, worker thread

2006-04-20 Thread Tom Lane
surabhi.ahuja [EMAIL PROTECTED] writes: i have the following peice of code, which is meant for cancelling queries in between [ big chunk of Java code ] You'd be more likely to find a knowledgeable answer on the pgsql-jdbc mailing list. regards, tom lane

[GENERAL] How to replace rows in table so that foreign key rows are not deleted

2006-04-20 Thread Andrus
I want to replace ( delete and insert) records in master table . I delete and insert record with same primary key. I want that foreign key records are not deleted. I tried begin; create temp table t1 ( pk integer primary key ); insert into t1 values(1); create temp table t2 (fk integer ); alter

Re: [GENERAL] HUGE Stack space is gettiing consumed

2006-04-20 Thread Martijn van Oosterhout
On Thu, Apr 20, 2006 at 08:20:30PM +0530, Mavinakuli, Prasanna (STSD) wrote: Hello Martijin, I am not able to make it ..Code what u sent is *not* giving desired result.. That is -when we try to fetch huge data in a thread routine it says could not receive data from server: Error 0 If it

Re: [GENERAL] How to replace rows in table so that foreign key rows

2006-04-20 Thread Berend Tober
Andrus wrote: Is there any generic way to turn off foreign key constraints before delete command in transaction ? From TFM: --disable-triggers This option is only relevant when performing a data-only restore. It instructs pg_restore to execute commands to temporarily disable triggers on the

Re: [GENERAL] grant privileges across schemas

2006-04-20 Thread Fernan Aguero
+[ Bruno Wolff III [EMAIL PROTECTED] (19.Apr.2006 14:39): | | On Wed, Apr 19, 2006 at 09:29:50 -0300, | Fernan Aguero [EMAIL PROTECTED] wrote: | | The following works, but I'm not sure about the consequences | of granting USAGE to a schema, as the documentation is | not clear, IMO : For

Re: [GENERAL] Calling the same function more than once with the same arguments

2006-04-20 Thread Clodoaldo Pinto
2006/4/19, Ben [EMAIL PROTECTED]: Look into the immutable flag on function creation: I have read that section and I'm still not sure about it. This is the caller() function: create or replace function caller(int4) returns some_type as $body$ select array(select distinct a from called($1))

Re: [GENERAL] How to replace rows in table so that foreign key rows

2006-04-20 Thread Andrus
I did so, and for a table named 'country' the following SQL statements were produced: -- Disable triggers UPDATE pg_catalog.pg_class SET reltriggers = 0 WHERE oid = 'country'::pg_catalog.regclass; /* COPY command goes here to bulk load table data. */ -- Enable triggers UPDATE

Re: [GENERAL] How to replace rows in table so that foreign key rows

2006-04-20 Thread Stephan Szabo
On Thu, 20 Apr 2006, Andrus wrote: I want to replace ( delete and insert) records in master table . I delete and insert record with same primary key. I want that foreign key records are not deleted. I tried begin; create temp table t1 ( pk integer primary key ); insert into t1 values(1);

Re: [GENERAL] grant privileges across schemas

2006-04-20 Thread Bruno Wolff III
On Thu, Apr 20, 2006 at 13:52:38 -0300, Fernan Aguero [EMAIL PROTECTED] wrote: +[ Bruno Wolff III [EMAIL PROTECTED] (19.Apr.2006 14:39): | | | Granting access to a schema allows use of that schema. It does not grant | access to objects contained in the schema. You will need to do a

[GENERAL] sudo-like behavior

2006-04-20 Thread A.M.
Hello, I have written a crontab-like daemon which accepts jobs from users through a table and executes SQL statements after certain events or intervals. This daemon maintains a persistent connection to the database as a superuser. The problem is that I wish to run arbitrary SQL as an

Re: [GENERAL] odbc problem

2006-04-20 Thread Tom Lane
P.MO [EMAIL PROTECTED] writes: I've just recompiled a postgres 8.1.3 on freebsd 5.4 and since then, I can no more access it with odbc. What happens exactly when you try? Does it still work from other clients, eg psql? regards, tom lane ---(end

Re: [GENERAL] sudo-like behavior

2006-04-20 Thread Tom Lane
A.M. [EMAIL PROTECTED] writes: It seems I am stuck so please allow me to propose an extension: SET SESSION AUTHORIZATION user [WITH PASSWORD 'password]; This idea is extremely unlikely to be accepted, as the password would be at risk of exposure in places like the pg_stat_activity view. I

Re: [GENERAL] sudo-like behavior

2006-04-20 Thread Karsten Hilbert
On Thu, Apr 20, 2006 at 04:06:19PM -0400, A.M. wrote: The problem is that I wish to run arbitrary SQL as an unprivileged user Would wrapping the SQL in a stored procedure with security definer help any ? Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9

[GENERAL] GiST index slower than seqscan

2006-04-20 Thread CG
I'm still trying to wrap my brain around this one. Please forgive me if this is the proverbial dead horse that I'm beating. In case you're unfamiliar with this particular horse, I'm using ltree to create a full text index on some = 50 char long fields for a lookup table. The idea was to be able

Re: [GENERAL] sudo-like behavior

2006-04-20 Thread A.M.
On Thu, April 20, 2006 4:21 pm, Tom Lane wrote: A.M. [EMAIL PROTECTED] writes: It seems I am stuck so please allow me to propose an extension: SET SESSION AUTHORIZATION user [WITH PASSWORD 'password]; This idea is extremely unlikely to be accepted, as the password would be at risk of

Re: [GENERAL] sudo-like behavior

2006-04-20 Thread Tom Lane
A.M. [EMAIL PROTECTED] writes: On Thu, April 20, 2006 4:21 pm, Tom Lane wrote: I think the correct way to do what you want is via a SECURITY DEFINER function. Perhaps I can't wrap my head around it- I have the SQL as a string in a table. Well, the simplest thing would be create

[GENERAL] full text search: the concept of a word

2006-04-20 Thread Tomi NA
I'm considering using tsearch2 in the project I'm working on right now...however, I'm not sure if tsearch2 can handle my very specific requirements - I therefore hope someone can tell me if the following is possible and how I should go about it... My textfields are trigger-generated using

[GENERAL] setting the environment locale - linux, windows

2006-04-20 Thread Tomi NA
This is probably somewhat offtopic, but it does relate to postgresql so... Problem summary: I have a UTF-8 encoded database running on linux on which upper() and lower() string functions ignore locale specific characters. To make things a bit more interesting, the development machines (including

Re: [GENERAL] full text search: the concept of a word

2006-04-20 Thread Teodor Sigaev
My textfields are trigger-generated using information from a number of tables: these fields can be, say, a couple of thousand characters wide. Up to here, there's no problem. What I'd like to do is define - possibly using regexps - what constitutes a word. For instance, my word separator is a

Re: [GENERAL] GiST index slower than seqscan

2006-04-20 Thread Teodor Sigaev
In case you're unfamiliar with this particular horse, I'm using ltree to create a full text index on some = 50 char long fields for a lookup table. The idea was to be able to tear through tons of data quickly finding case insensitive substring matches. Why it is a ltree, not a tsearch?

Re: [GENERAL] sudo-like behavior

2006-04-20 Thread Agent M
I really haven't provided enough details- my fault. What I want to accomplish is a general-purpose timer facility for postgresql. Ideally, arbitrary roles provide statements to run at certain intervals. The benefit here is that the user connections can go away and only a single timer

Re: [GENERAL] [ADMIN] what the problem with this query

2006-04-20 Thread Jim C. Nasby
On Fri, Apr 14, 2006 at 11:09:16AM +, venu gopal wrote: Hi all, When i try to run the following query it gives the following error what was wrong in the query. Query:SELECT o.orgunitname AS ouname, e.entrynumber AS value_field, centroid(c.the_geom) AS the_geom, c.ogc_fid AS ogc_fid

Re: [GENERAL] sudo-like behavior

2006-04-20 Thread Tom Lane
Agent M [EMAIL PROTECTED] writes: I really haven't provided enough details- my fault. What I want to accomplish is a general-purpose timer facility for postgresql. I'm not really sure why you think it'd be a good idea for such a thing to operate as an unprivileged user that gets around its

Re: [GENERAL] recovery with pg_xlog

2006-04-20 Thread Jim C. Nasby
On Tue, Apr 18, 2006 at 11:40:42AM +0530, [EMAIL PROTECTED] wrote: We want to prepare a backup machine (for disaster management) by passing only the ARCHIVEDIR directory from another online machine - both the machines have Postgresql installed. We have sent PGLOG and ARCHIVEDIR but the

Re: [GENERAL] Query to check existence of stored procedure?

2006-04-20 Thread Jim C. Nasby
And what happens if you have an overloaded function? :) On Thu, Apr 20, 2006 at 07:55:50AM -0400, Jim Buttafuoco wrote: Give this function a try, examples at the end, I used Postgresql 8.1.3 -- s is the schema to look in -- f is the function name create or replace function

Re: [GENERAL] Query to check existence of stored procedure?

2006-04-20 Thread Jim C. Nasby
If you're on a more recent version, you can try and select the procname for a proc and trap the error: decibel=# select 'abs(bigint)'::regprocedure; regprocedure -- abs(bigint) (1 row) decibel=# select 'abs(text)'::regprocedure; ERROR: function abs(text) does not exist decibel=#