Re: [GENERAL] Sorting when "*" is the initial character

2005-02-07 Thread CoL
hi, Berend Tober wrote, On 2/7/2005 22:20: I encountered what looks like unusually sorting behavior, and I'm wondering if anyone can tell me if this is supposted to happen (and then if so, why) or if this is a bug: CREATE TABLE sample_table ( account_id varchar(4), account_name varchar(25) ) WI

Re: [GENERAL] modifying views

2005-02-07 Thread Sim Zacks
Thank you Mike, that should save me tons of time. I was dreading trying to find all the dependencies, every time I want to make a change. This way isn't perfect, but if it will do the job, that's what I need. "Mike Rylander" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 2

[GENERAL] Can't build libpq test example

2005-02-07 Thread Jim Morcombe
Can anyone help me with this problem? I have installed postgresql-7.2.1 and am trying to compile one of the test programs from the directory src/test/examples. I am running an old version of SCO Openserver 5 I am using the following command: cc testlibpq.c -I/usr/local/pgsql/include -L/usr/local

[GENERAL] External Projects in the PostgreSQL release

2005-02-07 Thread Noah Friedland
Hi! I was wondering if any external projects get bundled into the Postgres release, e.g. JDBC, etc. I'd like to get a better sense of the process. How are decisions made as to which external projects to bundle, and who is responsible for the quality/interoperability of those projects with the core

Re: [GENERAL] Help with sorting (ie. ORDER BY expression)

2005-02-07 Thread Jonel Rienton
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, This can be easily done with pl/pgsql, visit the documentation at http://www.postgresql.org/docs/7.3/interactive/programmer-pl.html OT: seems like this is a questionnaire/survey application, yes? - - Jonel Rienton http://blogs.road14.com

[GENERAL] C++ Builder prob.

2005-02-07 Thread Teddy
When I try to run something with PostrgreSQL (libpq) in Borland C++ Builder, it does not run and write errors like "[Linker Error] Unresolved external '_PQconnectdb' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ". Does anybody know how to fix it? Thanks

Re: [GENERAL] a SELECT FOR UPDATE question

2005-02-07 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > On Tue, Feb 08, 2005 at 12:58:34AM -0500, Tom Lane wrote: >> I'm too tired to work out an example, but I think this probably doesn't >> work in general: the xmax on the version of the row you can see might >> not correspond to a live transaction, but that

Re: [GENERAL] a SELECT FOR UPDATE question

2005-02-07 Thread Michael Fuhr
On Tue, Feb 08, 2005 at 12:58:34AM -0500, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > > > I think you can infer that a process is working with a row in some > > manner (UPDATE, SELECT FOR UPDATE) by looking at the row's xmax > > column and checking pg_locks to see if any process

Re: [GENERAL] Problem performing a restore of a data schema in Wi

2005-02-07 Thread Shaun Clements
Title: RE: [GENERAL] Problem performing a restore of a data schema in Windows Hi John Thanks for the suggestion. It worked perfectly. Thanks Kind Regards, Shaun Clements -Original Message- From: John DeSoi [mailto:[EMAIL PROTECTED]] Sent: 07 February 2005 04:21 PM To: Shaun Cl

Re: [GENERAL] a SELECT FOR UPDATE question

2005-02-07 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > On Mon, Feb 07, 2005 at 03:08:12PM -0800, Tim Vadnais wrote: >> If I select a row for update, is there anyway that someone can query to see >> if that row has been 'selected for update' and by whom? > I think you can infer that a process is working with

Re: [GENERAL] Creating an index-type for LIKE '%value%'

2005-02-07 Thread Oleg Bartunov
On Mon, 7 Feb 2005, Larry Rosenman wrote: Oleg Bartunov wrote: Read http://www.sai.msu.su/~megera/postgres/gist/pg_trgm/README.pg_trgm Oleg On Mon, 7 Feb 2005, Martijn van Oosterhout wrote: Would you have a suggestion to index the following query: SELECT domain,message,'1' as truth FROM bla

