[GENERAL] Test, ignore ...

2005-11-21 Thread Marc G. Fournier
Just testing ... ignore ... Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: [EMAIL PROTECTED] Yahoo!: yscrappy ICQ: 7615664 ---(end of broadcast)--- TIP 9: In versions below 8.0, the p

Re: [GENERAL] shorter way to get new value of serial?

2005-11-21 Thread Alban Hertroys
Harald Armin Massa wrote: I have a table: CREATE TABLE rechner ( id_r int4 NOT NULL DEFAULT nextval('rechner_id_r_seq'::regclass), name text, CONSTRAINT rechner_pkey PRIMARY KEY (id_r) ) CREATE UNIQUE INDEX rechner_name ON rechner USING btree (name); and want to have the existing or

Re: [GENERAL] shorter way to get new value of serial?

2005-11-21 Thread Harald Armin Massa
Alban Hertroys,Why don't you just use the default? You could entirely do away with the 'result' variable that way:because I need to know which is the new id of that computer. The other way would be "insert if not exists" and again "select where name = ..." -> 1 statement more, and without a stored

[GENERAL] TSearch2 Questions

2005-11-21 Thread Hannes Dorbath
A few stupid questions: Where to get the latest version? Is http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/ a dead site and the latest versions are always "silently" distributed with PG inside the contrib dir? How can I find out what version of TSearch2 I'm running? Is there active

[GENERAL] Testing again, ignore ...

2005-11-21 Thread Marc G. Fournier
Sorry folks, just trying to debug a bug .. Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: [EMAIL PROTECTED] Yahoo!: yscrappy ICQ: 7615664 ---(end of broadcast)--- TIP 6: explain analy

Re: [GENERAL] Postgres Disconnection problems

2005-11-21 Thread Scott Marlowe
On Fri, 2005-11-18 at 18:51, Otto Blomqvist wrote: > Hi, > > We are using PostgresDAC 2.2.1 and PostgreSQL 8.0.2 on > i386-redhat-linux-gnu, compiled by GCC i386-redhat-linux-gcc (GCC) 4.0.0 > 20050412 (Red Hat 4.0.0-0.42). > > I perform a simple test as follows. > > 1. I connect to the database

[GENERAL] SQL Help: Multiple LEFT OUTER JOINs

2005-11-21 Thread Bill Moseley
I need to generate a table of teachers, and the count of classes they taught in the past and are scheduled to teach in the future. id | last_name | totalfuture_class_count | past_class_count -+--+--++- 3 | Smith |

Re: [GENERAL] TSearch2 Questions

2005-11-21 Thread Oleg Bartunov
On Mon, 21 Nov 2005, Hannes Dorbath wrote: A few stupid questions: Where to get the latest version? Is http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/ a dead site and the latest versions are always "silently" distributed with PG inside the contrib dir? You should always use tsearch

[GENERAL] Multi-parameter aggregates.

2005-11-21 Thread Berend Tober
I'm interested in defining a covariance aggregate function. (As a refresher, remember that covariance is a little bit like variance, but is between two variables: cov(X,Y)= - , where the angular brackets in this case denote taking the averag. Variance is a special case when X and Y are

Re: [GENERAL] SQL Help: Multiple LEFT OUTER JOINs

2005-11-21 Thread Bruno Wolff III
On Mon, Nov 21, 2005 at 05:40:10 -0800, Bill Moseley <[EMAIL PROTECTED]> wrote: > > Here's where I'm missing something. Trying to do an outer join on > to bring in the class row with its class_time column: You don't say exactly why you are having a problem with this, but I think you would be b

Re: [GENERAL] TSearch2 Questions

2005-11-21 Thread Bruno Wolff III
On Mon, Nov 21, 2005 at 16:50:00 +0300, Oleg Bartunov wrote: > On Mon, 21 Nov 2005, Hannes Dorbath wrote: > > >I'm playing a bit with it ATM. Indexing one Gigabyte of plain text worked > >well, with 10 GB I yet have some performance problems. I read the TSearch > >Tuning Guide and will start

Re: [GENERAL] Multi-parameter aggregates.

2005-11-21 Thread Joe Conway
Berend Tober wrote: I'm stuck on not knowing how to define a aggregate that takes more that one variable as its argument This is currently unsupported. Joe ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http:/

Re: [GENERAL] Multi-parameter aggregates.

2005-11-21 Thread Hakan Kocaman
Hello Berend, have you considered using pl/r. http://www.joeconway.com/plr/ I think R got a covariance-function. http://www.r-project.org/ Best regards Hakan Kocaman Software-Developer digame.de GmbH Richard-Byrd-Str. 4-8 50829 Köln Tel.: +49 (0) 221 59 68 88 31 Fax: +49 (0) 221 59 68 88 98

