[GENERAL] Problem on installing postgresql-devel

2007-03-22 Thread Stephen Liu
Hi folks, CentOS 4.4 x86_84 On installing postgresql-devel; $ sudo yum install postgresql-devel Setting up Install Process Setting up repositories Reading repository metadata in from local files Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected

Re: [GENERAL] foreign key constraints with inhertiance, hack suggestions?

2007-03-22 Thread Alban Hertroys
George Nychis wrote: > Basically I have a master 'flows' table which is partitioned and has > non-overlapping CHECK constraints on each partition. Each record in the > partitions have a unique pair of attributes: interval, flow_id > > When inserting in to another table 'flow_labels', these two a

Re: [GENERAL] questions about query design

2007-03-22 Thread Alban Hertroys
Ottavio Campana wrote: > Here's an example of what I'm doing: I have a table like > > create table ( > id serial, > description text not null, > active boolean default true); > > What I want to do is a function inserting a new item into the table > ensuring that there is only one record in

Re: [GENERAL] Problem on installing postgresql-devel

2007-03-22 Thread Devrim GÜNDÜZ
Hi, On Thu, 2007-03-22 at 15:56 +0800, Stephen Liu wrote: > Please advise how to fix the problem. You should either complain to CentOS guys, or use PGDG RPMs... Regards, -- Devrim GÜNDÜZ PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated

[GENERAL] Dealing with table names in functions

2007-03-22 Thread Jim Nasby
Is there a safe way to deal with tables being passed into a function, specifically in terms of what schema they're in? I can just blindly accept a text string and hope that it's always evaluated in the correct search_path context, but that doesn't seem so good. OTOH, if I accept an OID, the

Re: [GENERAL] Configuring phpPgAdmin and pg_ctl reload

2007-03-22 Thread John Meyer
Ashish Karalkar wrote: Try pg_ctl -D /path to pg data home e.g. pg_ctl -D /usr/local/pgsql/data Hope this will help - Original Message - From: "John Meyer" <[EMAIL PROTECTED]> To: "postgresql-general" Sent: Thursday, March 22, 2007 8:31 AM Subject: [GENERAL] Configuring phpPgAdmin

Re: [GENERAL] Postgres Hot Standby. How or when does the recovery db move recovery.conf to recovery.done?

2007-03-22 Thread Merlin Moncure
On 3/21/07, Dhaval Shah <[EMAIL PROTECTED]> wrote: From one of Tom's reply to a different poster, I found that one can run pg_resetxlog. http://www.postgresql.org/docs/8.2/static/app-pgresetxlog.html, to make the db recover and startup. Appears not for the faint hearted! Dhaval On 3/21/07, Dh

Re: [GENERAL] Dealing with table names in functions

2007-03-22 Thread Merlin Moncure
On 3/22/07, Jim Nasby <[EMAIL PROTECTED]> wrote: Is there a safe way to deal with tables being passed into a function, specifically in terms of what schema they're in? I can just blindly accept a text string and hope that it's always evaluated in the correct search_path context, but that doesn't

Re: [GENERAL] Dealing with table names in functions

2007-03-22 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > Is there a safe way to deal with tables being passed into a function, > specifically in terms of what schema they're in? Pass in the schema and tablename together as a string: select foobar('public.baz'); or (better, IMO) make it two sepa

[GENERAL] xpath_list() function

