Re: [GENERAL] quote in string

2008-05-22 Thread Alban Hertroys
On May 21, 2008, at 7:36 PM, finecur wrote: select * from my_flexible_sql_function('select * from employee where dep ='Eng'') You need to escape that string like 'select * from employee where dep =''Eng'' ' Alban Hertroys -- If you can't see the forest for the trees, cut the trees and

Re: [GENERAL] Fragments in tsearch2 headline

2008-05-22 Thread Sushant Sinha
Thanks Pierre for porting this! I just tested this for my application and it works. There was a small bug in that startHL has to be initialized to 0 for each chosen cover. I fixed that and attached the new patch. Teodor did not want a separate function. He wanted it as an extension to ts_headline.

Re: [GENERAL] Extracting \ Generate DDL for existing object permissions

2008-05-22 Thread Tino Wildenhain
Raymond O'Donnell wrote: On 22/05/2008 22:33, smiley2211 wrote: 1) dump database A - 2) Extract permissions from database B - (HOW) How about dumping B using the plain-text format, then running the output through grep, looking for lines starting with "GRANT..."? Hint: sometimes easier

Re: [GENERAL] Is this correct usage of generate_series?

2008-05-22 Thread Gurjeet Singh
On Thu, May 22, 2008 at 10:41 PM, Hiroaki Nakamura <[EMAIL PROTECTED]> wrote: > Hi, there. > > These three queries below works as I expect, which is wonderful, but are > these correct usages? > If these are intended features, I would like them to be documented at > http://www.postgresql.org/docs/8

Re: [GENERAL] Results of stored procedures in WHERE clause

2008-05-22 Thread Justin Pasher
> -Original Message- > From: [EMAIL PROTECTED] [mailto:pgsql-general- > [EMAIL PROTECTED] On Behalf Of Gordon > Sent: Tuesday, May 20, 2008 11:03 AM > To: pgsql-general@postgresql.org > Subject: [GENERAL] Results of stored procedures in WHERE clause > > I have a table representing tree str

Re: [GENERAL] Error: Could not open relation...

2008-05-22 Thread Joshua D. Drake
On Fri, 2008-05-23 at 00:08 +0100, Howard Cole wrote: > Can anyone give me a hint how to trace the cause of this error message > in the error log: > > ERROR could not open relation 1663/20146/128342: Permission Denied > > Running 8.2.7 on W2K3. > Looks like someone or something changed the p

[GENERAL] Error: Could not open relation...

2008-05-22 Thread Howard Cole
Can anyone give me a hint how to trace the cause of this error message in the error log: ERROR could not open relation 1663/20146/128342: Permission Denied Running 8.2.7 on W2K3. Thanks. Howard Cole. www.selestial.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To m

Re: [GENERAL] Results of stored procedures in WHERE clause

2008-05-22 Thread Adam Rich
> > I need to be able to do queries that restrict my result set to items > belonging to a specified site and ignore all nodes that belong to > different sites. To determine the ID of the site an item belongs to I > wrote a stored procedure: > > This returns the ID of the root node for non-root

Re: [GENERAL] quote in string

2008-05-22 Thread Scott Marlowe
On Wed, May 21, 2008 at 11:36 AM, finecur <[EMAIL PROTECTED]> wrote: > Hi, I have a function and it's interface is : > >my_flexible_sql_function(cmd) > > where cmd is another sql command. I call this function like this: > > select * from my_flexible_sql_function('select * from employee where >

[GENERAL] Results of stored procedures in WHERE clause

2008-05-22 Thread Gordon
I have a table representing tree structures of pages on a website. they have an itm_id column (integer key) and an itm_parent column (pointer to item's parent node). Any item with an itm_parent of 0 is a root node, representing a website. Anything with a non-zero parent is a non-root node represe

Re: [GENERAL] Results of stored procedures in WHERE clause

2008-05-22 Thread Gordon
On May 20, 5:02 pm, Gordon <[EMAIL PROTECTED]> wrote: > I have a table representing tree structures of pages on a website. > they have an itm_id column (integer key) and an itm_parent column > (pointer to item's parent node). Any item with an itm_parent of 0 is > a root node, representing a websit

Re: [GENERAL] tsearch2 on-demand dictionary loading & using functions in tsearch2

2008-05-22 Thread iSteve
Craig Ringer wrote: This is probably a stupid question, but: with PostgreSQL's use of shared memory, is it possible to load dictionaries into a small reserved shm area when the first backend starts, then use the preloaded copy in subsequent backends? That way the postmaster doesn't have to do an

[GENERAL] quote in string

2008-05-22 Thread finecur
Hi, I have a function and it's interface is : my_flexible_sql_function(cmd) where cmd is another sql command. I call this function like this: select * from my_flexible_sql_function('select * from employee where id < 100') Inside this functioin, I will first retrieve all data by calling 'se

[GENERAL] deadlock debug methodology

2008-05-22 Thread antiochus antiochus
Hi All, I have a deadlock situation, two transactions waiting on each other to complete. Based on the details below, does anyone have recommendations for me. Thanks. Regards, A. I am using: rpm -qa|grep postgres compat-postgresql-libs-4-2PGDG.rhel5_x86_64 postgresql-server-8.2.6-1PGDG.rhel5 po

[GENERAL] Is this correct usage of generate_series?

2008-05-22 Thread Hiroaki Nakamura
Hi, there. These three queries below works as I expect, which is wonderful, but are these correct usages? If these are intended features, I would like them to be documented at http://www.postgresql.org/docs/8.3/interactive/functions-srf.html => select generate_series(1, 3) as i; i --- 1 2 3 (

Re: [GENERAL] Extracting \ Generate DDL for existing object permissions

2008-05-22 Thread Raymond O'Donnell
On 22/05/2008 22:33, smiley2211 wrote: 1) dump database A - 2) Extract permissions from database B - (HOW) How about dumping B using the plain-text format, then running the output through grep, looking for lines starting with "GRANT..."? Ray. --

[GENERAL] Extracting \ Generate DDL for existing object permissions

2008-05-22 Thread smiley2211
Hello all, How do I capture the EXISTING permissions for a database? I know you can see them via \z or \dp however I need ALL permissions to be captured so I can reapply after performing a database restore. ex: 1) dump database A - 2) Extract permissions from database B - (HOW) 3) load d

