Re: [GENERAL] edit function

2009-09-06 Thread Guillaume Lelarge
Le lundi 7 septembre 2009 à 08:26:27, Rakotomandimby Mihamina a écrit : > [...] > I have to insert several IF statements in the "IF FOUND" one. > I wont do it one time, I will insert them one by one. > > I cannot stop too much long the PG server (a /etc/init.d restart time > is OK, more is not) > >

[GENERAL] edit function

2009-09-06 Thread Rakotomandimby Mihamina
Hi all, On a PostGreSQL 8.1 (Debian Etch) I have a function like this: CREATE FUNCTION f_active_client(character varying) RETURNS character varying AS $_$ DECLARE v_modem ALIAS FOR $1; v_firstuse BOOLEAN; v_admactive BOOLEAN; v_codeclt varchar; BEGIN SELECT INTO (...)

Re: [GENERAL] tsvector Column Indexing Across Two Tables

2009-09-06 Thread APseudoUtopia
On Sun, Sep 6, 2009 at 9:57 PM, APseudoUtopia wrote: > Hey list, > > I have a forum. I'm in the process of adding a full-text search. The > forum is split into a couple tables, including forums_posts and > forums_topics. The latter contains only the title of the topic and > some other information,

[GENERAL] tsvector Column Indexing Across Two Tables

2009-09-06 Thread APseudoUtopia
Hey list, I have a forum. I'm in the process of adding a full-text search. The forum is split into a couple tables, including forums_posts and forums_topics. The latter contains only the title of the topic and some other information, like an ID number. The forums_posts table contains the body of t

Re: [GENERAL] More Snow Leopard problems...

2009-09-06 Thread Tom Lane
Jerry LeVan writes: > I have compiled a 32 bit ( CC="gcc -arch i386" ) version of > PG 8.4.0. Since that's not the default on SL, have you tried 64 bit? > could not lookup DNS configuration info service: (ipc/send) invalid > destination port > LOG: could not resolve "localhost": nodename nor

Re: [GENERAL] getting all groups where a user belongs to

2009-09-06 Thread Tom Lane
=?iso-8859-2?Q?Keresztury_Bal=E1zs?= writes: > For example: there is a Service user, called Joe, who belongs to the group > called SER. There is an other one, Kim, who's an administrator (ADM), which > inherits rights from both SER and CEO. My problem is that I need a query, > which returns _all_

Re: [GENERAL] getting all groups where a user belongs to

2009-09-06 Thread Johan Nel
Hi Balázs, Depending the PG Version (pre 8.4) have a look at connectby() in tablefunc. SELECT * FROM connectby('connectby_tree', 'keyid', 'parent_keyid', 'pos', 'row2', 0, '~') AS t(keyid text, parent_keyid text, level int, branch text, pos int); keyid | parent_keyid | level | branch

[GENERAL] getting all groups where a user belongs to

2009-09-06 Thread Keresztury Balázs
hi, I'm currently developing a business software, and I faced a problem just a few days ago. My users are currently using their own credentials for logging in to PostgreSQL server (this makes auditing, logging a lot easier). There are several groups, and the groups can inherit their parents' righ

Re: [GENERAL] PG connections going to 'waiting'

2009-09-06 Thread Joshua Tolley
On Sat, Sep 05, 2009 at 07:41:42PM -0400, Chris Barnes wrote: >Is the any way to look at the statistics on the name of table, length and >type over a period of time? Only if you've captured them. Various system information views provide those statistics (or the server's best guesses about

Re: [GENERAL] How do I store tables on a remote host?

2009-09-06 Thread Sergey Samokhin
Hello. > The better way is probably to look up pl/proxy and use that. Thanks, I will try it! I wrote the original mesage because remote file systems aren't what seems to be fast enough when it comes to forward queries... For those looking for the same thing, here are links to PL/Proxy I've found

[GENERAL] Truncating table doesn't bring back (ALL?) used space?

2009-09-06 Thread Ow Mun Heng
I've got a largeish table which according to pg_size_pretty, has an on-disk size of ~22GB Table size and 12GB index size, approx 55million rows. When I truncate the table, (I've moved the data somewhere else), I see that I only gain back ~7GB in the Filesystem space. What gives? -- Sent via p

[GENERAL] tsearch synonym dictionary problem

2009-09-06 Thread Richard Greenwood
I have a tsearch query that does not returns results and I can not see why. The actual data is: 7695 s hwy 89 And in my synonym dictionary I have: south s highway hwy So I am expecting to get a row from the query criteria: 7695 South Highway 89 But I don't. I do get the row with any o

Re: [GENERAL] pg_ctl with unix domain socket?

2009-09-06 Thread Tom Lane
Josef Wolf writes: > On Fri, Sep 04, 2009 at 01:33:06PM -0400, Tom Lane wrote: >> In general I'd advise against using -k, as that will break nearly all >> clients not only pg_ctl. > Ugh, but how to configure it at runtime, then? You don't. You could configure it at build time, perhaps, same as

[GENERAL] More Snow Leopard problems...

2009-09-06 Thread Jerry LeVan
I have compiled a 32 bit ( CC="gcc -arch i386" ) version of PG 8.4.0. I am finding the following in the pg logfile when I stop then start the postgresql server. LOG: received smart shutdown request LOG: shutting down LOG: database system is shut down could not lookup DNS configuration info se

Re: [GENERAL] pg_ctl with unix domain socket?

2009-09-06 Thread Josef Wolf
On Fri, Sep 04, 2009 at 01:33:06PM -0400, Tom Lane wrote: > Josef Wolf writes: > >> pg_ctl -Ddb -o "-h '' -k `pwd`/db" -l postgreslog start > > > This works, but when I add the -w option, it waits all the 60 seconds. > > I don't believe pg_ctl is smart enough to dredge the -k option out of -o >