Re: [GENERAL] PHP/PDO Database Abstraction Layer

2005-02-07 Thread Joshua D. Drake
Robby Russell wrote: Sincerely, Joshua D. Drake Command Prompt, Inc. 503-667-4564 It hasn't been updated since May 2004 though. :-/ Hmm... Well there must be another home for it then because it is set to be the default database api for 5.1. Ahh now I see it is already been pushed into the PHP

Re: [GENERAL] PHP/PDO Database Abstraction Layer

2005-02-07 Thread Robby Russell
On Mon, 2005-02-07 at 14:02 -0800, Joshua D. Drake wrote: > Hello, > > Has anyone seen the following: > > http://pecl.php.net/package/PDO > > The description from the site: > > PDO provides a uniform data access interface, sporting advanced features > such as prepared statements and bound para

Re: [GENERAL] Creating an index-type for LIKE '%value%'

2005-02-07 Thread Larry Rosenman
On Mon, 7 Feb 2005, Steve Atkins wrote: A functional btree index on reverse(domain) might get you what you're looking for. [snip] I wound up doing the following: -- -- Name: reverse(text); Type: FUNCTION; Schema: public; Owner: ler -- CREATE FUNCTION reverse(text) RETURNS text AS $_$ DECLARE or

Re: [GENERAL] a SELECT FOR UPDATE question

2005-02-07 Thread Michael Fuhr
On Mon, Feb 07, 2005 at 03:08:12PM -0800, Tim Vadnais wrote: > > If I select a row for update, is there anyway that someone can query to see > if that row has been 'selected for update' and by whom? I think you can infer that a process is working with a row in some manner (UPDATE, SELECT FOR UPD

Re: [GENERAL] Creating an index-type for LIKE '%value%'

2005-02-07 Thread Steve Atkins
On Mon, Feb 07, 2005 at 03:16:51PM -0600, Larry Rosenman wrote: > SELECT domain,message,'1' as truth FROM blacklist > WHERE somedomain ~* '(?:.+\.|)' || domain || '\$') > > The somedomain is actually a constant passed in from Exim (it's the sender's > righthand > Side of an E-Mail address). > >

Re: [GENERAL] Sorting when "*" is the initial character

2005-02-07 Thread Stephan Szabo
On Mon, 7 Feb 2005, Berend Tober wrote: > I encountered what looks like unusually sorting behavior, and I'm wondering if > anyone can tell me if this is supposted to happen (and then if so, why) or if > this is a bug: If you ran initdb with a locale such as en_US, a result like what you got is ex

[GENERAL] [SECURITY] New sets of PostgreSQL RPMS are available for download

2005-02-07 Thread Devrim GUNDUZ
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - - PostgreSQL RPM Set Update 2005-02-08 Version(s): 8.0.1, 7.4.7, 7.3.9, 7.2.7 - - - ---

[GENERAL] a SELECT FOR UPDATE question

2005-02-07 Thread Tim Vadnais
Title: a SELECT FOR UPDATE question Hi, If I select a row for update, is there anyway that someone can query to see if that row has been 'selected for update' and by whom? Then I'd like to know if the session that 'SELECT(ed) FOR UPDATE' dies, will the server release the locked row? Than

Re: [GENERAL] Use of indexes with table inheritance

2005-02-07 Thread Christopher Petrilli
On Mon, 7 Feb 2005 19:34:52 -0300, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Any reason you don't use a single table? Also, please post the EXPLAIN > ANALYZE of your query. My main reason was experimental evidence showed a massive drop in performance with 6 indexes (the number needed from a que

Re: [GENERAL] Use of indexes with table inheritance

2005-02-07 Thread Alvaro Herrera
On Mon, Feb 07, 2005 at 01:59:16PM -0500, Christopher Petrilli wrote: > I have a "master table" called events, and 10 subtables which are > created using this: > > CREATE TABLE events001 ( ) INHERITS (events) WITHOUT OIDS; > > I then build all the indexes on it, including a column called "src