Re: [GENERAL] deadlock debug methodology question

2008-05-22 Thread antiochus antiochus
On Thu, May 22, 2008 at 4:20 PM, Bill Moran <[EMAIL PROTECTED]> wrote: > > Please don't top-post. I've attempted to reconstruct the conversation > flow. > > In response to "antiochus antiochus" <[EMAIL PROTECTED]>: > > > > On Thu, May 22, 2008 at 2:57 PM, Bill Moran < > [EMAIL PROTECTED]> > > wro

Re: [GENERAL] deadlock debug methodology question

2008-05-22 Thread Bill Moran
Please don't top-post. I've attempted to reconstruct the conversation flow. In response to "antiochus antiochus" <[EMAIL PROTECTED]>: > > On Thu, May 22, 2008 at 2:57 PM, Bill Moran <[EMAIL PROTECTED]> > wrote: > > > In response to "antiochus antiochus" <[EMAIL PROTECTED]>: > > > > > > I have

Re: [GENERAL] intermittent problems with ident authentication

2008-05-22 Thread Ben
Anybody? On Tue, 20 May 2008, Ben wrote: I have some scripts that connect to my 8.2 postgres server using ident authentication, and maybe ~10% of the time, authentication fails like so: 2008-05-20 00:22:54 UTC LOG: invalidly formatted response from Ident server: "49205 , 5432 : ERROR :dba

Re: [GENERAL] deadlock debug methodology question

2008-05-22 Thread antiochus antiochus
Thanks for your responses, I appreciate the help. I gather from this that 2 transactions concurrently running the exact same: update table tt where ... could end up in deadlock because it is not garanteed row-level locks are taken in a consistent order in an update. One possibility might th

[GENERAL] XML Support related questions

2008-05-22 Thread Brijesh Shrivastav
Hello PostgreSQL XML Experts, I was exploring xml support in postgreSQL and ran into few questions answer to which I couldn't find easily in the documentation. I would appreciate responses to following queries: 1) Can xml column be constrained to be DOCUMENT or CONTENT type? XMLPARSE/

Re: [GENERAL] deadlock debug methodology question

2008-05-22 Thread Bill Moran
In response to "antiochus antiochus" <[EMAIL PROTECTED]>: > > I have a deadlock situation, two transactions waiting on each other to > complete. Based on the details below, would anyone have recommendations for > me, please? I have a theory on deadlocks, and that theory is that it's damn near imp

Re: [GENERAL] Short-circuiting FK check for a newly-added field

2008-05-22 Thread Reece Hart
On Tue, May 20, 2008 at 02:25:15PM -0400, Decibel! wrote: > I need to add a field to a fairly large table. In the same alter statement > I'd like to add a FK constraint on that new field. Is there any way to > avoid the check of the table that the database is doing right now? The > check is poin