Re: [GENERAL] to create a database...

2005-11-21 Thread Eric E
Can you describe the versatility you're looking for? Why does your application need to run on multiple DB's? Is the user going to be selecting a backend database? I'd consider how compelling your reasons for supporting multiple databases are, because it will be quite a bit of work even with

Re: [GENERAL] Multi-parameter aggregates.

2005-11-21 Thread Florian G. Pflug
Joe Conway wrote: Berend Tober wrote: I'm stuck on not knowing how to define a aggregate that takes more that one variable as its argument But I guess it _could_ take an array as argument, maybe even a record (postgresql pseudonym for what's called a structure in C). You'd use it with the fol

Re: [GENERAL] Multi-parameter aggregates.

2005-11-21 Thread Tom Lane
Berend Tober <[EMAIL PROTECTED]> writes: > I'm stuck on not knowing how to define a > aggregate that takes more that one variable as its argument, That's because there isn't any way to do that. It's on the TODO list I believe. In the meantime, you could possibly kluge it up by defining a compos

Re: [GENERAL] Multi-parameter aggregates.

2005-11-21 Thread Michael Fuhr
On Mon, Nov 21, 2005 at 11:03:22AM -0500, Berend Tober wrote: > I'm interested in defining a covariance aggregate function. (As a > refresher, remember that covariance is a little bit like variance, but > is between two variables: > > cov(X,Y)= - , > > where the angular brackets in this c

[GENERAL] Rule appears not to fire on insert w/ "except"

2005-11-21 Thread Chris Kratz
First version of this I sent this morning did not appear to go through. Please disregard if you received the first one. -- Original Message -- Hello All, We have finally tracked down a bug in our application to a rewrite rule on a table. In essence, the rewrite rule in quest

Re: [GENERAL] Rule appears not to fire on insert w/ "except"

2005-11-21 Thread Tom Lane
Chris Kratz <[EMAIL PROTECTED]> writes: > CREATE OR REPLACE RULE debug_rule AS > ON INSERT TO test1 >do INSERT INTO test_que (row_id) > VALUES (new.id); You would be a whole lot better off doing this with a trigger. > insert into test1 > select id,data from test2 > except select id,

[GENERAL] About not to see insertion result "INSERT 0 1"

2005-11-21 Thread Emi Lu
Greetings, I tried to run insert command from a .sql file. For example, in a.sql file there are 100,000 lines like insert into t1 values(... ...); insert into t1 values(... ...); insert into t1 values(... ...); ... ... I do not want to see the 100,000 times "INSERT 0 1" displayed by postgreS

Re: [GENERAL] About not to see insertion result "INSERT 0 1"

2005-11-21 Thread Tom Lane
Emi Lu <[EMAIL PROTECTED]> writes: > I do not want to see the 100,000 times "INSERT 0 1" displayed by > postgreSQL. Is there a way to hide the output "INSERT 0 1" generated by > postgresql ? "psql -q" I think ... read the man page. regards, tom lane ---

Re: [GENERAL] About not to see insertion result "INSERT 0 1"

2005-11-21 Thread Devrim GUNDUZ
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, On Mon, 21 Nov 2005, Emi Lu wrote: Is there a way to hide the output "INSERT 0 1" generated by postgresql ? Use psql with -q. Regards, - -- Devrim GUNDUZ Kivi Bilişim Teknolojileri - http://www.kivi.com.tr devrim~gunduz.org, devrim~PostgreSQ

Re: [GENERAL] About not to see insertion result "INSERT 0 1"

2005-11-21 Thread Emi Lu
Thanks a lot! That is exactly what I want. - Emi On Mon, 21 Nov 2005, Emi Lu wrote: Is there a way to hide the output "INSERT 0 1" generated by postgresql ? Use psql with -q. Regards, - -- Devrim GUNDUZ Kivi Bilişim Teknolojileri - http://www.kivi.com.tr devrim~gunduz.org, devrim~Postgre

Re: [GENERAL] Multi-parameter aggregates.

2005-11-21 Thread Berend Tober
Hakan Kocaman wrote: have you considered using pl/r. http://www.joeconway.com/plr/ I think R got a covariance-function. http://www.r-project.org/ That would be, like, the easy way. Thanks! Berend begin:vcard fn:Berend Tober n:Tober;Berend org:Seaworthy Systems, Inc. adr:;;22 Main Stree

Re: [GENERAL] Multi-parameter aggregates.