Re: [GENERAL] Out of memory error

2005-02-07 Thread Clodoaldo Pinto
On Mon, 07 Feb 2005 13:51:46 -0800, Joshua D. Drake <[EMAIL PROTECTED]> wrote: > Well your first email didn't explain that you were doing the below :) In the first email I was not doing the insert. I was executing a psql script: $ psql -e -f groupdup.psql ks2 This was the groupdup.psql script:

[GENERAL] PHP/PDO Database Abstraction Layer

2005-02-07 Thread Joshua D. Drake
Hello, Has anyone seen the following: http://pecl.php.net/package/PDO The description from the site: PDO provides a uniform data access interface, sporting advanced features such as prepared statements and bound parameters. PDO drivers are dynamically loadable and may be developed independently f

Re: [GENERAL] Sorting when "*" is the initial character

2005-02-07 Thread Bruno Wolff III
On Mon, Feb 07, 2005 at 16:20:36 -0500, Berend Tober <[EMAIL PROTECTED]> wrote: > > SELECT * FROM sample_table ORDER BY 1; > > account_id,account_name > 100,First account > 110,Second account > *115,Fifth account > 120,Third account > *125,Fourth account > > I would expect to see > > account_

Re: [GENERAL] Out of memory error

2005-02-07 Thread Joshua D. Drake
Clodoaldo Pinto wrote: On Mon, 07 Feb 2005 09:32:47 -0800, Joshua D. Drake <[EMAIL PROTECTED]> wrote: Any advice on how to avoid it? Use a cursor. Same thing using a cursor: Well your first email didn't explain that you were doing the below :) The cursor will help you with large data pulls from a

Re: [GENERAL] Out of memory error

2005-02-07 Thread Clodoaldo Pinto
On Mon, 07 Feb 2005 09:32:47 -0800, Joshua D. Drake <[EMAIL PROTECTED]> wrote: > > > > > Any advice on how to avoid it? > > Use a cursor. > Same thing using a cursor: declare rdata record; begin truncate table usuarios2; for rdata in select distinct on (data) data from usuarios loop ins

Re: [GENERAL] Creating an index-type for LIKE '%value%'

2005-02-07 Thread Martijn van Oosterhout
On Mon, Feb 07, 2005 at 03:16:51PM -0600, Larry Rosenman wrote: > Oleg Bartunov wrote: > > Read > > http://www.sai.msu.su/~megera/postgres/gist/pg_trgm/README.pg_trgm > > > > Oleg > > On Mon, 7 Feb 2005, Martijn van Oosterhout wrote: > Would you have a suggestion to index the following query:

[GENERAL] Sorting when "*" is the initial character

2005-02-07 Thread Berend Tober
I encountered what looks like unusually sorting behavior, and I'm wondering if anyone can tell me if this is supposted to happen (and then if so, why) or if this is a bug: CREATE TABLE sample_table ( account_id varchar(4), account_name varchar(25) ) WITHOUT OIDS; INSERT INTO sample_table VALU

Re: [GENERAL] Creating an index-type for LIKE '%value%'

2005-02-07 Thread Larry Rosenman
Oleg Bartunov wrote: > Read > http://www.sai.msu.su/~megera/postgres/gist/pg_trgm/README.pg_trgm > > Oleg > On Mon, 7 Feb 2005, Martijn van Oosterhout wrote: Would you have a suggestion to index the following query: SELECT domain,message,'1' as truth FROM blacklist WHERE somedomain ~* '(?:

Re: [GENERAL] Is there a peer-to-peer server solution with PG?

2005-02-07 Thread Robert Treat
On Sat, 2005-02-05 at 15:03, Jan Wieck wrote: > On 2/4/2005 5:56 AM, Mike Nolan wrote: > > >> If you have so much update load that one server cannot accomodate that > >> load, then you should wonder why you'd expect that causing every one > >> of these updates to be applied to (say) 3 servers woul

Re: [GENERAL] does the planner "learn"?