[GENERAL] Is this correct usage of generate_series?

2008-05-22 Thread Hiroaki Nakamura
Hi, there. These three queries below works as I expect, which is wonderful, but are these correct usages? If these are intended features, I would like them to be documented at http://www.postgresql.org/docs/8.3/interactive/functions-srf.html => select generate_series(1, 3) as i; i --- 1 2 3 (

Re: [GENERAL] Finding records that are not there

2008-05-22 Thread Roberts, Jon
You have commcost in the correlated subquery which shouldn't be there. Here are three ways to achieve the results you want: select commcost.maplot, commcost.unitno from commcost where not exists(select null from bldg where commcost.maplot = bldg.

Re: [GENERAL] Finding records that are not there

2008-05-22 Thread Adam Rich
> I have two tables that have identical index fields, maplot and > unitno, (both indexes span two columns) and I want to find all the > records in the commcost table that don't have a corresponding record > in the bldg file. > > The SQL I've tried is: > > select commcost.maplot, commcost.unitno

Re: [GENERAL] Finding records that are not there

2008-05-22 Thread Owen Hartnett
At 6:47 PM +0200 5/22/08, hubert depesz lubaczewski wrote: On Thu, May 22, 2008 at 12:21:35PM -0400, Owen Hartnett wrote: The SQL I've tried is: select commcost.maplot, commcost.unitno from commcost where not exists(select 1 from commcost, bldg where commcost.maplot = bldg.maplot and commco

Re: [GENERAL] Finding records that are not there

2008-05-22 Thread hubert depesz lubaczewski
On Thu, May 22, 2008 at 12:21:35PM -0400, Owen Hartnett wrote: > The SQL I've tried is: > select commcost.maplot, commcost.unitno from commcost > where not exists(select 1 from commcost, bldg > where commcost.maplot = bldg.maplot and > commcost.unitno = bldg.unitno) > order by commcost.maplot chan

[GENERAL] Finding records that are not there

2008-05-22 Thread Owen Hartnett
Hi: This is gotta be elementary SQL 101, but I'm having a mental block as to why this doesn't work. I have two tables that have identical index fields, maplot and unitno, (both indexes span two columns) and I want to find all the records in the commcost table that don't have a corresponding

Re: [GENERAL] Installed pgadmin3-1.4.3 with 8.3.1 database..errors

2008-05-22 Thread Steve Atkins
On May 22, 2008, at 6:38 AM, Barbara Stephenson wrote: Hello, We have recently upgraded from 7.4.19 to 8.3.1. I am running Red Hat Enterprise Linux WS release 4 (Nahant Update 6) on my laptop and I finally was able to install pgadmin3-1.4.3. However, when I expand my databases, I get tw

[GENERAL] deadlock debug methodology question

2008-05-22 Thread antiochus antiochus
Hi All, I have a deadlock situation, two transactions waiting on each other to complete. Based on the details below, would anyone have recommendations for me, please? Regards, A. I am using: rpm -qa|grep postgres compat-postgresql-libs-4-2PGDG.rhel5_x86_64 postgresql-server-8.2.6-1PGDG.rhel5 p

[GENERAL] Installed pgadmin3-1.4.3 with 8.3.1 database..errors

2008-05-22 Thread Barbara Stephenson
Hello, We have recently upgraded from 7.4.19 to 8.3.1.  I am running Red Hat Enterprise Linux WS release 4 (Nahant Update 6) on my laptop and I finally was able to install pgadmin3-1.4.3.  However, when I expand my databases, I get two popups.  Does anyone know what that means? FIRST POPUP: A

Re: [GENERAL] Fragments in tsearch2 headline

2008-05-22 Thread Pierre-Yves Strub
Hi, I've ported the patch of Sushant Sinha for fragmented headlines to pg8.3.1 (http://archives.postgresql.org/pgsql-general/2007-11/msg00508.php) W.r.t, http://archives.postgresql.org/pgsql-general/2008-03/msg00806.php I can continue the work until this becomes an acceptable patch for pg. Pierr

[GENERAL] Index cleanup

2008-05-22 Thread Clemens Schwaighofer
Hi, recently I went through some dev dbs just to clean up some unused tables. What I found out afterwards is that even if you run a vacuum full analyze it doesn't removed the index data. So I was left with table size of a view bytes and gigabyte large indexes. Of course a re-index cleaned that u