2005-11-21 Thread Berend Tober
Michael Fuhr wrote: On Mon, Nov 21, 2005 at 11:03:22AM -0500, Berend Tober wrote: I'm interested in defining a covariance aggregate function. I think aggregates must take a single value, so the above won't work as written. However, in PostgreSQL 8.0 or later you could define the aggr

Re: [GENERAL] SQL Help: Multiple LEFT OUTER JOINs

2005-11-21 Thread Bill Moseley
On Mon, Nov 21, 2005 at 11:45:34AM -0600, Bruno Wolff III wrote: > On Mon, Nov 21, 2005 at 05:40:10 -0800, > Bill Moseley <[EMAIL PROTECTED]> wrote: > > > > Here's where I'm missing something. Trying to do an outer join on > > to bring in the class row with its class_time column: > > You don't

[GENERAL] Trouble downloading Postgres

2005-11-21 Thread Gary Horton
I'm trying to download the source for 8.1 but am having a problem from both IE and Mozilla browsers. From either browser, clicking on a donwload object link leads me here: Choose a download mirror Downloading: /binary/v8.1.0/win32/postgresql-8.1.0-2.zip We could not query the database or no mi

Re: [GENERAL] SQL Help: Multiple LEFT OUTER JOINs

2005-11-21 Thread John McCawley
It looks to me like your problem is that weird area where you alias your inner join as "t" and thenn inner join based on this alias. You're getting a cartesian product somewhere, as evidenced by the "rows=700" in your explain. I already deleted the old mail with your table structure, but tr

[GENERAL] Any good HOWTOs on LDAP with PostgreSQL 8.1?

2005-11-21 Thread vishal saberwal
Can anyone point me to a good HOW TO on LDAP with postgreSQL 8.0.x or 8.1? Also, while searching online, i came across dblink-ldap. Is this another ldap utility or is it something i could use to connect/link to a ldap application? thanks, vish

Re: [GENERAL] SQL Help: Multiple LEFT OUTER JOINs

2005-11-21 Thread John McCawley
I just noticed, also goofy is your ", person_role" in your from with no criteria. I would generally put the "person_role.person = person.id" as an INNER JOIN, and then only have the "person_role.role=3" in the where. It doesn't look like that's the specific problem, but I generally find that

Re: [GENERAL] Anomalies with the now() function