2005-02-07 Thread Martijn van Oosterhout
On Mon, Feb 07, 2005 at 11:07:16AM -0800, TJ O'Donnell wrote: > I understand the value of indexes and of ANALYZE for the efficient use of > them. > In the following statement, you can see that the index scan is being used. > Even though it takes 80 seconds (for a 1.25 million row table), it is > m

[GENERAL] does the planner "learn"?

2005-02-07 Thread TJ O'Donnell
I understand the value of indexes and of ANALYZE for the efficient use of them. In the following statement, you can see that the index scan is being used. Even though it takes 80 seconds (for a 1.25 million row table), it is much faster than without the index. But, if I repeat this search, it speed

Re: [GENERAL] Creating an index-type for LIKE '%value%'

2005-02-07 Thread Oleg Bartunov
Read http://www.sai.msu.su/~megera/postgres/gist/pg_trgm/README.pg_trgm Oleg On Mon, 7 Feb 2005, Martijn van Oosterhout wrote: On Mon, Feb 07, 2005 at 09:28:24AM -0800, CG wrote: As I was exploring ways to optimize my application's use of the database, which has to run the horrid "SELECT *

[GENERAL] Use of indexes with table inheritance

2005-02-07 Thread Christopher Petrilli
I have a "master table" called events, and 10 subtables which are created using this: CREATE TABLE events001 ( ) INHERITS (events) WITHOUT OIDS; I then build all the indexes on it, including a column called "src_ip": CREATE INDEX events001_src_ip_idx ON events001(src_ip); Then I populat

Re: [GENERAL] Questions about functionality