2007-03-22 Thread Andy Dale
Hi, I have installed xml2 contrib to my postgreSQL 8.1.4 install. The functionality it offer when working with xml files is really good, but i currently experiencing a few issues with the xpath_list function and a simple test. I took a simple xml file (the one described in the PostgreSQL book b

Re: [GENERAL] Dealing with table names in functions

2007-03-22 Thread Alvaro Herrera
Jim Nasby wrote: > Is there a safe way to deal with tables being passed into a function, > specifically in terms of what schema they're in? I can just blindly > accept a text string and hope that it's always evaluated in the > correct search_path context, but that doesn't seem so good. OTOH,

Re: [GENERAL] to_tsvector in 8.2.3

2007-03-22 Thread Magnus Hagander
On Wed, Mar 21, 2007 at 09:13:55PM +0300, Teodor Sigaev wrote: > >postgres=# select to_tsvector('test text'); > > to_tsvector > >--- > > 'test text':1 > >(1 row) > Ok. that's related to > http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/tsearch2/wordparser/parser.c.diff?r1=1.1

[GENERAL] using 'ALTER ROLE' in a function

2007-03-22 Thread Lutz Broedel
Dear list, I'm trying to write a PL/pgSQL function that executes some code every time a user changes his/her password. The function is supposed to work like this: CREATE OR REPLACE FUNCTION changePwd(varchar(255)) RETURNS boolean AS $$ DECLARE pwd varchar(255); curr_user name;

[GENERAL] Deadlock with REINDEX TABLE

2007-03-22 Thread Erik Jones
Hi, I'm hoping some one can help me figure out how I ended up with a deadlock while running my reindex script last night. It basically partitions our table set and goes through each group of tables in parallel running REINDEX TABLE on each table in that group with each group having its own

Re: [GENERAL] Insert fail: could not open relation with OID 3221204992

2007-03-22 Thread Tom Lane
[EMAIL PROTECTED] writes: > Here is the schema info: > ... > shape| st_geometry | > st_geometry is our own implementation for geometry type. To be blunt, I'd suggest looking there first. Can you duplicate the failure when loading into a table with no custom datatype?

Re: [GENERAL] xpath_list() function

2007-03-22 Thread George Weaver
Original Message From Andy Dale Hi, testdb=# SELECT film_name, xpath_list(description, 'year') FROM filminfo; film_name | xpath_list --- + Casablanca | 1942 Rear Window | 1954 The Godfather | 1972 Test film | 1973,1972 It would seem reasonable i

Re: [GENERAL] questions about query design

2007-03-22 Thread Tom Lane
Alban Hertroys <[EMAIL PROTECTED]> writes: > Ottavio Campana wrote: >> What I want to do is a function inserting a new item into the table >> ensuring that there is only one record in the table having a particular >> description and at the same time the active field set to true (it might >> seem st

Re: [GENERAL] Dealing with table names in functions

2007-03-22 Thread Tom Lane
Jim Nasby <[EMAIL PROTECTED]> writes: > ... I can cast the OID to regclass, but that > doesn't get me a fully-qualified name. It does if the name needs to be qualified given your current search_path. regards, tom lane ---(end of broadcast)---

Re: [GENERAL] Configuring phpPgAdmin and pg_ctl reload

2007-03-22 Thread Douglas McNaught
John Meyer <[EMAIL PROTECTED]> writes: > Maybe it was just understood, but I was typing in word for word the > entry from pg_hba.conf, but I'll keep that for reference later on. pg_ctl needs either the data directory supplied on the command line, or PGDATA set in the environment, which reading th

Re: [GENERAL] Bug in CREATE/DROP TABLESPACE command

2007-03-22 Thread William Garrison
Postgres 8.2.3 on Windows Server 2003. I looked into this more, and I narrowed the bug down. It only happens if you issue a DROP TABLESPACE command and a CREATE TABLESPACE command in one batch, where the CREATE TABLESPACE command points to an invalid location. I didn't realize how obscure an

Re: [GENERAL] using 'ALTER ROLE' in a function

2007-03-22 Thread Douglas McNaught
Lutz Broedel <[EMAIL PROTECTED]> writes: > ERROR: Error »syntax error« at »$1« at character 13 > QUERY: ALTER ROLE $1 WITH ENCRYPTED PASSWORD $2 > > I have tried this in several ways and it seems, ALTER ROLE just does > not accept a parameter instead of name. Does anybody have a solution > fo

Re: [GENERAL] xpath_list() function

2007-03-22 Thread Andy Dale
Hi, Unfortunately the suggestion by Geogre did not work, but i solved it like so: SELECT film_name FROM filminfo WHERE '1973' = ANY (STRING_TO_ARRAY((xpath_list(description, 'year')),',')) Thanks, Andy On 22/03/07, George Weaver <[EMAIL PROTECTED]> wrote: Original Message From Andy Dale

[GENERAL] Server

2007-03-22 Thread Bob Pawley
I've been using the PostgreSQL server without really understanding how it works or how it is structured. Could someone point me to a 'simple' description??? Bob Pawley

Re: [GENERAL] to_tsvector in 8.2.3

2007-03-22 Thread Teodor Sigaev
Solved, see attached patch. I had found old Celeron-300 box and install Windows on it, and it was very slow :) Nope, same result with this patch. Thank you. -- Teodor Sigaev E-mail: [EMAIL PROTECTED] WWW: ht

Re: [GENERAL] Server

2007-03-22 Thread Richard Broersma Jr
> I've been using the PostgreSQL server without really understanding how it > works or how it is > structured. > > Could someone point me to a 'simple' description??? http://www.postgresql.org/about/ Regards, Richard Broersma Jr. ---(end of broadcast)--

Re: [GENERAL] Dealing with table names in functions

2007-03-22 Thread Reece Hart
On Thu, 2007-03-22 at 09:40 -0400, Alvaro Herrera wrote: > Pass the optionally qualified name and cast it to regclass. It will > work correctly when the name is not qualified, applying search_path, > and it will also work when the name is qualified. Is there a way to get names that are always qu

Re: [GENERAL] Bug in CREATE/DROP TABLESPACE command

2007-03-22 Thread Tom Lane
William Garrison <[EMAIL PROTECTED]> writes: > -- Drop the tablespace and re-create in in an invalid location > -- This only causes the bug if both these commands are run in one batch What do you mean by "one batch" exactly? Both CREATE and DROP TABLESPACE refuse to run in a transaction block, so

Re: [GENERAL] Bug in CREATE/DROP TABLESPACE command

2007-03-22 Thread William Garrison
Not a transaction block. A batch of commands submitted to the server in a single call. In MSSQL land, I call that a batch. I don't know the PostgreSql term. If you are using the pgadmin3 GUI, then I mean pressing F5 once is a single batch. Pressing it twice is two batches. The following wi

Re: [GENERAL] Deadlock with REINDEX TABLE

2007-03-22 Thread Tom Lane
Erik Jones <[EMAIL PROTECTED]> writes: > Mar 21 19:36:18 [info] User Info: REINDEX TABLE > emma_messages_email_queue; [nativecode=ERROR: deadlock detected > DETAIL: Process 12912 waits for AccessExclusiveLock on relation > 138763808 of database 16384; blocked by process 15217. > Process 1521

Re: [GENERAL] Insert fail: could not open relation with OID 3221204992

2007-03-22 Thread Tom Lane
"Ale Raza" <[EMAIL PROTECTED]> writes: > No problem without shape column. I can load all data. What I thought :-( > My concern is: > - Why it's an issue on Linux not on windows? In both cases it's a window > client. Platform-dependent bug in your code, likely. Without seeing the code it's imp

Re: [GENERAL] multi terabyte fulltext searching

2007-03-22 Thread Arturo Perez
On Wed, 21 Mar 2007 08:57:39 -0700, Benjamin Arai wrote: > Hi Oleg, > > I am currently using GIST indexes because I receive about 10GB of new data > a week (then again I am not deleting any information). The do not expect > to be able to stop receiving text for about 5 years, so the data is not

Re: [GENERAL] xpath_list() function

2007-03-22 Thread Arturo Perez
On Thu, 22 Mar 2007 14:36:32 +0100, Andy Dale wrote: > > testdb=# SELECT film_name, xpath_list(description, 'year') FROM filminfo; > film_name | xpath_list > --- + > Casablanca | 1942 > Rear Window | 1954 > The Godfather | 1972 > Test film | 1973,1972

Re: [GENERAL] Bug in CREATE/DROP TABLESPACE command

2007-03-22 Thread Tom Lane
William Garrison <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> What do you mean by "one batch" exactly? Both CREATE and DROP TABLESPACE >> refuse to run in a transaction block, so I'm confused about this. > Not a transaction block. A batch of commands submitted to the server in > a single ca

Re: [GENERAL] Deadlock with REINDEX TABLE

2007-03-22 Thread Erik Jones
On Mar 22, 2007, at 1:01 PM, Tom Lane wrote: Erik Jones <[EMAIL PROTECTED]> writes: Mar 21 19:36:18 [info] User Info: REINDEX TABLE emma_messages_email_queue; [nativecode=ERROR: deadlock detected DETAIL: Process 12912 waits for AccessExclusiveLock on relation 138763808 of database 16384; blo

[GENERAL] making postgres DB stable, efficient and secure

2007-03-22 Thread Jasbinder Singh Bali
Hi, I'm done with my database design and almost got it working (with all triggers and functions) pefectly. Now, i need to see how can I make my DB stable, efficient and secure. I wanted to know how should I go about it as far as postgres is concerned What are the best practices is this regard. A

Re: [GENERAL] making postgres DB stable, efficient and secure

2007-03-22 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/22/07 15:59, Jasbinder Singh Bali wrote: > Hi, > I'm done with my database design and almost got it working (with all > triggers and functions) pefectly. > Now, i need to see how can I make my DB stable, efficient and secure. Your database is no

Re: [GENERAL] making postgres DB stable, efficient and secure

2007-03-22 Thread Jeff Davis
On Thu, 2007-03-22 at 16:59 -0400, Jasbinder Singh Bali wrote: > Hi, > I'm done with my database design and almost got it working (with all > triggers and functions) pefectly. > Now, i need to see how can I make my DB stable, efficient and secure. > > I wanted to know how should I go about it as f

Re: [GENERAL] multi-row check constraints?

2007-03-22 Thread Jeff Davis
On Tue, 2007-03-20 at 13:21 -0700, Angva wrote: > Dear Postgres fans, > > Hi, I was wondering what is the best way to achieve a multi-row check > constraint. For example, you have a table with two columns: ID and > percent, no primary key. The goal is to enforce that all values of > percent, per I

Re: [GENERAL] multi-row check constraints?

2007-03-22 Thread Martin Gainty
Greetings Select COLUMN FROM TABLE WHERE (some condition) for UPDATE OF COLUMN is not supported? what would happen in a Table Deadlock scenario??? M- --- This e-mail message (including attachments, if any) is intended for t

Re: [GENERAL] Configuring phpPgAdmin and pg_ctl reload

2007-03-22 Thread John Meyer
Douglas McNaught wrote: John Meyer <[EMAIL PROTECTED]> writes: Maybe it was just understood, but I was typing in word for word the entry from pg_hba.conf, but I'll keep that for reference later on. pg_ctl needs either the data directory supplied on the command line, or PGDATA set in the envir

Re: [GENERAL] multi-row check constraints?

2007-03-22 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > Hi, I was wondering what is the best way to achieve a multi-row check > constraint. For example, you have a table with two columns: ID and > percent, no primary key. The goal is to enforce that all values of > percent, per ID, add up to exactl

[GENERAL] VACUUM ANALYZE

2007-03-22 Thread Robert James
I see in all the docs to run VACUUM ANALYZE periodically. My host told me that in Postgres 8.2 this is not needed as it is done automatically. Is that true? How can I see the results of the automatic vacuum analyze? Or configure them?

Re: [GENERAL] VACUUM ANALYZE

2007-03-22 Thread Tom Lane
"Robert James" <[EMAIL PROTECTED]> writes: > I see in all the docs to run VACUUM ANALYZE periodically. My host told me > that in Postgres 8.2 this is not needed as it is done automatically. 8.2 has an autovacuum feature but it is *not* turned on by default ... has your host enabled it? > Is that

[GENERAL] How to get the DML Commands exceuted from functions

2007-03-22 Thread Anoo Pillai
Hi All, There are a few plpgsql functions in our application, When the functions are called, I would like to see the commands executed from the functions ( the selects, inserts, updates and Deletes written in the function body) I am from SQL server world and there exists a tool SQL Profiler for

Re: [GENERAL] [ADMIN] How to get the DML Commands exceuted from functions

2007-03-22 Thread Karthikeyan Sundaram
CREATE OR REPLACE FUNCTION xyz() returns int4 as $body$ DECLARE BEGIN IF (TG_OP = 'DELETE') THEN n_id = OLD.campaign_id; EXECUTE 'DELETE FROM cn_mapping WHERE campaign_id = '||quote_literal(n_id); RETURN 0; END IF; END; $body$ LANGUAGE 'plpgsql' VOLATILE;