2005-11-21 Thread Michael Fuhr
[Please copy the mailing list on replies and please don't change the Subject header. I've restored the original subject and am copying the list on this reply. I'll look at this when I get a chance, but maybe somebody else will answer before then.] On Mon, Nov 21, 2005 at 05:28:30PM -, Byrne

Re: [GENERAL] Anomalies with the now() function

2005-11-21 Thread Jaime Casanova
On 11/21/05, Michael Fuhr <[EMAIL PROTECTED]> wrote: > [Please copy the mailing list on replies and please don't change > the Subject header. I've restored the original subject and am > copying the list on this reply. I'll look at this when I get a > chance, but maybe somebody else will answer be

Re: [GENERAL] Rule appears not to fire on insert w/ "except"

2005-11-21 Thread Chris Kratz
On Monday 21 November 2005 03:35 pm, you wrote: > Chris Kratz <[EMAIL PROTECTED]> writes: > > CREATE OR REPLACE RULE debug_rule AS > > ON INSERT TO test1 > >do INSERT INTO test_que (row_id) > > VALUES (new.id); > > You would be a whole lot better off doing this with a trigger. > > > inser

Re: [GENERAL] Trouble downloading Postgres

2005-11-21 Thread Magnus Hagander
> I'm trying to download the source for 8.1 but am having a > problem from both IE and Mozilla browsers. From either > browser, clicking on a donwload object link leads me here: Hi. This should be fixed by now, thanks for reporting it. (There were serious problems, but they were solved a short w

Re: [GENERAL] Any good HOWTOs on LDAP with PostgreSQL 8.1?

2005-11-21 Thread Magnus Hagander
> Can anyone point me to a good HOW TO on LDAP with postgreSQL > 8.0.x or 8.1? > > Also, while searching online, i came across dblink-ldap. > Is this another ldap utility or is it something i could use > to connect/link to a ldap application? If what you're trying to do is access LDAP data fro

Re: [GENERAL] Trouble downloading Postgres

2005-11-21 Thread Gary Horton
Yes, thanks very much, I was just a few minutes ago able to get back in and get this done. Thanks! -gh Magnus Hagander wrote: I'm trying to download the source for 8.1 but am having a problem from both IE and Mozilla browsers. From either browser, clicking on a donwload object link l

Re: [GENERAL] SQL Help: Multiple LEFT OUTER JOINs

2005-11-21 Thread Bill Moseley
On Mon, Nov 21, 2005 at 03:25:56PM -0600, John McCawley wrote: > I just noticed, also goofy is your ", person_role" in your from with no > criteria. I would generally put the "person_role.person = person.id" as > an INNER JOIN, and then only have the "person_role.role=3" in the > where. It doe

[GENERAL] Rule appears not to fire on insert w/ "except"

2005-11-21 Thread Chris Kratz
Hello All, We have finally tracked down a bug in our application to a rewrite rule on a table. In essence, the rewrite rule in question logs any inserts to another table. This works correctly in all cases except where an "except" clause is used in the insert statement. In this case, the rows

[GENERAL] Timestamp with Timezone

2005-11-21 Thread Matthew Terenzio
reading the docs . . . let's see if I've got it. 1. Timestamp with timezone accepts a timestamp with the additional timezone, converts it and stores it as GMT 2. It returns the value as the timestamp converted to the timezone of the local machine? ---(end of broadcas

Re: [GENERAL] Weird results when using schemas

2005-11-21 Thread Geert Jansen
Michael Fuhr wrote: You refer to shs.city. in the select list, but in the from clause you've aliased shs.city to city. As the SELECT documentation says, When an alias is provided, it completely hides the actual name of the table or function; for example given FROM foo AS f, the remainder

[GENERAL] Difference in indexes

2005-11-21 Thread A.j. Langereis
Dear all,   I'm using a PostgreSQL 8.1.0 dabase on a Fedora Core 3 machine here. In this table there is a table hosts:   CREATE TABLE hosts(  hostid int4 NOT NULL DEFAULT nextval('hosts_hostid_seq'::regclass),  hostip cidr NOT NULL,  hostname varchar(50),  lastseen timestamp DEFAULT '1970-01

Re: [GENERAL] Difference in indexes

2005-11-21 Thread Qingqing Zhou
""A.j. Langereis"" <[EMAIL PROTECTED]> wrote > > What is happening here? What am I overlooking? The length does not > seem to be the problem: 'FooFooFoo' also uses the index.. > Also the fact whenever there are results or not does not seem to > influence the planner.. > Check out this thread: ht

Re: [GENERAL] Conditional delete

2005-11-21 Thread Qingqing Zhou
On Mon, 21 Nov 2005, Bartosz Jakubiak wrote: > Hi. > > I'm new with PostgreSQL, but this thing doesn't allow me to sleep: > > I wonder if it is possible to execute SQL query which: > 1. checks out if table exists, and if it is: > 2. deletes it > All of it at SQL query level, preferrably in one

[GENERAL] Group By?

2005-11-21 Thread Bob Pawley
I want to take the serial ID of several values in different rows in one table and insert them into a single row of another table.   Would the 'group by' command be the best way to do this?   Bob

Re: [GENERAL] Difference in indexes

2005-11-21 Thread A.j. Langereis
Tnks Qingqing, I've read them! Nevertheless I think there are some differences here: * The difference in the amout of rows is much smaller. Nevertheless the table is small as well: only 100 rows * There is a faster query plan to solve the query: "Bitmap Heap Scan on hosts (cost=2.07..11.34 rows=

Re: [GENERAL] Group By?

2005-11-21 Thread Guy Rouillier
Converted your message to plain text as preferred on most mailing lists. Bob Pawley wrote: > I want to take the serial ID of several values in different rows in > one table and insert them into a single row of another table. > > Would the 'group by' command be the best way to do this? Could you

Re: [GENERAL] SQL Help: Multiple LEFT OUTER JOINs

2005-11-21 Thread Bill Moseley
On Mon, Nov 21, 2005 at 02:06:35PM -0800, Bill Moseley wrote: > The now working query (thanks to you!) is: No that doesn't work. It's dropping the people that have never been assigned a class to teach (i.e. don't have a row in the "instructors" link table). > FROM class INNER JOIN ins

[GENERAL] Best way to represent values.

2005-11-21 Thread Dennis Veatch
I have several fields that needs to be within a table but not real sure the best way to represent this data. The scenario I'm trying to incorporate is a form that has to be filled out went a well is drilled and then sent to the state. One of the things the form wants is the different depths var

Re: [GENERAL] SQL Help: Multiple LEFT OUTER JOINs

2005-11-21 Thread John McCawley
> I'm not clear how to move that "person_role.person = person.id" into the FROM statement. Does it matter? This should work: FROM person INNER JOIN person_role ON person.id = person_role.person LEFT OUTER JOIN instructors ON (person.id = instructors.person) LEFT OUTER JOIN class ON (instructor

Re: [GENERAL] Best way to represent values.

2005-11-21 Thread Michael Glaesemann
On Nov 22, 2005, at 3:19 , Dennis Veatch wrote: I had thought just adding some fields called topsoil_start/ topsoil_end, gravel_start/gravel_end, etc. But them I'm left with how to take those values and give to total depth for each layer and total depth of the well. But I'm not sure that is

Re: [GENERAL] Rule appears not to fire on insert w/ "except"

2005-11-21 Thread Jerry Sievers
Chris Kratz <[EMAIL PROTECTED]> writes: > Hello All, > > We have finally tracked down a bug in our application to a rewrite rule on a > table. In essence, the rewrite rule in question logs any inserts to another > table. This works correctly in all cases except where an "except" clause is >

Re: [GENERAL] Rule appears not to fire on insert w/ "except"

2005-11-21 Thread David Fetter
On Mon, Nov 21, 2005 at 08:05:19PM -0500, Jerry Sievers wrote: > Chris Kratz <[EMAIL PROTECTED]> writes: > > > Hello All, > > > > We have finally tracked down a bug in our application to a rewrite rule on > > a > > table. In essence, the rewrite rule in question logs any inserts to > > anothe

Re: [GENERAL] About not to see insertion result "INSERT 0 1"

2005-11-21 Thread Sven Willenberger
Emi Lu presumably uttered the following on 11/21/05 15:40: Greetings, I tried to run insert command from a .sql file. For example, in a.sql file there are 100,000 lines like insert into t1 values(... ...); insert into t1 values(... ...); insert into t1 values(... ...); ... ... I do not want

Re: [GENERAL] Difference in indexes

2005-11-21 Thread Qingqing Zhou
""A.j. Langereis"" <[EMAIL PROTECTED]> wrote > > "Bitmap Heap Scan on hosts (cost=2.07..11.34 rows=21 width=59) (actual > time=0.175..0.287 rows=21 loops=1)" > " Recheck Cond: ((hostname)::text = 'Fabian'::text)" > " -> Bitmap Index Scan on hosts_hostname (cost=0.00..2.07 rows=21 > width=0) (

Re: [GENERAL] Best way to represent values.

2005-11-21 Thread Dennis Veatch
On Monday 21 November 2005 20:04, Michael Glaesemann wrote: > On Nov 22, 2005, at 3:19 , Dennis Veatch wrote: > > I had thought just adding some fields called topsoil_start/ > > topsoil_end, > > gravel_start/gravel_end, etc. But them I'm left with how to take > > those values > > and give to total

[GENERAL] not null error in trigger on unrelated column

2005-11-21 Thread CSN
I have a members table and an items table. Every time items.member_id or items.active gets changed, members.items_submitted and members.items_approved gets updated by a trigger on items. I added an "admin" column to members, and now this happens: => update items set active = false where member_i

Re: [GENERAL] Createlang plpgsql

2005-11-21 Thread Jeremy Sellors
I see the problem now. On a shared host the createuser and createdb are handled by cPanel scripts but not (as yet on my host) createlang.The createlang utility only installs procedural languages included in the default PostgreSQL distribution, which fortunately includes plpgsql language I need.If t

Re: [GENERAL] Group By?

2005-11-21 Thread Bruno Wolff III
On Mon, Nov 21, 2005 at 15:53:15 -0800, Bob Pawley <[EMAIL PROTECTED]> wrote: > I want to take the serial ID of several values in different rows in one table > and insert them into a single row of another table. > > Would the 'group by' command be the best way to do this? >From your descriptio

Re: [GENERAL] Group By?

2005-11-21 Thread Bob Pawley
Here's what I want to do. Table control contains values (mon and valves) that are associated by numbers inserted into the associated column. I want to transfer the serial _id number of the items associated by the value '1' into the appropriate columns of the first row of the table auto_contr

Re: [GENERAL] Group By?

2005-11-21 Thread Bruno Wolff III
On Mon, Nov 21, 2005 at 21:53:10 -0800, Bob Pawley <[EMAIL PROTECTED]> wrote: > Here's what I want to do. > > Table control contains values (mon and valves) that are associated by > numbers inserted into the associated column. > > I want to transfer the serial _id number of the items associate

Re: [GENERAL] Createlang plpgsql

2005-11-21 Thread Tino Wildenhain
Am Montag, den 21.11.2005, 20:12 -0800 schrieb Jeremy Sellors: > I see the problem now. On a shared host the createuser and createdb > are handled by cPanel scripts but not (as yet on my host) createlang. > The createlang utility only installs procedural languages included in > the default PostgreS