2005-02-07 Thread Ignacio Colmenero
Just a small note to thank David Fetter, Michael Fuhr, Bricklen Anderson, Scott Marlowe, Karl O. Pinc, and Christopher Browne for their support and for helping me to understand a little bit more about PostgreSQL (I won't say Postgre anymore). Ignacio. -

Re: [GENERAL] Creating an index-type for LIKE '%value%'

2005-02-07 Thread Yury Don
Hello CG, Monday, February 7, 2005, 10:28:24 PM, you wrote: C> Return-Path: <[EMAIL PROTECTED]> C> Delivered-To: [EMAIL PROTECTED] C> Received: (qmail 15486 invoked from network); 7 Feb 2005 17:36:10 - C> Received: from svr4.postgresql.org (66.98.251.159) C> by ns.vpcit.ru with SMTP; 7 Feb

Re: [GENERAL] Creating an index-type for LIKE '%value%'

2005-02-07 Thread Martijn van Oosterhout
On Mon, Feb 07, 2005 at 09:28:24AM -0800, CG wrote: > As I was exploring ways to optimize my application's use of the database, > which > has to run the horrid "SELECT * FROM table WHERE field LIKE '%value%';" in > places, I thought this solution could be built upon to allow for an easier > deploy

Re: [GENERAL] Creating an index-type for LIKE '%value%'

2005-02-07 Thread Tom Lane
CG <[EMAIL PROTECTED]> writes: > Tsearch2 is fantastic, but it works best for fields that contain > words. I have to sift through alphanumeric identification numbers. Can't you adjust tsearch2's notion of what is a word? Sure seems like that would be easier than reinventing this wheel ...

[GENERAL] Permissions on implicit SERIAL datatype seqeuences

2005-02-07 Thread Karl O. Pinc
Hi, I see there's been some discussion about cascading GRANTS to implicitly created sequences. Regardless, a heads-up in the documentation could be a nice thing to have, noting that permissions will have to be created (or not) for the implicit seqeuences. I _should_ know better, but just got bit by

Re: [GENERAL] tsearch2 Trigger

2005-02-07 Thread Joshua D. Drake
Howard Cole wrote: Hi, I have succussfully managed to install tsearch2 and can use it happily with selects, ts_vectors etc. My only problem is when using a trigger in the form suggested in the intro documentation. The trigger calls a function "tsearch2" which takes the tsvector column name, and

[GENERAL] Creating an index-type for LIKE '%value%'

2005-02-07 Thread CG
Once upon a time there was an FTI contrib module that split up a varchar field into little bits and placed them into an FTI table to facilitate a full text index search. It was like being able to do a "SELECT * FROM table WHERE field LIKE '%value%';" and have it search an index! It was a great ide

Re: [GENERAL] Out of memory error

2005-02-07 Thread Joshua D. Drake
Feb 7 16:30:25 s1 kernel: Free swap:0kB Feb 7 16:30:25 s1 kernel: 258032 pages of RAM Feb 7 16:30:25 s1 kernel: 28656 pages of HIGHMEM Feb 7 16:30:25 s1 kernel: 3138 reserved pages Feb 7 16:30:26 s1 kernel: 14914 pages shared Feb 7 16:30:26 s1 kernel: 551 pages swap cached Feb 7

[GENERAL] PG 8.0.1 Does not use Index with IS NOT NULL

2005-02-07 Thread Daniel Schuchardt
Hy List, I have a problem with this Query : SELECT * FROM lifsch WHERE l_dokunr IS NOT NULL ORDER BY l_dokunr; CIMSOFT=# ANALYSE lifsch; ANALYZE CIMSOFT=# EXPLAIN ANALYSE SELECT * FROM lifsch WHERE l_dokunr IS NULL; QUERY PLAN --

[GENERAL] tsearch2 Trigger

2005-02-07 Thread Howard Cole
Hi, I have succussfully managed to install tsearch2 and can use it happily with selects, ts_vectors etc. My only problem is when using a trigger in the form suggested in the intro documentation. The trigger calls a function "tsearch2" which takes the tsvector column name, and the names of colum

Re: [GENERAL] PostgreSQL, exception and PHP

2005-02-07 Thread Michael Fuhr
On Mon, Feb 07, 2005 at 03:10:58PM +0100, Konference wrote: > > is here somebody who works with PostgreSQL in PHP? I have a PL/SQL > function, which can raise an exception. I am not able to catch _only_ > exception error message in PHP. I can parse "Warning: pg_query(): > Query failed: ERROR: Exce

[GENERAL] Out of memory error

2005-02-07 Thread Clodoaldo Pinto
I had an Out of Memory error while running this query in psql over a 170 million rows table: select data, usuario, sum(pontos), sum(wus) from usuarios group by data, usuario FC2 PG 7.4.6 1GB mem Linux s1 2.6.9-1.11_FC2 #1 Sun Jan 2 15:49:30 EST 2005 i686 athlon i38

Re: [GENERAL] Is there a peer-to-peer server solution with PG?

2005-02-07 Thread Christopher Browne
[EMAIL PROTECTED] (Pailloncy Jean-Gerard) writes: > I suppose (because I never used it) that there is a speed boost. I would suppose (because synchronization has substantial costs) that there is more than likely _no_ material improvement in performance. "Clustering" can only provide material perf

Re: [GENERAL] Problem performing a restore of a data schema in Windows

2005-02-07 Thread John DeSoi
On Feb 7, 2005, at 8:22 AM, Shaun Clements wrote: psql -U username -d db1 > filename.dmp Try psql.exe -U username -d db1 -f filename.dmp If it does not work, paste the output from the terminal so we can see what error you have. Are you sure filename.dmp is a plain text dump? If not, you need to u

[GENERAL] PostgreSQL, exception and PHP

2005-02-07 Thread Konference
Hello, is here somebody who works with PostgreSQL in PHP? I have a PL/SQL function, which can raise an exception. I am not able to catch _only_ exception error message in PHP. I can parse "Warning: pg_query(): Query failed: ERROR: Exception error string. in..." but I think, it is not "clear" solut

Re: [GENERAL] Is there a peer-to-peer server solution with PG?

2005-02-07 Thread Pailloncy Jean-Gerard
You do realize that any multimaster replication system, that is designed to avoind complex business process structure based conflict resolution mechanisms, necessarily has to be based on 2 phase commit or similar? So your global write transaction throughput will be limited by the latency of you

Re: [GENERAL] Problem performing a restore of a data schema in Windows

2005-02-07 Thread Sandeep Gaikwad
Hi, Can u please try with the following command: pg_dump -s dbname >DumpFileName.dmp or pg_dump -s -u dbname >DumpFileName.dmp For the second, you will be asked for username & password. Regards, Sandeep Shaun Clements wrote: Hi All Im having a problem restoring a data schema on Postgres 8.01 fo

Re: [GENERAL] Problem performing a restore of a data schema in Wi

2005-02-07 Thread Shaun Clements
Title: RE: [GENERAL] Problem performing a restore of a data schema in Windows Yeah, thats right. Sorry, Typo. Any suggestions. Kind Regards, Shaun Clements -Original Message- From: Shridhar Daithankar [mailto:[EMAIL PROTECTED]] Sent: 07 February 2005 03:33 PM To: Shaun Clements

Re: [GENERAL] Problem performing a restore of a data schema in Windows

2005-02-07 Thread Shridhar Daithankar
On Monday 07 Feb 2005 6:52 pm, Shaun Clements wrote: > Im having a problem restoring a data schema on Postgres 8.01 for Windows. > Im using the following command > psql -U username -d db1 > filename.dmp Shouldn't that be psql -U username -d db1 < filename.dmp Shridhar -

[GENERAL] Problem performing a restore of a data schema in Windows

2005-02-07 Thread Shaun Clements
Title: Problem performing a restore of a data schema in Windows Hi All Im having a problem restoring a data schema on Postgres 8.01 for Windows. Im using the following command psql -U username -d db1 > filename.dmp This should have restored the schema from the file, filename.dmp to the dat

Re: [GENERAL] Help with strange join

2005-02-07 Thread Mike Rylander
On Mon, 7 Feb 2005 12:34:39 +0100, Victor SpÃng Arthursson <[EMAIL PROTECTED]> wrote: > > 2005-02-04 kl. 20.36 skrev Mike Rylander: > > > How about: > > > > SELECT r.* FROM opskrifter r JOIN opskrifter_content c ON (r.nummer = > > c.opskrift) JOIN opskrifter_ingredienser i ON (c.ingrediens = i.id

Re: [GENERAL] Help with strange join

2005-02-07 Thread Victor Spång Arthursson
2005-02-04 kl. 20.36 skrev Mike Rylander: How about: SELECT r.* FROM opskrifter r JOIN opskrifter_content c ON (r.nummer = c.opskrift) JOIN opskrifter_ingredienser i ON (c.ingrediens = i.id) WHERE EXISTS ( SELECT l.relid FROM languages l WHERE l.relid = i.betegnelse GROUP BY l.relid HAVING COUNT(D

Re: [GENERAL] mysql load_file() function

2005-02-07 Thread Ben-Nes Yonatan
> On Feb 4, 2005, at 8:34 AM, Ben-Nes Yonatan wrote: > >>> On Fri, Feb 04, 2005 at 09:27:08AM +0200, Ben-Nes Yonatan wrote: Hi all, Does anyone know if PostgreSQL got a function which work like load_file() of mySQL? >>> >>> I am not quite sure what load_file() does, but check th

Re: [GENERAL] Safely Killing Backends (Was: Applications that leak connections)

2005-02-07 Thread Marco Colombo
On Fri, 4 Feb 2005, Jim Wilson wrote: regards, tom lane We\'d like to be able to take out a connection without risking postmaster going down and thus losing all uncommitted data. Unfortunately the whole world isn\'t encapsulated in Postgres transactions or we would never have to worry about unco

Re: [GENERAL] Problem with the sequence

2005-02-07 Thread sid tow
Thanks that should help but what about the rest of the columns can u explain what is "is_cycled" and "cache_value". Thanks in advance.Richard Huxton wrote: sid tow wrote:> HI> > I have a problem locating the documentation for "sequence". I want to get the detailed information about the columns