Re: Full text searching?
Gunnar R|nning wrote:
"Poul L. Christiansen" <poulc@cs.auc.dk> writes:
I chose to use a 3rd party product (Verity) for full text indexing even
though I would prefer to use PostgreSQL for fti.How is the support for Danish in Verity now ?
I convert the characters - e.g. � will be converted to ø When I
do a search, i just replace the search string the same way. The only
problem that could arise is when people search for the word "slash", but
I guess you could avoid searching ø somehow.
I used Verity indirectly earlier as a plugin in to Sybase. The nice thing
about such an integration where that I could do joins between the different
Verity indexes and my regular tables.It would have been nice if PostgreSQL had some sort of extension mechanism
to interface against external servers. Maybe an API for creating proxy
tables, so a join you do against a proxy table really forwards the request
to another service.
I'd love to have an index type directly in PostegreSQL called fti which
give us full text indexing just as easily as a standard B-tree index.
When 7.1 is out, all it needs is fti to make it equal in features to MS
SQL Server ;)
Poul L. Christiansen
From bouncefilter Mon Jan 10 05:48:37 2000
Received: from iremia.univ-reunion.fr (iremia.univ-reunion.fr [192.93.18.10])
by hub.org (8.9.3/8.9.3) with ESMTP id FAA59971
for <pgsql-general@hub.org>; Mon, 10 Jan 2000 05:48:08 -0500 (EST)
(envelope-from Guillaume.Rousse@univ-reunion.fr)
Received: from agathe (guillaume@agathe [192.93.18.147])
by iremia.univ-reunion.fr (8.9.1a/jtpda-5.3.1/jlo(98)) with SMTP id
OAA22985
for <pgsql-general@hub.org>; Mon, 10 Jan 2000 14:47:19 +0400 (GMT+4)
From: Guillaume Rousse <Guillaume.Rousse@univ-reunion.fr>
Organization: Universit� de la R�union
To: pgsql-general@hub.org
Subject: Where is my database gone ?
Date: Mon, 10 Jan 2000 14:48:11 +0400
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
MIME-Version: 1.0
Message-Id: <00011014531700.03937@agathe>
Content-Transfer-Encoding: 8bit
My database coraux isn't listed anymore when i use psql -l, altough i can still
connect to it using psql coraux, but there isn't any tables listed by \dt.
Files are still present in $PGDATA, with their content.
What's the problem, and how can i recover it ?
-- --
Guillaume Rousse
*******************************************
Iremia - Universit� de la R�union
15 avenue Ren� Cassin, BP 7151
97715 Saint Denis, messagerie cedex 9
Tel:0262938287 Fax:0262938260 ICQ:10756815
Mail:Guillaume.Rousse@univ-reunion.fr
BRIDGEKEEPER: What... is the air-speed velocity of an unladen swallow?
ARTHUR: What do you mean? An African or European swallow?
From bouncefilter Mon Jan 10 07:10:23 2000
Received: from clio.trends.ca (root@clio.trends.ca [209.47.148.2])
by hub.org (8.9.3/8.9.3) with ESMTP id HAA06784
for <pgsql-general@postgresql.org>;
Mon, 10 Jan 2000 07:10:21 -0500 (EST)
(envelope-from moser@sodalia.it)
Received: from agadir.sodalia.it (agadir.sodalia.it [193.70.237.53])
by clio.trends.ca (8.9.3+Sun/8.9.3) with ESMTP id GAA16509
for <pgsql-general@postgresql.org>;
Mon, 10 Jan 2000 06:06:43 -0500 (EST)
Received: from sodalia.it (moser@localhost [127.0.0.1])
by agadir.sodalia.it (8.8.6/8.8.6) with ESMTP id MAA03214
for <pgsql-general@postgresql.org>;
Mon, 10 Jan 2000 12:03:51 +0100 (MET)
Sender: moser@agadir.sodalia.it
Message-ID: <3879BC96.55E04B6F@sodalia.it>
Date: Mon, 10 Jan 2000 12:03:50 +0100
From: Moser Marco <moser@sodalia.it>
Organization: http://www.sodalia.it
X-Mailer: Mozilla 4.7 [en] (X11; I; HP-UX B.10.20 9000/712)
X-Accept-Language: en
MIME-Version: 1.0
To: pgsql-general@postgresql.org
Subject: gen
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
subscribe
From bouncefilter Mon Jan 10 07:06:35 2000
Received: from clio.trends.ca (root@clio.trends.ca [209.47.148.2])
by hub.org (8.9.3/8.9.3) with ESMTP id HAA06109
for <pgsql-general@hub.org>; Mon, 10 Jan 2000 07:06:20 -0500 (EST)
(envelope-from a.joubert@albourne.com)
Received: from cap-ferrat.albourne.com (cap-ferrat.albourne.com
[195.89.178.227])
by clio.trends.ca (8.9.3+Sun/8.9.3) with ESMTP id GAA16815
for <pgsql-general@hub.org>; Mon, 10 Jan 2000 06:18:51 -0500 (EST)
Received: from albourne.com (bishop-rock.albourne.com [195.89.178.230])
by cap-ferrat.albourne.com (8.9.3/8.9.3/Albourne/UKS/2.9/MAPS) with
ESMTP id LAA27834; Mon, 10 Jan 2000 11:16:39 GMT
Sender: a.joubert@albourne.com
Message-ID: <3879BF9A.BFB91A83@albourne.com>
Date: Mon, 10 Jan 2000 11:16:42 +0000
From: Adriaan Joubert <a.joubert@albourne.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.14 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Guillaume Rousse <Guillaume.Rousse@univ-reunion.fr>
CC: pgsql-general@hub.org
Subject: Re: [GENERAL] Where is my database gone ?
References: <00011014531700.03937@agathe>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Guillaume Rousse wrote:
My database coraux isn't listed anymore when i use psql -l, altough i can still
connect to it using psql coraux, but there isn't any tables listed by \dt.
Files are still present in $PGDATA, with their content.
What's the problem, and how can i recover it ?
Most likely cause is that either the user that created the database does not exist
anymore or your permissions got messed up somehow. I've seen similar behaviour
when the user does not exist. You can see who owns the tables by doing
select relname,relowner from pg_class;
Then do
select * from pg_user to figure out which user the relowner corresponds to. If the
user is missing, create a enw one with the required uid.
Adriaan
From bouncefilter Mon Jan 10 13:12:27 2000
Received: from hotmail.com (f169.law3.hotmail.com [209.185.241.169])
by hub.org (8.9.3/8.9.3) with SMTP id NAA93710
for <pgsql-general@postgresql.org>;
Mon, 10 Jan 2000 13:12:14 -0500 (EST)
(envelope-from danboutin@hotmail.com)
Received: (qmail 19174 invoked by uid 0); 10 Jan 2000 18:11:39 -0000
Message-ID: <20000110181139.19173.qmail@hotmail.com>
Received: from 209.64.217.69 by www.hotmail.com with HTTP;
Mon, 10 Jan 2000 10:11:39 PST
X-Originating-IP: [209.64.217.69]
From: "Dan Boutin" <danboutin@hotmail.com>
To: pgsql-general@postgresql.org
Subject: Intro/Win9X
Date: Mon, 10 Jan 2000 12:11:39 CST
Mime-Version: 1.0
Content-Type: text/plain; format=flowed
Hi,
My name is Dan Boutin. I am just getting started exploring the
opportunities with Linux. I am currently developing a VB/SQL Server
application that I wish to run on PostgreSQL instead...mainly because of the
cost savings it will give the customer.
I saw on the web site that there is a Win9X version available. Is there a
trial version that I can download so I can evaluate the product instead of
having to purchase the full Win9X product? I don't have a Linux box set up
yet, but will do so soon, but I would like to evaluate PostgreSQL to see if
it performs as well as SQL Server.
Any input would be greatly appreciated.
Thanks,
Dan Boutin
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
From bouncefilter Mon Jan 10 07:55:24 2000
Received: from eszol228120nts.mol.hu (szfw.mol.hu [171.31.0.10])
by hub.org (8.9.3/8.9.3) with ESMTP id HAA14540
for <pgsql-general@postgresql.org.>;
Mon, 10 Jan 2000 07:54:37 -0500 (EST) (envelope-from ABenko@mol.hu)
Received: by mail.mol.hu with Internet Mail Service (5.5.2448.0)
id <CT4ZVKFC>; Mon, 10 Jan 2000 13:52:11 +0100
Message-ID: <871AC8CF4C2CD211AFC40000F81F8F02AF8801@bbudamail.mol.hu>
From: =?iso-8859-2?Q?Benk=F5_Attila?= <ABenko@mol.hu>
To: "'pgsql-general@postgresql.org.'" <pgsql-general@postgresql.org>
Subject: Support for national characters - Hungarian
Date: Mon, 10 Jan 2000 13:52:21 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Content-Type: text/plain
Hi everybody !
I wondering if postgreSQL is suitable for developing a medical health care
database system considering the extensive use of the Hungarian
charactersetes and the required sorting based on this.
batila
From bouncefilter Mon Jan 10 08:34:25 2000
Received: from iremia.univ-reunion.fr (iremia.univ-reunion.fr [192.93.18.10])
by hub.org (8.9.3/8.9.3) with ESMTP id IAA24569
for <pgsql-general@postgreSQL.org>;
Mon, 10 Jan 2000 08:33:22 -0500 (EST)
(envelope-from Guillaume.Rousse@univ-reunion.fr)
Received: from agathe (guillaume@agathe [192.93.18.147])
by iremia.univ-reunion.fr (8.9.1a/jtpda-5.3.1/jlo(98)) with SMTP id
RAA28100 for <pgsql-general@postgreSQL.org>;
Mon, 10 Jan 2000 17:32:16 +0400 (GMT+4)
From: Guillaume Rousse <Guillaume.Rousse@univ-reunion.fr>
Organization: Universit� de la R�union
To: pgsql-general@postgreSQL.org
Subject: Inheritance and primary key
Date: Mon, 10 Jan 2000 17:05:21 +0400
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
MIME-Version: 1.0
Message-Id: <00011017381300.00654@agathe>
Content-Transfer-Encoding: 8bit
I use a super-class S (virtual, in fact) ans three inheritated classes S1, S2
and S3. i wish to have a primary key for all these classes, in order to use
queries as : SELECT * FROM S* WHERE s.id=x
I use a serial ID field for S as a primary key. Sequencing is OK, as any
insertion in any of the four classes increments the counter. But uniqueness
constraint is lost, as i can have duplicated values between differents classes.
And even in the same class for the inherited ones, as primary key propertie of
ID column is lost through inheritance. And i can't specify a unique constraint
on this column, as it is not present in the class definition.
How to solve this problem ?
--
Guillaume Rousse
*******************************************
Iremia -Universit� de la R�union
15 avenue Ren� Cassin, BP 7151
97715 Saint Denis, messagerie cedex 9
Tel:0262938287 Fax:0262938260 ICQ:10756815
Mail:Guillaume.Rousse@univ-reunion.fr
BRIDGEKEEPER: What... is the air-speed velocity of an unladen swallow?
ARTHUR: What do you mean? An African or European swallow?
From bouncefilter Mon Jan 10 14:36:28 2000
Received: from hotmail.com (f143.law3.hotmail.com [209.185.241.143])
by hub.org (8.9.3/8.9.3) with SMTP id OAA23031
for <pgsql-general@postgreSQL.org>;
Mon, 10 Jan 2000 14:35:57 -0500 (EST)
(envelope-from danboutin@hotmail.com)
Received: (qmail 4081 invoked by uid 0); 10 Jan 2000 19:35:26 -0000
Message-ID: <20000110193526.4080.qmail@hotmail.com>
Received: from 209.64.217.69 by www.hotmail.com with HTTP;
Mon, 10 Jan 2000 11:35:26 PST
X-Originating-IP: [209.64.217.69]
From: "Dan Boutin" <danboutin@hotmail.com>
To: pgsql-general@postgreSQL.org
Subject: NTWS Demo?
Date: Mon, 10 Jan 2000 13:35:26 CST
Mime-Version: 1.0
Content-Type: text/plain; format=flowed
There is no Win9X version of PostgreSQL available, that I am aware
of...closest is WinNT...
I also have a NTWS 4.0/SP4 PC. So is there a demo available for this
platform?
Thanks again,
Dan
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
From bouncefilter Mon Jan 10 11:23:27 2000
Received: from news.tht.net (news.hub.org [216.126.91.242])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA65470;
Mon, 10 Jan 2000 11:22:47 -0500 (EST)
(envelope-from news@news.tht.net)
Received: (from news@localhost) by news.tht.net (8.9.3/8.9.3) id KAA15299;
Mon, 10 Jan 2000 10:59:32 -0500 (EST) (envelope-from news)
X-Authentication-Warning: news.tht.net: news set sender to <news> using -f
From: "Jim Canuel" <stlmis@nospam.bestweb.net.tht.net>
X-Newsgroups: comp.databases.postgresql.patches,
comp.databases.postgresql.questions,
microsoft.public.sqlserver.misc, microsoft.public.sqlserver.odbc,
microsoft.public.sqlserver.programming,
microsoft.public.sqlserver.server
References: <Imh34.20953$Tp.847209@typ11.nn.bcandid.com>
<#JZwP7RQ$GA.299@cppssbbsa04> <3855A863.C0D9FC29@prodigy.net>
Subject: Re: Memory bug
Lines: 6
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Message-ID: <ulne4.49444$xC4.659689@newshog.newsread.com>
Date: Mon, 10 Jan 2000 15:59:22 GMT
X-Complaints-To: Abuse Role <abuse@bestweb.net>, We Care <abuse@newsread.com>
X-Trace: newshog.newsread.com 947519962 216.179.14.208 (Mon,
10 Jan 2000 10:59:22 EST)
Organization: BestWeb (bestweb.net)
To: pgsql-patches@postgresql.org.pgsql-questions@postgresql.org
We had the same problem (2GB Memory). We had called Microsoft TS and were
told the exact same thing Bob Pfeiff said in the previous post. Go to the
properties for the SQL server and set SQL Server to use a maximum ammount of
RAM (how much depends on what else you have the NT server doing).
From bouncefilter Mon Jan 10 11:16:26 2000
Received: from henry.newn.cam.ac.uk (henry.newn.cam.ac.uk [131.111.204.130])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA64392
for <pgsql-general@postgresql.org>;
Mon, 10 Jan 2000 11:15:54 -0500 (EST)
(envelope-from prlw1@newn.cam.ac.uk)
Received: from [131.111.204.180] (helo=quartz.newn.cam.ac.uk)
by henry.newn.cam.ac.uk with esmtp (Exim 2.12 #1)
id 127hTt-0002cg-00; Mon, 10 Jan 2000 16:15:45 +0000
Received: from prlw1 by quartz.newn.cam.ac.uk with local (Exim 2.12 #1)
id 127hTj-0000w4-00; Mon, 10 Jan 2000 16:15:35 +0000
Date: Mon, 10 Jan 2000 16:15:35 +0000
From: Patrick Welche <prlw1@newn.cam.ac.uk>
To: admin <admin@wtbwts.com>
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] can't seem to use index
Message-ID: <20000110161535.I28245@quartz.newn.cam.ac.uk>
References: <Pine.BSF.4.10.10001092237130.50154-100000@server.b0x.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.1.1i
In-Reply-To: <Pine.BSF.4.10.10001092237130.50154-100000@server.b0x.com>;
from admin@wtbwts.com on Sun, Jan 09, 2000 at 10:37:43PM +0000
On Sun, Jan 09, 2000 at 10:37:43PM +0000, admin wrote:
...
Both my table and index have been created successfully, and the database
has been vacuumed. Then I run the following query from the psql
^^^^^^^^
Maybe it needs to be "vacuum analyze"..
Cheers,
Patrick
From bouncefilter Mon Jan 10 11:20:26 2000
Received: from henry.newn.cam.ac.uk (henry.newn.cam.ac.uk [131.111.204.130])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA65090
for <pgsql-general@postgresql.org>;
Mon, 10 Jan 2000 11:19:52 -0500 (EST)
(envelope-from prlw1@newn.cam.ac.uk)
Received: from [131.111.204.180] (helo=quartz.newn.cam.ac.uk)
by henry.newn.cam.ac.uk with esmtp (Exim 2.12 #1) id 127hY4-0002cs-00
for pgsql-general@postgresql.org; Mon, 10 Jan 2000 16:20:04 +0000
Received: from prlw1 by quartz.newn.cam.ac.uk with local (Exim 2.12 #1)
id 127hXt-0000wF-00
for pgsql-general@postgreSQL.org; Mon, 10 Jan 2000 16:19:53 +0000
Date: Mon, 10 Jan 2000 16:19:53 +0000
From: Patrick Welche <prlw1@newn.cam.ac.uk>
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] can't seem to use index
Message-ID: <20000110161953.J28245@quartz.newn.cam.ac.uk>
Reply-To: prlw1@cam.ac.uk
References: <Pine.BSF.4.10.10001092237130.50154-100000@server.b0x.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.1.1i
In-Reply-To: <Pine.BSF.4.10.10001092237130.50154-100000@server.b0x.com>;
from admin@wtbwts.com on Sun, Jan 09, 2000 at 10:37:43PM +0000
On Sun, Jan 09, 2000 at 10:37:43PM +0000, admin wrote:
...
Both my table and index have been created successfully, and the database
has been vacuumed. Then I run the following query from the psql
^^^^^^^^
Maybe it needs to be "vacuum analyze"..
Cheers,
Patrick
From bouncefilter Mon Jan 10 18:08:31 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id SAA72820
for <pgsql-general@postgresql.org>;
Mon, 10 Jan 2000 18:08:18 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id E72C71FE8; Mon, 10 Jan 2000 18:07:07 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1])
by pcr.ca (Postfix) with ESMTP id D396E1F91
for <pgsql-general@postgresql.org>;
Mon, 10 Jan 2000 18:07:07 +0000 (GMT)
Date: Mon, 10 Jan 2000 18:07:07 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: pgsql-general@postgresql.org
Subject: Re: can't seem to use index
In-Reply-To: <Pine.BSF.4.10.10001092237130.50154-100000@server.b0x.com>
Message-ID: <Pine.BSF.4.10.10001101759580.54163-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Following a few suggestions, I have entered 2500 records in the
manufacturer table. Unfortunately, searching for name in the manufacturer
table still returned a sequential scan.
I then tried changing the btree index to a hash talbe and went through the
same procedure of vacumming and restarting a psql session. Yet again, the
index wasn't being used.
Finally, I decided to create an index for id as follows:
CREATE INDEX manu_id_idx ON "manufacturer" using btree ("id" "int2_ops");
Then, when trying a similar search on the id field, it used the index.
Unfortunately, I still can't seem to make postgresql use the index for
searching the name field.
Any other suggestions would be appreciated,
Marc
I'm trying to use an index on a varchar(32) field, but explain keeps
retuning a sequential scan. This is my table and index:CREATE TABLE manufacturer (
id int2,
name varchar(32)
);CREATE INDEX manu_name_idx ON "manufacturer" using btree ( "name"
"text_ops" );Both my table and index have been created successfully, and the database
has been vacuumed. Then I run the following query from the psql
command-line:
explain select * from manufacturer where name='3COM';... and I get a sequential scan! What gives?
Any suggestions would be greatly appreciated,
Marc
From bouncefilter Mon Jan 10 13:46:28 2000
Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60])
by hub.org (8.9.3/8.9.3) with ESMTP id NAA03674
for <pgsql-general@postgreSQL.org>;
Mon, 10 Jan 2000 13:45:57 -0500 (EST) (envelope-from scrappy@hub.org)
Received: from localhost (scrappy@localhost)
by thelab.hub.org (8.9.3/8.9.1) with ESMTP id OAA41395;
Mon, 10 Jan 2000 14:45:27 -0400 (AST) (envelope-from scrappy@hub.org)
X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs
Date: Mon, 10 Jan 2000 14:45:27 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org>
To: Dan Boutin <danboutin@hotmail.com>
cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Intro/Win9X
In-Reply-To: <20000110181139.19173.qmail@hotmail.com>
Message-ID: <Pine.BSF.4.21.0001101445020.18498-100000@thelab.hub.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Mon, 10 Jan 2000, Dan Boutin wrote:
Hi,
My name is Dan Boutin. I am just getting started exploring the
opportunities with Linux. I am currently developing a VB/SQL Server
application that I wish to run on PostgreSQL instead...mainly because of the
cost savings it will give the customer.I saw on the web site that there is a Win9X version available. Is there a
trial version that I can download so I can evaluate the product instead of
having to purchase the full Win9X product? I don't have a Linux box set up
yet, but will do so soon, but I would like to evaluate PostgreSQL to see if
it performs as well as SQL Server.
There is no Win9X version of PostgreSQL available, that I am aware
of...closest is WinNT...
From bouncefilter Mon Jan 10 14:48:28 2000
Received: from web303.mail.yahoo.com (web303.mail.yahoo.com [128.11.68.234])
by hub.org (8.9.3/8.9.3) with SMTP id OAA24827
for <pgsql-general@hub.org>; Mon, 10 Jan 2000 14:48:20 -0500 (EST)
(envelope-from alain_tesio@yahoo.com)
Received: (qmail 12444 invoked by uid 60001); 10 Jan 2000 19:48:19 -0000
Message-ID: <20000110194819.12443.qmail@web303.mail.yahoo.com>
Received: from [194.2.210.177] by web303.mail.yahoo.com;
Mon, 10 Jan 2000 11:48:19 PST
Date: Mon, 10 Jan 2000 11:48:19 -0800 (PST)
From: Alain TESIO <alain_tesio@yahoo.com>
Reply-To: tesio@easynet.fr
Subject: Dirty workaround to get the results and the errors in the same output
file
To: pgsql-general@hub.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Hello,
Maybe you've experienced this problem too : when you have a huge
script with an error somewhere, it's a pain to find out what
line produced the error as you can't have the output of psql
with the queries and the error message in the same file.
I've tried psql ... 1>out 2>out, you the source queries at the
top of the file, and the messages from psql at the bottom.
Here's the trick which worked for me : replace stdout with
stderr in psql.c, and compile again psql. When you got an error,
the message is now just after the offending query.
Alain
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
From bouncefilter Mon Jan 10 14:56:29 2000
Received: from iremia.univ-reunion.fr (iremia.univ-reunion.fr [192.93.18.10])
by hub.org (8.9.3/8.9.3) with ESMTP id OAA26040
for <pgsql-general@postgreSQL.org>;
Mon, 10 Jan 2000 14:55:42 -0500 (EST)
(envelope-from Guillaume.Rousse@univ-reunion.fr)
Received: from agathe (guillaume@agathe [192.93.18.147])
by iremia.univ-reunion.fr (8.9.1a/jtpda-5.3.1/jlo(98)) with SMTP id
XAA18205 for <pgsql-general@postgreSQL.org>;
Mon, 10 Jan 2000 23:55:09 +0400 (GMT+4)
From: Guillaume Rousse <Guillaume.Rousse@univ-reunion.fr>
Organization: Universit� de la R�union
To: pgsql-general@postgreSQL.org
Subject: SQL 3 and n:m relationships
Date: Mon, 10 Jan 2000 23:59:06 +0400
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
MIME-Version: 1.0
Message-Id: <00011100010200.01376@agathe>
Content-Transfer-Encoding: 8bit
SQL3 bring array types, ideal for creating n:m relations directly, without
crossing table. The question is : how to retrieve all linked records with one
only request ?
Let's have an exemple with books and authors with SQL 2 :
CREATE TABLE books(id INT, name VARCHAR)
CREATE TABLE authors(id INT, name VARCHAR)
CREATE TABLE authorship(bookRef INT, authorRef INT, order INT)
The following query returns all authors from book n�x:
SELECT name FROM auhtors WHERE authorship.authorRef=author.id AND
authorship.bookRef=x ORDER by authorship.order
Now, with SQL3, only two tables are enough :
CREATE TABLE books(id INT, name VARCHAR, authorsRef INT[])
CREATE TABLE writers(id INT, name VARCHAR)
How then retrieve all authors of book n�x in SQL ?
With a programming language, one can use a loop, and then send one query for
every value found in books.authorsRef[]. Not very clean Or forge a query string
with an OR statement, as SELECT name FROM authors WHERE
author.id=book.authorRef[1] OR author.id=book.authorRef[2] and so on, but then
lose the correct order. Not satisfying neither.
So, what's the solution ?
--
Guillaume Rousse
*******************************************
Iremia - Universit� de la R�union
15 avenue Ren� Cassin, BP 7151
97715 Saint Denis, messagerie cedex 9
Tel:0262938287 Fax:0262938260 ICQ:10756815
Mail:Guillaume.Rousse@univ-reunion.fr
BRIDGEKEEPER: What... is the air-speed velocity of an unladen swallow?
ARTHUR: What do you mean? An African or European swallow?
From bouncefilter Mon Jan 10 15:21:29 2000
Received: from exchange2.usfreightways.com (usfreight-bh.usfreightways.com
[209.64.217.66]) by hub.org (8.9.3/8.9.3) with ESMTP id PAA33997
for <pgsql-general@postgreSQL.org>;
Mon, 10 Jan 2000 15:20:43 -0500 (EST)
(envelope-from Lhuynh@USFreightways.com)
Received: by EXCHANGE2 with Internet Mail Service (5.5.2448.0)
id <CQD775SH>; Mon, 10 Jan 2000 14:20:26 -0600
Message-ID: <21ECC9C81BC2D311A92B00805F6522990114EB@USFEXCH2>
From: "Huynh, Long" <Lhuynh@USFreightways.com>
To: pgsql-general@postgreSQL.org
Subject: RE: [GENERAL] Intro/Win9X
Date: Mon, 10 Jan 2000 14:16:09 -0600
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Content-Type: text/plain;
charset="iso-8859-1"
Well, is there NT version for evaluation?
-----Original Message-----
From: The Hermit Hacker [mailto:scrappy@hub.org]
Sent: Monday, January 10, 2000 12:45 PM
To: Dan Boutin
Cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Intro/Win9X
On Mon, 10 Jan 2000, Dan Boutin wrote:
Hi,
My name is Dan Boutin. I am just getting started exploring the
opportunities with Linux. I am currently developing a VB/SQL Server
application that I wish to run on PostgreSQL instead...mainly because of
the
cost savings it will give the customer.
I saw on the web site that there is a Win9X version available. Is there a
trial version that I can download so I can evaluate the product instead of
having to purchase the full Win9X product? I don't have a Linux box set
up
yet, but will do so soon, but I would like to evaluate PostgreSQL to see
if
it performs as well as SQL Server.
There is no Win9X version of PostgreSQL available, that I am aware
of...closest is WinNT...
************
From bouncefilter Mon Jan 10 23:22:36 2000
Received: from rasher.kpig.com (rasher.kpig.com [209.19.109.40])
by hub.org (8.9.3/8.9.3) with ESMTP id XAA38719
for <pgsql-general@postgresql.org>;
Mon, 10 Jan 2000 23:21:39 -0500 (EST)
(envelope-from wildbill@kpig.com)
Received: from wb229 (wb229.sunset.net [209.142.14.229])
by rasher.kpig.com (8.9.3/8.9.3) with SMTP id UAA12371
for <pgsql-general@postgresql.org>; Mon, 10 Jan 2000 20:19:59 -0800
Message-ID: <023301bf5beb$12bbc140$e50e8ed1@wb229.sunset.net>
From: "William Goldsmith" <wildbill@kpig.com>
To: <pgsql-general@postgresql.org>
Subject: initdb error
Date: Mon, 10 Jan 2000 20:19:31 -0800
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3612.1700
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700
Hi:
I'm installing Postgres 6.5.3 & got the following error, which I saw
mentioned many times in mailing list postings (which I had to access through
a google search, since the archives search function on the postgres site is
broken...) - no solution was ever posted, however.
[postgres@pork62 pgsql]$ initdb
initdb: using /usr/local/pgsql/lib/local1_template1.bki.source as input to
create the template database.
initdb: using /usr/local/pgsql/lib/global1.bki.source as input to create the
global classes.
initdb: using /usr/local/pgsql/lib/pg_hba.conf.sample as the host-based
authentication control file.
We are initializing the database system with username postgres (uid=100).
This user will own all the files and must also own the server process.
Creating Postgres database system directory /usr/local/pgsql/data/base
initdb: creating template database in /usr/local/pgsql/data/base/template1
Running: postgres -boot -C -F -D/usr/local/pgsql/data -Q template1
syntax error 2334 : parse error
Creating global classes in /base
Running: postgres -boot -C -F -D/usr/local/pgsql/data -Q template1
Adding template1 database to pg_database...
Running: postgres -boot -C -F -D/usr/local/pgsql/data -Q template1 <
/tmp/create.20010
ERROR: pg_atoi: error in "template1": can't parse "template1"
ERROR: pg_atoi: error in "template1": can't parse "template1"
initdb: could not log template database
initdb: cleaning up.
What's up?
thanks
bg
From bouncefilter Tue Jan 11 00:24:35 2000
Received: from rotec.sibnet.ru (rotec-gw.sibnet.ru [194.84.102.185])
by hub.org (8.9.3/8.9.3) with ESMTP id AAA51943
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 00:24:14 -0500 (EST)
(envelope-from A.S.Zakharov@inp.nsk.su)
Received: from magic (magic.rotec.sibnet.ru [10.1.1.1])
by rotec.sibnet.ru (8.9.3/8.9.3) with SMTP id NAA15736;
Tue, 11 Jan 2000 13:30:22 +0600
Message-ID: <000b01bf5bf4$08b523e0$0101010a@rotec.sibnet.ru>
From: "Alexei Zakharov" <A.S.Zakharov@inp.nsk.su>
To: <pgsql-general@postgreSQL.org>
Cc: "Huynh, Long" <Lhuynh@USFreightways.com>
References: <21ECC9C81BC2D311A92B00805F6522990114EB@USFEXCH2>
Subject: Re: [GENERAL] Intro/Win9X
Date: Tue, 11 Jan 2000 11:23:46 +0600
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
----- Original Message -----
From: Huynh, Long <Lhuynh@USFreightways.com>
To: <pgsql-general@postgreSQL.org>
Sent: Tuesday, January 11, 2000 2:16 AM
Subject: RE: [GENERAL] Intro/Win9X
Well, is there NT version for evaluation?
Well, there's no PostgreSQL evaluation. And what is more, Postgres is open
source.
From bouncefilter Tue Jan 11 01:21:36 2000
Received: from Viola.Opus1.COM (IDENT:unIDENTified@Viola.Opus1.COM
[192.245.12.8]) by hub.org (8.9.3/8.9.3) with ESMTP id BAA68817
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 01:21:20 -0500 (EST) (envelope-from ron@Opus1.COM)
Received: from opus1.com ([204.27.149.50]) by Opus1.COM (PMDF V5.2-32 #9830)
with ESMTPS id <01JKK2GH48LC9BZJBO@Opus1.COM> for
pgsql-general@postgreSQL.org; Mon, 10 Jan 2000 23:21:18 MST
Date: Mon, 10 Jan 2000 23:21:20 -0700
From: Ron Chmara <ron@Opus1.COM>
Subject: Re: [GENERAL] Intro/Win9X
To: Alexei Zakharov <A.S.Zakharov@inp.nsk.su>
Cc: pgsql-general@postgreSQL.org, "Huynh, Long" <Lhuynh@USFreightways.com>
Reply-to: ron@Opus1.COM
Message-id: <387ACBDB.C67368A0@opus1.com>
Organization: Ronin
MIME-version: 1.0
X-Mailer: Mozilla 4.7 (Macintosh; U; PPC)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
X-Accept-Language: en
References: <21ECC9C81BC2D311A92B00805F6522990114EB@USFEXCH2>
<000b01bf5bf4$08b523e0$0101010a@rotec.sibnet.ru>
Alexei Zakharov wrote:
----- Original Message -----
From: Huynh, Long <Lhuynh@USFreightways.com>
To: <pgsql-general@postgreSQL.org>
Sent: Tuesday, January 11, 2000 2:16 AM
Subject: RE: [GENERAL] Intro/Win9XWell, is there NT version for evaluation?
Well, there's no PostgreSQL evaluation. And what is more, Postgres is open
source.
Translation:
In a world without fences, who needs Gates?
It's free software, download the real thing, no fees, no per seat, no per user.
Really.
-Ronabop
From bouncefilter Wed Jan 12 01:57:33 2000
Received: from uclink4.berkeley.edu (uclink4.Berkeley.EDU [128.32.25.39])
by hub.org (8.9.3/8.9.3) with ESMTP id BAA01157
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 01:57:24 -0500 (EST)
(envelope-from makky@uclink4.berkeley.edu)
Received: from uclink4.berkeley.edu (makky4715390.HIP.Berkeley.EDU
[136.152.29.54])
by uclink4.berkeley.edu (8.8.8/8.8.8) with ESMTP id WAA21834
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 22:57:22 -0800 (PST)
Sender: root@uclink4.berkeley.edu
Message-ID: <387AD9E0.F98DFF59@uclink4.berkeley.edu>
Date: Mon, 10 Jan 2000 23:21:04 -0800
From: root <makky@uclink4.berkeley.edu>
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.0.32 i586)
X-Accept-Language: en
MIME-Version: 1.0
To: pgsql-general@postgresql.org
Subject: (no subject)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
lists
From bouncefilter Tue Jan 11 11:13:43 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id LAA14603
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 11:13:15 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id 30F6C1FE8; Tue, 11 Jan 2000 11:12:10 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1]) by pcr.ca (Postfix) with
ESMTP
id 1D09C1F91; Tue, 11 Jan 2000 11:12:10 +0000 (GMT)
Date: Tue, 11 Jan 2000 11:12:10 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: prlw1@cam.ac.uk
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Re: can't seem to use index
In-Reply-To: <20000111122712.C7663@quartz.newn.cam.ac.uk>
Message-ID: <Pine.BSF.4.10.10001111110270.58707-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Yes, I did try vacuum analyze, but my search query still uses a sequential
scan.
I then tried changing the btree index to a hash talbe and went through the
same procedure of vacumming and restarting a psql session. Yet again, the
index wasn't being used.But did you try vacuum analyze or just vacuum?
From bouncefilter Tue Jan 11 11:39:43 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id LAA22483
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 11:39:06 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id EA51B1FEC; Tue, 11 Jan 2000 11:38:02 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1]) by pcr.ca (Postfix) with
ESMTP
id D7F121FE8; Tue, 11 Jan 2000 11:38:02 +0000 (GMT)
Date: Tue, 11 Jan 2000 11:38:02 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: tesio@easynet.fr
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Re: can't seem to use index
In-Reply-To: <20000111131017.4948.qmail@web301.mail.yahoo.com>
Message-ID: <Pine.BSF.4.10.10001111128360.58707-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
I have changed the name field to a char(32) NOT NULL, and I still get a
sequential scan. I have added the 2500 records and I did "vacuumdb
database" from the command-line. Unfortunately, "vacuum analyze" from the
psql prompt returns a pqReadData() error, loses the connection to the
backend and returns me to the shell. After reconnecting to the database,
explain still returns a sequential scan when trying something like:
explain select * from manufacturer where name='3COM';
Thanks anyways for the tip, I've been using varchar() all over the place,
I think I'll change a few to char(). What are the advantages of using
char() instead of varchar(). For a sequential scan, explain returned a
cost of 105.44 for a char() field as opposed to 95.44 for a varchar().
Thanks again,
Marc
--- admin <admin@wtbwts.com> wrote:I'm trying to use an index on a varchar(32) field, but explain
keeps
retuning a sequential scan. This is my table and index:
CREATE TABLE manufacturer (
id int2,
name varchar(32)
);CREATE INDEX manu_name_idx ON "manufacturer" using btree ( "name"
"text_ops" );Do you really need a varchar ? I've got similar queries on a char
column which use the index. Maybe it's a problem about text_ops,
it may not be compatible with varchar.Alain
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
From bouncefilter Tue Jan 11 11:59:44 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id LAA25759
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 11:59:25 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id 3C6461FE8; Tue, 11 Jan 2000 11:58:21 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1]) by pcr.ca (Postfix) with
ESMTP
id 342EC1F91; Tue, 11 Jan 2000 11:58:21 +0000 (GMT)
Date: Tue, 11 Jan 2000 11:58:21 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: Frank Mandarino <fam@risca.com>
Cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Re: can't seem to use index
In-Reply-To: <00Jan11.114215est.115202@sky.risca.com>
Message-ID: <Pine.BSF.4.10.10001111148260.58707-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
I'm trying to use an index on a varchar(32) field, but explain keeps
retuning a sequential scan. This is my table and index:I had a similar problem last year when trying to use an index on a
char(8) field. Two solutions worked for me: 1) use "bpchar_ops", and
2) leave out the operator class altogether.
Thanks, it worked. After reading your previous message, I guess I will
omit the operator class altogether considering postgresql will most likely
make a better decision than me anyways.
Furthermore, since you seem to be quite familiar with this project, are
you aware of any documentation for fine tuning postgresql? For instance,
how can I make an educated decition whether to use char(32) or
varchar(32)? From the documentation, under /docs/user/datatype960.htm, all
four character types are shown in a table but there's no explanation as to
which would be preferable in certain situations. If using explain is the
way to go, it returned a higher cost for a sequential scan on a char()
field compared to a varchar() field. Unfortunately, I suspect using char()
does have some advantages I don't know about.
Maybe these are newbie preoccupations, but I suspect there are a few of us
out there. For the moment, the best tips I've received came from this
mailing list and maybe this is the way to go.
Thanks again for the help,
Marc
From bouncefilter Tue Jan 11 07:27:40 2000
Received: from henry.newn.cam.ac.uk (henry.newn.cam.ac.uk [131.111.204.130])
by hub.org (8.9.3/8.9.3) with ESMTP id HAA48441
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 07:27:14 -0500 (EST)
(envelope-from prlw1@newn.cam.ac.uk)
Received: from [131.111.204.180] (helo=quartz.newn.cam.ac.uk)
by henry.newn.cam.ac.uk with esmtp (Exim 2.12 #1)
id 1280ON-0003PI-00; Tue, 11 Jan 2000 12:27:19 +0000
Received: from prlw1 by quartz.newn.cam.ac.uk with local (Exim 2.12 #1)
id 1280OG-00021H-00; Tue, 11 Jan 2000 12:27:12 +0000
Date: Tue, 11 Jan 2000 12:27:12 +0000
From: Patrick Welche <prlw1@newn.cam.ac.uk>
To: admin <admin@wtbwts.com>
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Re: can't seem to use index
Message-ID: <20000111122712.C7663@quartz.newn.cam.ac.uk>
Reply-To: prlw1@cam.ac.uk
References: <Pine.BSF.4.10.10001092237130.50154-100000@server.b0x.com>
<Pine.BSF.4.10.10001101759580.54163-100000@server.b0x.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.1.1i
In-Reply-To: <Pine.BSF.4.10.10001101759580.54163-100000@server.b0x.com>;
from admin@wtbwts.com on Mon, Jan 10, 2000 at 06:07:07PM +0000
I then tried changing the btree index to a hash talbe and went through the
same procedure of vacumming and restarting a psql session. Yet again, the
index wasn't being used.
But did you try vacuum analyze or just vacuum?
From bouncefilter Tue Jan 11 13:18:44 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id NAA45864
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 13:17:48 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id 1F8201FE8; Tue, 11 Jan 2000 13:16:35 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1]) by pcr.ca (Postfix) with
ESMTP
id 15DDB1F8F; Tue, 11 Jan 2000 13:16:35 +0000 (GMT)
Date: Tue, 11 Jan 2000 13:16:35 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: Jeff Eckermann <jeckermann@verio.net>
Cc: "'pgsql-general@postgresql.org'" <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] Memory leak in FreeBSD?
In-Reply-To: <79103FDEF940D2118D9D00A0C9C9309CA35F95@NEZU>
Message-ID: <Pine.BSF.4.10.10001111316120.59108-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Did you upgrade from source or from the freebsd ports?
We upgraded to version 6.5.2 recently, running on FreeBSD 3.0. Now we are
having problems with moderately complex queries failing to complete (backend
terminating unexpectedly; last one crashed the server). The most likely
explanation appears to be a memory leak. Is there any known problem with
FreeBSD?
From bouncefilter Tue Jan 11 08:27:44 2000
Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236])
by hub.org (8.9.3/8.9.3) with ESMTP id IAA60625
for <pgsql-general@hub.org>; Tue, 11 Jan 2000 08:26:59 -0500 (EST)
(envelope-from peter@localhost.its.uu.se)
Received: from regulus.its.uu.se ([130.238.7.19]:63055 "EHLO
regulus.its.uu.se") by merganser.its.uu.se with ESMTP id
<S.sSmxw169994>; Tue, 11 Jan 2000 14:26:20 +0100
Received: from peter (helo=localhost)
by regulus.its.uu.se with local-esmtp (Exim 3.02 #2)
id 1281QC-0001R3-00; Tue, 11 Jan 2000 14:33:16 +0100
From: Peter Eisentraut <peter_e@gmx.net>
To: tesio@easynet.fr
cc: pgsql-general@hub.org
Subject: Re: [GENERAL] Dirty workaround to get the results and the errors in
the same output file
In-Reply-To: <20000110194819.12443.qmail@web303.mail.yahoo.com>
Message-ID: <Pine.LNX.4.21.0001110101530.364-100000@localhost.localdomain>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Sender: Peter Eisentraut <peter@hub.org>
Date: Tue, 11 Jan 2000 14:26:20 +0100
This sort of problem should be fixed in 7.0.
On 2000-01-10, Alain TESIO mentioned:
Hello,
Maybe you've experienced this problem too : when you have a huge
script with an error somewhere, it's a pain to find out what
line produced the error as you can't have the output of psql
with the queries and the error message in the same file.
I've tried psql ... 1>out 2>out, you the source queries at the
top of the file, and the messages from psql at the bottom.
Here's the trick which worked for me : replace stdout with
stderr in psql.c, and compile again psql. When you got an error,
the message is now just after the offending query.Alain
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com************
--
Peter Eisentraut Sernanders v�g 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden
From bouncefilter Tue Jan 11 13:39:44 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id NAA52347
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 13:39:13 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id A731E1FE8; Tue, 11 Jan 2000 13:38:09 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1]) by pcr.ca (Postfix) with
ESMTP
id 9EA371F8F; Tue, 11 Jan 2000 13:38:09 +0000 (GMT)
Date: Tue, 11 Jan 2000 13:38:09 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: Jeff Eckermann <jeckermann@verio.net>
Cc: "'pgsql-general@postgresql.org'" <pgsql-general@postgreSQL.org>
Subject: RE: [GENERAL] Memory leak in FreeBSD?
In-Reply-To: <79103FDEF940D2118D9D00A0C9C9309CA35F99@NEZU>
Message-ID: <Pine.BSF.4.10.10001111335570.59143-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
What is maxusers set to in your kernel? One prolem I had was that
postgresql was using more filedescriptors that my kernel could handle. If
you'd like to check your current filedescriptor status and your max, try:
pstat -T. If that is your problem, change your maxusers to a suitable
number and recompile your kernel.
FreeBSD port: I don't know enough to know what difference that might make.
Any suggestion you have would be appreciated: thanks.Did you upgrade from source or from the freebsd ports?
We upgraded to version 6.5.2 recently, running on FreeBSD 3.0. Now we
are
having problems with moderately complex queries failing to complete
(backend
terminating unexpectedly; last one crashed the server). The most likely
explanation appears to be a memory leak. Is there any known problemwith
FreeBSD?
From bouncefilter Tue Jan 11 09:23:41 2000
Received: from oceanic.wsisiz.edu.pl (root@oceanic.wsisiz.edu.pl
[195.205.208.33]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA84250
for <pgsql-general@hub.org>; Tue, 11 Jan 2000 09:23:30 -0500 (EST)
(envelope-from marn@wsisiz.edu.pl)
Received: from localhost (marn@localhost)
by oceanic.wsisiz.edu.pl (8.10.0.Beta10/8.10.0.Beta10) with ESMTP id
e0BENGS10512
for <pgsql-general@hub.org>; Tue, 11 Jan 2000 15:23:16 +0100
Date: Tue, 11 Jan 2000 15:23:16 +0100 (CET)
From: Marcin Inkielman <marn@wsisiz.edu.pl>
To: pgsql-general@hub.org
Subject: logs
In-Reply-To: <947598615.387b351722fc7@barq.dynip.com>
Message-ID: <Pine.LNX.4.21.0001111519490.8353-100000@oceanic.wsisiz.edu.pl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
hi!
sorry for my stupid question...
is it possible to view logs of postmaster?
i remarked a file named pg_log - what is it for?
************************************
Marcin Inkielman
************************************
.~.
/V\
// \\
/( )\
^`~'^
powered by Linux
----
sibi omino similis?
************************************
From bouncefilter Tue Jan 11 09:57:42 2000
Received: from exchange2.usfreightways.com (usfreight-bh.usfreightways.com
[209.64.217.66]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA93603
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 09:57:27 -0500 (EST)
(envelope-from Lhuynh@USFreightways.com)
Received: by EXCHANGE2 with Internet Mail Service (5.5.2448.0)
id <CQD770S1>; Tue, 11 Jan 2000 08:57:11 -0600
Message-ID: <21ECC9C81BC2D311A92B00805F6522990114F2@USFEXCH2>
From: "Huynh, Long" <Lhuynh@USFreightways.com>
To: pgsql-general@postgreSQL.org
Subject: RE: [GENERAL] Intro/Win9X
Date: Tue, 11 Jan 2000 08:52:27 -0600
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Content-Type: text/plain;
charset="iso-8859-1"
I think I've got it thank you every much for your hints.
-----Original Message-----
From: Ron Chmara [mailto:ron@Opus1.COM]
Sent: Tuesday, January 11, 2000 12:21 AM
To: Alexei Zakharov
Cc: pgsql-general@postgreSQL.org; Huynh, Long
Subject: Re: [GENERAL] Intro/Win9X
Alexei Zakharov wrote:
----- Original Message -----
From: Huynh, Long <Lhuynh@USFreightways.com>
To: <pgsql-general@postgreSQL.org>
Sent: Tuesday, January 11, 2000 2:16 AM
Subject: RE: [GENERAL] Intro/Win9XWell, is there NT version for evaluation?
Well, there's no PostgreSQL evaluation. And what is more, Postgres is
open
source.
Translation:
In a world without fences, who needs Gates?
It's free software, download the real thing, no fees, no per seat, no per
user.
Really.
-Ronabop
************
From bouncefilter Tue Jan 11 10:33:42 2000
Received: from rage.hub.org (root@nat193.192.mpoweredpc.net [142.177.193.192])
by hub.org (8.9.3/8.9.3) with ESMTP id KAA05512
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 10:33:27 -0500 (EST) (envelope-from jeff@hub.org)
Received: from localhost (jeff@localhost)
by rage.hub.org (8.9.3/8.9.3) with ESMTP id LAA00617;
Tue, 11 Jan 2000 11:32:32 -0400 (AST) (envelope-from jeff@hub.org)
X-Authentication-Warning: rage.hub.org: jeff owned process doing -bs
Date: Tue, 11 Jan 2000 11:32:32 -0400 (AST)
From: Jeff MacDonald <jeff@hub.org>
Reply-To: Jeff MacDonald <jeff@hub.org>
To: Ron Chmara <ron@Opus1.COM>
cc: Alexei Zakharov <A.S.Zakharov@inp.nsk.su>, pgsql-general@postgreSQL.org,
"Huynh, Long" <Lhuynh@USFreightways.com>
Subject: Re: [GENERAL] Intro/Win9X
In-Reply-To: <387ACBDB.C67368A0@opus1.com>
Message-ID: <Pine.BSF.4.10.10001111131240.428-100000@rage.hub.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
greets,
does anyone ever look in ftp://ftp.postgresql.org/pub ?
there is a precompiled nt binary in there. has been for a while.
jeff
On Mon, 10 Jan 2000, Ron Chmara wrote:
Alexei Zakharov wrote:
----- Original Message -----
From: Huynh, Long <Lhuynh@USFreightways.com>
To: <pgsql-general@postgreSQL.org>
Sent: Tuesday, January 11, 2000 2:16 AM
Subject: RE: [GENERAL] Intro/Win9XWell, is there NT version for evaluation?
Well, there's no PostgreSQL evaluation. And what is more, Postgres is open
source.Translation:
In a world without fences, who needs Gates?
It's free software, download the real thing, no fees, no per seat, no per user.Really.
-Ronabop
************
Jeff MacDonald
jeff@hub.org
===================================================================
So long as the Universe had a beginning, we can suppose it had a
creator, but if the Universe is completly self contained , having
no boundry or edge, it would neither be created nor destroyed
It would simply be.
===================================================================
From bouncefilter Tue Jan 11 11:22:43 2000
Received: from PMESMTP02.wcom.com (pmesmtp02.wcom.com [199.249.20.2])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA16372
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 11:22:07 -0500 (EST)
(envelope-from rrothe@mindspring.com)
Received: from CONVERSION-DAEMON by firewall.mcit.com (PMDF V5.2-32 #41713)
id <0FO600401IQAYF@firewall.mcit.com> for pgsql-general@postgresql.org;
Tue, 11 Jan 2000 16:20:34 +0000 (GMT)
Received: from ndcrelay2.mcit.com ([166.37.172.6])
by firewall.mcit.com (PMDF V5.2-32 #41713)
with ESMTP id <0FO60046BIQABG@firewall.mcit.com> for
pgsql-general@postgresql.org; Tue, 11 Jan 2000 16:20:34 +0000 (GMT)
Received: from omzmta01.mcit.com (omzmta01.mcit.com [166.37.194.119])
by ndcrelay2.mcit.com (8.8.7/) with ESMTP id QAA15725 for
<pgsql-general@postgresql.org>; Tue, 11 Jan 2000 16:15:29 +0000 (GMT)
Received: from mindspring.com ([166.42.215.139])
by omzmta01.mcit.com (InterMail v03.02.05 118 121 101)
with ESMTP id <20000111162032.XVLH8286@mindspring.com> for
<pgsql-general@postgresql.org>; Tue, 11 Jan 2000 16:20:32 +0000
Date: Tue, 11 Jan 2000 11:17:31 -0500
From: Robert Rothe <rrothe@mindspring.com>
Subject: Question on timestamp in psql
To: pgsql-general@postgresql.org
Message-id: <387B579B.D1E7545E@mindspring.com>
MIME-version: 1.0
X-Mailer: Mozilla 4.61 [en] (Win95; I)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
X-Accept-Language: en,pdf
When I type the following at the psql prompt:
select timestamp('now');
...I always get december 31, 1999.
If I use 'now' as the rvalue to a SET, or within an INSERT, it returns
the correct date.
Is this a known problem? I'm running 6.5.2-1.
Thanks,
Rob
From bouncefilter Tue Jan 11 11:32:43 2000
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA21382
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 11:31:49 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id
LAA10481;
Tue, 11 Jan 2000 11:28:39 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001111628.LAA10481@candle.pha.pa.us>
Subject: Re: [GENERAL] Question on timestamp in psql
In-Reply-To: <387B579B.D1E7545E@mindspring.com> from Robert Rothe at "Jan 11,
2000 11:17:31 am"
To: Robert Rothe <rrothe@mindspring.com>
Date: Tue, 11 Jan 2000 11:28:39 -0500 (EST)
CC: pgsql-general@postgreSQL.org
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
When I type the following at the psql prompt:
select timestamp('now');
...I always get december 31, 1999.
If I use 'now' as the rvalue to a SET, or within an INSERT, it returns
the correct date.Is this a known problem? I'm running 6.5.2-1.
Yikes, confirmed in current sources:
test=> select timestamp('now');
timestamp
------------------------
1999-12-31 19:00:00-05
(1 row)
This works:
test=> select timestamp('now'::timestamp);
timestamp
------------------------
2000-01-11 11:28:08-05
(1 row)
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From bouncefilter Tue Jan 11 11:41:43 2000
Received: from risca.com (sky.risca.com [204.92.74.3])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA22725
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 11:40:48 -0500 (EST) (envelope-from fam@risca.com)
Received: by sky.risca.com id <115202>; Tue, 11 Jan 2000 11:42:15 -0500
From: Frank Mandarino <fam@risca.com>
To: admin <admin@wtbwts.com>
cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Re: can't seem to use index
In-Reply-To: <Pine.BSF.4.10.10001101759580.54163-100000@server.b0x.com>
Message-Id: <00Jan11.114215est.115202@sky.risca.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Date: Tue, 11 Jan 2000 11:42:14 -0500
On Mon, 10 Jan 2000, admin wrote:
Following a few suggestions, I have entered 2500 records in the
manufacturer table. Unfortunately, searching for name in the manufacturer
table still returned a sequential scan.I then tried changing the btree index to a hash talbe and went through the
same procedure of vacumming and restarting a psql session. Yet again, the
index wasn't being used.Finally, I decided to create an index for id as follows:
CREATE INDEX manu_id_idx ON "manufacturer" using btree ("id" "int2_ops");Then, when trying a similar search on the id field, it used the index.
Unfortunately, I still can't seem to make postgresql use the index for
searching the name field.Any other suggestions would be appreciated,
MarcI'm trying to use an index on a varchar(32) field, but explain keeps
retuning a sequential scan. This is my table and index:CREATE TABLE manufacturer (
id int2,
name varchar(32)
);CREATE INDEX manu_name_idx ON "manufacturer" using btree ( "name"
"text_ops" );Both my table and index have been created successfully, and the database
has been vacuumed. Then I run the following query from the psql
command-line:
explain select * from manufacturer where name='3COM';... and I get a sequential scan! What gives?
Any suggestions would be greatly appreciated,
Marc************
Marc,
I had a similar problem last year when trying to use an index on a
char(8) field. Two solutions worked for me: 1) use "bpchar_ops", and
2) leave out the operator class altogether.
I have attached the response from Gene Selkov, Jr. which suggested that
I let PostgreSQL pick the operator class.
Perhaps leaving out the "text_ops" will help.
Regards,
../fam
--
Frank A. Mandarino
fam@risca.com
--- Forwarded message ----
Date: Thu, 7 Oct 1999 00:42:58 -0400
From: "Gene Selkov, Jr." <selkovjr@mcs.anl.gov>
To: Frank Mandarino <fam@risca.com>, pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] btree index on a char(8) field (fwd)
I am unable to find any reference to bpchar_ops in the the documentation
or the General and SQL mailing list archives. Can you tell me where I
could find out more about what "_ops" are available and what they all
mean?
The direct answer:
$ pwd
/usr/src/postgresql-6.5/doc/src/sgml
$ find -name "*sgml" -exec grep -il "_ops" {} \;
./ref/create_index.sgml
./arch-dev.sgml -- irrelevant: co-incidental with a processing directive, \label{simple_set_ops})
./bki.sgml
./gist.sgml
./xindex.sgml
My comment:
The deficiency of the docs in regards to operator classes probably
results from the fact that no one is asking about those. The opclass
parameter in CREATE INDEX is no longer required (Herouth has been
around long enough to recall the times when it was).
As you have just witnessed, in a standard situation, you are better
off without knowing about it -- postgres will pick the right opclass
for you. That will not happen, however, when the values you want to
index are of a custom type, or when a built-in type does not have an
opclass of its own (as is the case with the point type). Also, you
need this option to override the default opclass for those types that
can work with multiple opclasses (which is what you attempted to
achieve).
Will anyone with a solid knowledge of the type system want to augment
the existing docs?
--Gene
************
From bouncefilter Tue Jan 11 12:08:43 2000
Received: from portal.west.saic.com (portal.west.saic.com [198.151.12.15])
by hub.org (8.9.3/8.9.3) with SMTP id MAA30234;
Tue, 11 Jan 2000 12:08:04 -0500 (EST)
(envelope-from officers@aries.tucson.saic.com)
Received: from gatespass.tucson.saic.com by portal.west.saic.com
via smtpd (for postgresql.org [216.126.84.28]) with SMTP;
11 Jan 2000 17:08:03 UT
Received: (from adm@localhost) by gatespass.tucson.saic.com (8.8.2/8.8.2) id
KAA01688; Tue, 11 Jan 2000 10:08:02 -0700 (MST)
X-Authentication-Warning: gatespass.tucson.saic.com: adm set sender to
<officers@aries.tucson.saic.com> using -f
Received: from wasp.tucson.saic.com(139.121.3.171) by
gatespass.tucson.saic.com via smap (V2.0)
id xma001686; Tue, 11 Jan 00 10:07:38 -0700
Received: from aries.tucson.saic.com (localhost [127.0.0.1]) by
wasp.tucson.saic.com (980427.SGI.8.8.8/950213.SGI.AUTOCF) via
ESMTP id KAA42074; Tue, 11 Jan 2000 10:07:37 -0700 (MST)
Sender: officers@aries.tucson.saic.com
Message-ID: <387B6359.3CE06015@aries.tucson.saic.com>
Date: Tue, 11 Jan 2000 10:07:37 -0700
From: Sarah Officer <officers@aries.tucson.saic.com>
X-Mailer: Mozilla 4.07C-SGI [en] (X11; I; IRIX 6.5 IP32)
MIME-Version: 1.0
To: pgsql-general@postgresql.org
CC: webmaster@postgresql.org
Subject: views containing agregates questions
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
In the docs directory of the 6.5.3 distribution, I was browsing
through the TODO file. There is a note there:
'Views containing aggregates sometimes fail(Jan)'
In what way do they fail? I need to create several views with
aggregates, and I'm concerned about what the effect will be. I
tried to search the archives on the postgres page, but when I enter
a keyword such as 'view', I get the message "Can't open template
file 'views '!".
Any information on the views/aggregate functions problem would be
appreciated.
Sarah Officer
officers@aries.tucson.saic.com
From bouncefilter Tue Jan 11 12:44:44 2000
Received: from risca.com (sky.risca.com [204.92.74.3])
by hub.org (8.9.3/8.9.3) with ESMTP id MAA38064
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 12:43:46 -0500 (EST) (envelope-from fam@risca.com)
Received: by sky.risca.com id <115201>; Tue, 11 Jan 2000 12:45:18 -0500
From: Frank Mandarino <fam@risca.com>
To: admin <admin@wtbwts.com>
cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Re: can't seem to use index
In-Reply-To: <Pine.BSF.4.10.10001111148260.58707-100000@server.b0x.com>
Message-Id: <00Jan11.124518est.115201@sky.risca.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Date: Tue, 11 Jan 2000 12:45:16 -0500
On Tue, 11 Jan 2000, admin wrote:
I'm trying to use an index on a varchar(32) field, but explain keeps
retuning a sequential scan. This is my table and index:I had a similar problem last year when trying to use an index on a
char(8) field. Two solutions worked for me: 1) use "bpchar_ops", and
2) leave out the operator class altogether.Thanks, it worked. After reading your previous message, I guess I will
omit the operator class altogether considering postgresql will most likely
make a better decision than me anyways.Furthermore, since you seem to be quite familiar with this project, are
you aware of any documentation for fine tuning postgresql? For instance,
how can I make an educated decition whether to use char(32) or
varchar(32)? From the documentation, under /docs/user/datatype960.htm, all
four character types are shown in a table but there's no explanation as to
which would be preferable in certain situations. If using explain is the
way to go, it returned a higher cost for a sequential scan on a char()
field compared to a varchar() field. Unfortunately, I suspect using char()
does have some advantages I don't know about.Maybe these are newbie preoccupations, but I suspect there are a few of us
out there. For the moment, the best tips I've received came from this
mailing list and maybe this is the way to go.Thanks again for the help,
Marc
Marc,
I am happy to hear that the index is working, but I really can't take
any credit. I was only passing on information that I gained from these
mailing lists because I was in a similar situation once and I greatly
appreciated the help provided by Herouth Maoz and Gene Selkov, Jr.
Also, I am not that familiar with this project, so I don't have any fine
tuning suggestions for you. If you do find out any information about
the advantages of each of the character types, I'm sure it would be
useful to many subscribers of this list, including myself.
Regards,
../fam
--
Frank A. Mandarino
fam@risca.com
From bouncefilter Tue Jan 11 12:54:44 2000
Received: from nezu.gs.verio.net (nezu.gs.verio.net [204.27.67.227])
by hub.org (8.9.3/8.9.3) with ESMTP id MAA39275
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 12:53:56 -0500 (EST)
(envelope-from jeckermann@verio.net)
Received: by NEZU with Internet Mail Service (5.5.2650.21)
id <CN755419>; Tue, 11 Jan 2000 11:53:55 -0600
Message-ID: <79103FDEF940D2118D9D00A0C9C9309CA35F95@NEZU>
From: Jeff Eckermann <jeckermann@verio.net>
To: "'pgsql-general@postgresql.org'" <pgsql-general@postgresql.org>
Subject: Memory leak in FreeBSD?
Date: Tue, 11 Jan 2000 11:53:54 -0600
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain
We upgraded to version 6.5.2 recently, running on FreeBSD 3.0. Now we are
having problems with moderately complex queries failing to complete (backend
terminating unexpectedly; last one crashed the server). The most likely
explanation appears to be a memory leak. Is there any known problem with
FreeBSD?
From bouncefilter Tue Jan 11 13:15:44 2000
Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60])
by hub.org (8.9.3/8.9.3) with ESMTP id NAA45614
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 13:15:08 -0500 (EST) (envelope-from scrappy@hub.org)
Received: from localhost (scrappy@localhost)
by thelab.hub.org (8.9.3/8.9.1) with ESMTP id OAA54297;
Tue, 11 Jan 2000 14:14:55 -0400 (AST) (envelope-from scrappy@hub.org)
X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs
Date: Tue, 11 Jan 2000 14:14:54 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org>
To: Jeff Eckermann <jeckermann@verio.net>
cc: "'pgsql-general@postgresql.org'" <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] Memory leak in FreeBSD?
In-Reply-To: <79103FDEF940D2118D9D00A0C9C9309CA35F95@NEZU>
Message-ID: <Pine.BSF.4.21.0001111413540.46499-100000@thelab.hub.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Tue, 11 Jan 2000, Jeff Eckermann wrote:
We upgraded to version 6.5.2 recently, running on FreeBSD 3.0. Now we are
having problems with moderately complex queries failing to complete (backend
terminating unexpectedly; last one crashed the server). The most likely
explanation appears to be a memory leak. Is there any known problem with
FreeBSD?
None that I'm aware of that is specific to FreeBSD ... I run several
FreeBSD boxen with PostgreSQL on them...
... you arent' running a virgin FreeBSD 3.0 system though, are
you? *raised eyebrow*
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
From bouncefilter Tue Jan 11 13:26:44 2000
Received: from oceanic.wsisiz.edu.pl (root@oceanic.wsisiz.edu.pl
[195.205.208.33]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA46875
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 13:25:49 -0500 (EST)
(envelope-from marn@wsisiz.edu.pl)
Received: from localhost (marn@localhost)
by oceanic.wsisiz.edu.pl (8.10.0.Beta10/8.10.0.Beta10) with ESMTP id
e0BIPln32295
for <pgsql-general@postgresql.org>; Tue, 11 Jan 2000 19:25:47 +0100
Date: Tue, 11 Jan 2000 19:25:47 +0100 (CET)
From: Marcin Inkielman <marn@wsisiz.edu.pl>
To: pgsql-general@postgresql.org
Subject: logs
Message-ID: <Pine.LNX.4.21.0001111923240.21609-100000@oceanic.wsisiz.edu.pl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
hi!
sorry for my stupid question...
is it possible to view logs of postmaster?
i remarked a file named pg_log - what is it for?
************************************
Marcin Inkielman
************************************
.~.
/V\
// \\
/( )\
^`~'^
powered by Linux
----
sibi omino similis?
************************************
From bouncefilter Tue Jan 11 13:28:44 2000
Received: from nezu.gs.verio.net (nezu.gs.verio.net [204.27.67.227])
by hub.org (8.9.3/8.9.3) with ESMTP id NAA47304
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 13:28:22 -0500 (EST)
(envelope-from jeckermann@verio.net)
Received: by NEZU with Internet Mail Service (5.5.2650.21)
id <CN7554H7>; Tue, 11 Jan 2000 12:28:21 -0600
Message-ID: <79103FDEF940D2118D9D00A0C9C9309CA35F99@NEZU>
From: Jeff Eckermann <jeckermann@verio.net>
To: "'admin'" <admin@wtbwts.com>
Cc: "'pgsql-general@postgresql.org'" <pgsql-general@postgreSQL.org>
Subject: RE: [GENERAL] Memory leak in FreeBSD?
Date: Tue, 11 Jan 2000 12:28:21 -0600
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain
FreeBSD port: I don't know enough to know what difference that might make.
Any suggestion you have would be appreciated: thanks.
-----Original Message-----
From: admin [SMTP:admin@wtbwts.com]
Sent: Tuesday, January 11, 2000 12:18 PM
To: Jeff Eckermann
Cc: 'pgsql-general@postgresql.org'
Subject: Re: [GENERAL] Memory leak in FreeBSD?Did you upgrade from source or from the freebsd ports?
We upgraded to version 6.5.2 recently, running on FreeBSD 3.0. Now we
are
having problems with moderately complex queries failing to complete
(backend
terminating unexpectedly; last one crashed the server). The most likely
explanation appears to be a memory leak. Is there any known problemwith
FreeBSD?
From bouncefilter Tue Jan 11 14:02:45 2000
Received: from nezu.gs.verio.net (nezu.gs.verio.net [204.27.67.227])
by hub.org (8.9.3/8.9.3) with ESMTP id OAA58538
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 14:02:00 -0500 (EST)
(envelope-from jeckermann@verio.net)
Received: by NEZU with Internet Mail Service (5.5.2650.21)
id <CN7554J0>; Tue, 11 Jan 2000 13:01:59 -0600
Message-ID: <79103FDEF940D2118D9D00A0C9C9309CA35F9B@NEZU>
From: Jeff Eckermann <jeckermann@verio.net>
To: "'admin'" <admin@wtbwts.com>
Cc: "'pgsql-general@postgresql.org'" <pgsql-general@postgreSQL.org>
Subject: RE: [GENERAL] Memory leak in FreeBSD?
Date: Tue, 11 Jan 2000 13:01:58 -0600
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain
Maxusers is set to 128. RAM is 256Mg.
Do you think this could be the problem?
-----Original Message-----
From: admin [SMTP:admin@wtbwts.com]
Sent: Tuesday, January 11, 2000 12:50 PM
To: Jeff Eckermann
Cc: 'pgsql-general@postgresql.org'
Subject: RE: [GENERAL] Memory leak in FreeBSD?What is maxusers set to in your kernel? One prolem I had was that
postgresql was using more filedescriptors that my kernel could handle. If
you'd like to check your current filedescriptor status and your max, try:
pstat -T. If that is your problem, change your maxusers to a suitable
number and recompile your kernel.FreeBSD port: I don't know enough to know what difference that might
make.
Any suggestion you have would be appreciated: thanks.
Did you upgrade from source or from the freebsd ports?
We upgraded to version 6.5.2 recently, running on FreeBSD 3.0. Now
we
are
having problems with moderately complex queries failing to complete
(backend
terminating unexpectedly; last one crashed the server). The most
likely
explanation appears to be a memory leak. Is there any known problem
with
FreeBSD?
************
From bouncefilter Tue Jan 11 14:12:45 2000
Received: from mail.austin.rr.com (sm1.texas.rr.com [24.93.35.54])
by hub.org (8.9.3/8.9.3) with ESMTP id OAA66532
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 14:12:00 -0500 (EST)
(envelope-from eloehr@austin.rr.com)
Received: from austin.rr.com ([24.27.30.243]) by mail.austin.rr.com with
Microsoft SMTPSVC(5.5.1877.197.19); Tue, 11 Jan 2000 13:12:28 -0600
Sender: ed
Message-ID: <387B80D8.6223C834@austin.rr.com>
Date: Tue, 11 Jan 2000 13:13:28 -0600
From: Ed Loehr <eloehr@austin.rr.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20smp i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Robert Rothe <rrothe@mindspring.com>
CC: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Question on timestamp in psql
References: <387B579B.D1E7545E@mindspring.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Robert Rothe wrote:
When I type the following at the psql prompt:
select timestamp('now');
Try
select timestamp(now());
Cheers,
Ed Loehr
From bouncefilter Tue Jan 11 14:27:45 2000
Received: from mail.austin.rr.com (sm1.texas.rr.com [24.93.35.54])
by hub.org (8.9.3/8.9.3) with ESMTP id OAA68452
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 14:27:12 -0500 (EST)
(envelope-from eloehr@austin.rr.com)
Received: from austin.rr.com ([24.27.30.243]) by mail.austin.rr.com with
Microsoft SMTPSVC(5.5.1877.197.19); Tue, 11 Jan 2000 13:27:41 -0600
Sender: ed
Message-ID: <387B8469.B277AA6E@austin.rr.com>
Date: Tue, 11 Jan 2000 13:28:41 -0600
From: Ed Loehr <eloehr@austin.rr.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20smp i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Marcin Inkielman <marn@wsisiz.edu.pl>
CC: pgsql-general@postgresql.org
Subject: Re: [GENERAL] logs
References: <Pine.LNX.4.21.0001111923240.21609-100000@oceanic.wsisiz.edu.pl>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Marcin Inkielman wrote:
hi!
sorry for my stupid question...
is it possible to view logs of postmaster?
The pole:
http://www.postgresql.org/docs/postgres/postmaster.htm
http://www.postgresql.org/docs/postgres/pg-options.htm
http://www.deja.com
The fish:
% echo 'query' >> $PGDATA/pg_options
% killall postmaster
% postmaster >> pgserver.log &
% tail -f pgserver.log
Cheers,
Ed Loehr
From bouncefilter Tue Jan 11 15:24:46 2000
Received: from fw.wintelcom.net (bright@ns1.wintelcom.net [209.1.153.20])
by hub.org (8.9.3/8.9.3) with ESMTP id PAA84333
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 15:24:23 -0500 (EST)
(envelope-from bright@fw.wintelcom.net)
Received: (from bright@localhost)
by fw.wintelcom.net (8.9.3/8.9.3) id MAA21298;
Tue, 11 Jan 2000 12:47:38 -0800 (PST)
Date: Tue, 11 Jan 2000 12:47:38 -0800
From: Alfred Perlstein <bright@wintelcom.net>
To: Jeff Eckermann <jeckermann@verio.net>
Cc: "'admin'" <admin@wtbwts.com>,
"'pgsql-general@postgresql.org'" <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] Memory leak in FreeBSD?
Message-ID: <20000111124738.N9397@fw.wintelcom.net>
References: <79103FDEF940D2118D9D00A0C9C9309CA35F9B@NEZU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0i
In-Reply-To: <79103FDEF940D2118D9D00A0C9C9309CA35F9B@NEZU>;
from jeckermann@verio.net on Tue, Jan 11, 2000 at 01:01:58PM -0600
* Jeff Eckermann <jeckermann@verio.net> [000111 11:37] wrote:
-----Original Message-----
From: admin [SMTP:admin@wtbwts.com]
Sent: Tuesday, January 11, 2000 12:50 PM
To: Jeff Eckermann
Cc: 'pgsql-general@postgresql.org'
Subject: RE: [GENERAL] Memory leak in FreeBSD?What is maxusers set to in your kernel? One prolem I had was that
postgresql was using more filedescriptors that my kernel could handle. If
you'd like to check your current filedescriptor status and your max, try:
pstat -T. If that is your problem, change your maxusers to a suitable
number and recompile your kernel.Maxusers is set to 128. RAM is 256Mg.
Do you think this could be the problem?
Saying it's a memory leak without describing any other sort of symptoms is
not a very useful bug report. Twiddling maxusers should have _no_ effect
on whether an application leaks memory or not.
So how about you explain the symptoms of the 'leak' (kernel messages,
top, systat -vmstat) and what exactly you mean by it. Does the postmaster
gradually increase in memory size until the machine starts swapping? If
not, then it's probably _not_ a memory leak.
thanks,
-Alfred Perlstein - [bright@rush.net|alfred@freebsd.org]
Wintelcom systems administrator and programmer
- http://www.wintelcom.net/ [bright@wintelcom.net]
FreeBSD port: I don't know enough to know what difference that might
make.
Any suggestion you have would be appreciated: thanks.
Did you upgrade from source or from the freebsd ports?
We upgraded to version 6.5.2 recently, running on FreeBSD 3.0. Now
we
are
having problems with moderately complex queries failing to complete
(backend
terminating unexpectedly; last one crashed the server). The most
likely
explanation appears to be a memory leak. Is there any known problem
with
FreeBSD?
************
************
From bouncefilter Tue Jan 11 16:42:47 2000
Received: from portal.west.saic.com (portal.west.saic.com [198.151.12.15])
by hub.org (8.9.3/8.9.3) with SMTP id QAA03485
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 16:42:24 -0500 (EST)
(envelope-from officers@aries.tucson.saic.com)
Received: from gatespass.tucson.saic.com by portal.west.saic.com
via smtpd (for postgresql.org [216.126.84.28]) with SMTP;
11 Jan 2000 21:42:23 UT
Received: (from adm@localhost) by gatespass.tucson.saic.com (8.8.2/8.8.2) id
OAA03726 for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 14:42:22 -0700 (MST)
X-Authentication-Warning: gatespass.tucson.saic.com: adm set sender to
<officers@aries.tucson.saic.com> using -f
Received: from wasp.tucson.saic.com(139.121.3.171) by
gatespass.tucson.saic.com via smap (V2.0)
id xma003724; Tue, 11 Jan 00 14:42:00 -0700
Received: from aries.tucson.saic.com (localhost [127.0.0.1]) by
wasp.tucson.saic.com (980427.SGI.8.8.8/950213.SGI.AUTOCF) via
ESMTP id OAA44074 for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 14:41:59 -0700 (MST)
Sender: officers@aries.tucson.saic.com
Message-ID: <387BA3A7.6F937A4D@aries.tucson.saic.com>
Date: Tue, 11 Jan 2000 14:41:59 -0700
From: Sarah Officer <officers@aries.tucson.saic.com>
X-Mailer: Mozilla 4.07C-SGI [en] (X11; I; IRIX 6.5 IP32)
MIME-Version: 1.0
To: pgsql-general@postgresql.org
Subject: constant column value in view with union
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I am converting some Oracle stuff to Postgres (or attempting to
convert it :) ), and I'm having trouble with my views. I have
figured out the syntax difference between Oracle & Postgres, I
think, but Postgres doesn't seem to know the type of a constant text
column. How can I make this work?
The view is something like this:
create view Foo as
select a, b, c, 'OK' as status
from table1
where ...
union
select a, b, c, 'BAD' as status
from table1
where ...
My Oracle view has 4 unions with fairly complicated where clauses.
What I want to do in the end is
select status from Foo where b = 'baz';
In Oracle, the system figures out that status is a text column. In
Postgres I am warned:
NOTICE: Attribute 'alert_status' has an unknown type
Relation created; continue
Whey I type
\d Foo
Postgres responds
ERROR: typeidTypeRelid: Invalid type - oid = 0
Any suggestions would be appreciated.
Thanks,
Sarah Officer
officers@aries.tucson.saic.com
From bouncefilter Tue Jan 11 17:01:51 2000
Received: from portal.west.saic.com (portal.west.saic.com [198.151.12.15])
by hub.org (8.9.3/8.9.3) with SMTP id RAA07110
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 17:00:57 -0500 (EST)
(envelope-from officers@aries.tucson.saic.com)
Received: from gatespass.tucson.saic.com by portal.west.saic.com
via smtpd (for postgresql.org [216.126.84.28]) with SMTP;
11 Jan 2000 22:00:56 UT
Received: (from adm@localhost) by gatespass.tucson.saic.com (8.8.2/8.8.2) id
PAA04004 for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 15:00:54 -0700 (MST)
X-Authentication-Warning: gatespass.tucson.saic.com: adm set sender to
<officers@aries.tucson.saic.com> using -f
Received: from wasp.tucson.saic.com(139.121.3.171) by
gatespass.tucson.saic.com via smap (V2.0)
id xma004000; Tue, 11 Jan 00 15:00:33 -0700
Received: from aries.tucson.saic.com (localhost [127.0.0.1]) by
wasp.tucson.saic.com (980427.SGI.8.8.8/950213.SGI.AUTOCF) via
ESMTP id PAA44300 for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 15:00:31 -0700 (MST)
Sender: officers@aries.tucson.saic.com
Message-ID: <387BA7FF.6465C6BD@aries.tucson.saic.com>
Date: Tue, 11 Jan 2000 15:00:31 -0700
From: Sarah Officer <officers@aries.tucson.saic.com>
X-Mailer: Mozilla 4.07C-SGI [en] (X11; I; IRIX 6.5 IP32)
MIME-Version: 1.0
To: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] constant column value in view with union
References: <387BA3A7.6F937A4D@aries.tucson.saic.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Oh dear. The problem I mentioned here occured when I just based my
view on one select statement. When I add the union clause, I am
informed that views can't handle unions. Is there a standard
work-around? I'm afraid I was planning a couple of other views
which look at this one.
Thanks,
Sarah Officer
officers@aries.tucson.saic.com
Sarah Officer wrote:
I am converting some Oracle stuff to Postgres (or attempting to
convert it :) ), and I'm having trouble with my views. I have
figured out the syntax difference between Oracle & Postgres, I
think, but Postgres doesn't seem to know the type of a constant text
column. How can I make this work?The view is something like this:
create view Foo as
select a, b, c, 'OK' as status
from table1
where ...
union
select a, b, c, 'BAD' as status
from table1
where ...My Oracle view has 4 unions with fairly complicated where clauses.
What I want to do in the end isselect status from Foo where b = 'baz';
In Oracle, the system figures out that status is a text column. In
Postgres I am warned:NOTICE: Attribute 'alert_status' has an unknown type
Relation created; continue
Whey I type\d Foo
Postgres responds
ERROR: typeidTypeRelid: Invalid type - oid = 0
Any suggestions would be appreciated.
Thanks,
Sarah Officer
officers@aries.tucson.saic.com************
From bouncefilter Tue Jan 11 22:47:30 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id WAA27357
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 22:47:09 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id 99DCB1FE8; Tue, 11 Jan 2000 22:45:56 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1]) by pcr.ca (Postfix) with
ESMTP
id 84FEF1F91; Tue, 11 Jan 2000 22:45:56 +0000 (GMT)
Date: Tue, 11 Jan 2000 22:45:56 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: Bruce Bantos <anon@mgfairfax.rr.com>
Cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] How do you live without OUTER joins?
In-Reply-To: <028f01bf5c95$0eb15b50$0200a8c0@rsdevelop>
Message-ID: <Pine.BSF.4.10.10001112242530.60807-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
I'm not sure if this is what you're looking for, but you can try:
select company_category.com_cat_long, company.company_name from
company_category, company where
company_category.com_cat_abbr=company.com_cat_abbr;
This is what I use myself, but I'm not quite sure this is the best
solution. If I could have feedback from other people as well, I'd be very
greatful also.
For example, how can I live without outer joins in the example below:
In my current Oracle DB, I have a number of "lookup" tables that contain
something like this:TABLE company_category:
com_cat_abbr | com_cat_long
--------------------------------------------------
SB | Small Business
LB | Large Business
NP | Not for Profitetc.
Then in my main table, lets say the "company" table I have:
company_name | com_cat_abbr
------------------------------------------------------------
Microsoft | LB
United Way | NP
Coca Cola | NULLIf I allow nulls in my com_cat_abbr column above, then how could I do a
simple query to show the company table with the full com_cat_long
description? These alternatives do not appear attractive:- Don't allow nulls and force a default value in the com_cat_abbr column
- Don't do the query - if you want to display it that way handle it in the
client
- get rid of the lookup table and store the full text in the company tableI like to have the lookup tables because I use them in the front end client
to populate pulldowns, they save storage space, they allow some limited
flexibility in changing the definition for the abbreviation, and they allow
administrators to be able to see the abbreviation and understand what they
are looking at. When referential integrity becomes available, I will use
these lookup tables to enforce integrity.What are my alternatives? What is everyone else doing in their Postgres
system? Thanks.- B
************
From bouncefilter Tue Jan 11 17:48:47 2000
Received: from crystalsugar.com ([207.0.65.31])
by hub.org (8.9.3/8.9.3) with SMTP id RAA18127
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 17:48:24 -0500 (EST)
(envelope-from danderso@crystalsugar.com)
Received: from JCEDO-Message_Server by crystalsugar.com
with Novell_GroupWise; Tue, 11 Jan 2000 16:47:47 -0600
Message-Id: <s87b5eb3.081@crystalsugar.com>
X-Mailer: Novell GroupWise Internet Agent 5.5.2.1
Date: Tue, 11 Jan 2000 16:47:30 -0600
From: "Dale Anderson" <danderso@crystalsugar.com>
To: <pgsql-general@postgreSQL.org>
Subject: PSQL Function() help....
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id RAA18207
Here is what I am trying to do. I an trying to create a function that is passed two numbers, get_people(2000,1). The first value is a year, and the second is a week. What I want the function to do, is to select all the names from a name table, and return a list of names that don't have an entry in the data table for the year, and week specified. Can this be done??
Thanks in Advance,
Dale.
From bouncefilter Tue Jan 11 17:46:47 2000
Received: from Mail.austin.rr.com (sm2.texas.rr.com [24.93.35.55])
by hub.org (8.9.3/8.9.3) with ESMTP id RAA17818
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 17:46:21 -0500 (EST)
(envelope-from eloehr@austin.rr.com)
Received: from austin.rr.com ([24.27.30.243]) by Mail.austin.rr.com with
Microsoft SMTPSVC(5.5.1877.197.19); Tue, 11 Jan 2000 16:37:16 -0600
Sender: ed
Message-ID: <387BB316.C590E6CB@austin.rr.com>
Date: Tue, 11 Jan 2000 16:47:50 -0600
From: Ed Loehr <eloehr@austin.rr.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20smp i686)
X-Accept-Language: en
MIME-Version: 1.0
To: pg-gen <pgsql-general@postgresql.org>
Subject: [GENERAL] Trigger/Procedure creation problem...
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I just copied my db build sql scripts to another directory under
another user, and I'm now having a problem creating triggers and
procedures. For a host of triggers and procedures, I get a message
like the following:
20000111.16:42:26.706 [2752] query: CREATE TRIGGER
person_insert_trigger AFTER INSERT ON person FOR EACH ROW EXECUTE
PROCEDURE create_supporting_person_records ();
20000111.16:42:26.706 [2752] ProcessUtility: CREATE TRIGGER
person_insert_trigger
AFTER INSERT ON person
FOR EACH ROW EXECUTE PROCEDURE
create_supporting_person_records ();
20000111.16:42:26.707 [2752] ERROR: CreateTrigger: trigger
person_insert_trigger already defined on relation person
I have verified I'm calling destroydb on this database before
executing my scripts, and that I don't have duplicate creation
commands in any of the files.
Any clues?
Cheers,
Ed Loehr
From bouncefilter Tue Jan 11 17:42:47 2000
Received: from fw.wintelcom.net (bright@ns1.wintelcom.net [209.1.153.20])
by hub.org (8.9.3/8.9.3) with ESMTP id RAA17402
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 17:42:23 -0500 (EST)
(envelope-from bright@fw.wintelcom.net)
Received: (from bright@localhost) by fw.wintelcom.net (8.9.3/8.9.3) id
PAA24457
for pgsql-general@postgresql.org; Tue, 11 Jan 2000 15:05:49 -0800 (PST)
Date: Tue, 11 Jan 2000 15:05:49 -0800
From: "'Alfred Perlstein'" <bright@wintelcom.net>
To: pgsql-general@postgresql.org
Subject: (forw) RE: [GENERAL] Memory leak in FreeBSD?
Message-ID: <20000111150549.P9397@fw.wintelcom.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0i
This doesn't look like a memory leak to me, can anyone working on
backend/libpq comment?
-Alfred
----- Forwarded message from Jeff Eckermann <jeckermann@verio.net> -----
Message-ID: <79103FDEF940D2118D9D00A0C9C9309CA35FA0@NEZU>
From: Jeff Eckermann <jeckermann@verio.net>
To: "'Alfred Perlstein'" <bright@wintelcom.net>
Subject: RE: [GENERAL] Memory leak in FreeBSD?
Date: Tue, 11 Jan 2000 16:30:43 -0600
X-Mailer: Internet Mail Service (5.5.2650.21)
Can we take this step by step? I just tried the same query again, as
follows:
select distinct username, date (connect) as connect_date, date (disconnect)
as disconnect_date, timespan_to_seconds (elapsed) as seconds, inoct, outoct,
calling, called into dec_dist from december;
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
We have lost the connection to the backend, so further processing is
impossible. Terminating.
~
~
~
jeffe=> select count (*) from december;
count
-------
2497190
(1 row)
I am estimating that the 'distinct' will select perhaps one quarter, or
less, of the total records.
-----Original Message-----
From: Alfred Perlstein [SMTP:bright@wintelcom.net]
Sent: Tuesday, January 11, 2000 2:24 PM
To: Jeff Eckermann
Cc: 'admin'; 'pgsql-general@postgresql.org'
Subject: Re: [GENERAL] Memory leak in FreeBSD?* Jeff Eckermann <jeckermann@verio.net> [000111 11:37] wrote:
-----Original Message-----
From: admin [SMTP:admin@wtbwts.com]
Sent: Tuesday, January 11, 2000 12:50 PM
To: Jeff Eckermann
Cc: 'pgsql-general@postgresql.org'
Subject: RE: [GENERAL] Memory leak in FreeBSD?What is maxusers set to in your kernel? One prolem I had was that
postgresql was using more filedescriptors that my kernel could handle.If
you'd like to check your current filedescriptor status and your max,
try:
pstat -T. If that is your problem, change your maxusers to a suitable
number and recompile your kernel.Maxusers is set to 128. RAM is 256Mg.
Do you think this could be the problem?Saying it's a memory leak without describing any other sort of symptoms is
not a very useful bug report. Twiddling maxusers should have _no_ effect
on whether an application leaks memory or not.So how about you explain the symptoms of the 'leak' (kernel messages,
top, systat -vmstat) and what exactly you mean by it. Does the postmaster
gradually increase in memory size until the machine starts swapping? If
not, then it's probably _not_ a memory leak.thanks,
-Alfred Perlstein - [bright@rush.net|alfred@freebsd.org]
Wintelcom systems administrator and programmer
- http://www.wintelcom.net/ [bright@wintelcom.net]FreeBSD port: I don't know enough to know what difference that might
make.
Any suggestion you have would be appreciated: thanks.
Did you upgrade from source or from the freebsd ports?
We upgraded to version 6.5.2 recently, running on FreeBSD 3.0.
Now
we
are
having problems with moderately complex queries failing to
complete
(backend
terminating unexpectedly; last one crashed the server). The
most
likely
explanation appears to be a memory leak. Is there any known
problem
with
FreeBSD?
************
************
----- End forwarded message -----
From bouncefilter Tue Jan 11 18:52:48 2000
Received: from mail.austin.rr.com (sm1.texas.rr.com [24.93.35.54])
by hub.org (8.9.3/8.9.3) with ESMTP id SAA32623
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 18:52:28 -0500 (EST)
(envelope-from eloehr@austin.rr.com)
Received: from austin.rr.com ([24.27.30.243]) by mail.austin.rr.com with
Microsoft SMTPSVC(5.5.1877.197.19); Tue, 11 Jan 2000 17:52:57 -0600
Sender: ed
Message-ID: <387BC294.70D39274@austin.rr.com>
Date: Tue, 11 Jan 2000 17:53:56 -0600
From: Ed Loehr <eloehr@austin.rr.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20smp i686)
X-Accept-Language: en
MIME-Version: 1.0
To: pg-gen <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] Trigger/Procedure creation problem...
References: <387BB316.C590E6CB@austin.rr.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I just copied my db build sql scripts to another directory under
another user, and I'm now having a problem creating triggers and
procedures.
Found the problem. Lobotomy stitches were loose.
Cheers,
Ed Loehr
From bouncefilter Tue Jan 11 19:32:48 2000
Received: from mail2.mgfairfax.rr.com (fe2.southeast.rr.com [24.93.67.49])
by hub.org (8.9.3/8.9.3) with ESMTP id TAA67071
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 19:32:45 -0500 (EST)
(envelope-from anon@mgfairfax.rr.com)
Received: from rsdevelop ([24.28.195.122]) by mail2.mgfairfax.rr.com with
Microsoft SMTPSVC(5.5.1877.197.19); Tue, 11 Jan 2000 19:32:45 -0500
Message-ID: <028f01bf5c95$0eb15b50$0200a8c0@rsdevelop>
From: "Bruce Bantos" <anon@mgfairfax.rr.com>
To: <pgsql-general@postgresql.org>
Subject: How do you live without OUTER joins?
Date: Tue, 11 Jan 2000 19:36:24 -0500
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
I know that this may seem like a stale topic. I am not complaining about
outer joins not being available yet in PostgreSQL. I just want to know how
you live without them. I am migrating a production system to PostgreSQL and
I do not know how to duplicate the functionality.
For example, how can I live without outer joins in the example below:
In my current Oracle DB, I have a number of "lookup" tables that contain
something like this:
TABLE company_category:
com_cat_abbr | com_cat_long
--------------------------------------------------
SB | Small Business
LB | Large Business
NP | Not for Profit
etc.
Then in my main table, lets say the "company" table I have:
company_name | com_cat_abbr
------------------------------------------------------------
Microsoft | LB
United Way | NP
Coca Cola | NULL
If I allow nulls in my com_cat_abbr column above, then how could I do a
simple query to show the company table with the full com_cat_long
description? These alternatives do not appear attractive:
- Don't allow nulls and force a default value in the com_cat_abbr column
- Don't do the query - if you want to display it that way handle it in the
client
- get rid of the lookup table and store the full text in the company table
I like to have the lookup tables because I use them in the front end client
to populate pulldowns, they save storage space, they allow some limited
flexibility in changing the definition for the abbreviation, and they allow
administrators to be able to see the abbreviation and understand what they
are looking at. When referential integrity becomes available, I will use
these lookup tables to enforce integrity.
What are my alternatives? What is everyone else doing in their Postgres
system? Thanks.
- B
From bouncefilter Tue Jan 11 20:09:49 2000
Received: from zmail6.easynet.fr (email.easynet.fr [195.114.64.207])
by hub.org (8.9.3/8.9.3) with SMTP id UAA85986
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 20:09:05 -0500 (EST)
(envelope-from tesio@easynet.fr)
Received: (qmail 84424 invoked from network); 12 Jan 2000 01:08:59 -0000
Received: from mailgate3.easynet.fr (192.168.1.4)
by mailserver.easynet.fr with QMQP; 12 Jan 2000 01:08:59 -0000
Received: from pop-nice-240.pops.easynet.fr (HELO atesio) (195.114.95.240)
by mrelay3.easynet.fr with SMTP; 12 Jan 2000 03:16:42 -0000
Message-ID: <002401bf5c99$e35344a0$f05f72c3@atesio>
From: "Alain TESIO" <tesio@easynet.fr>
To: "Bruce Bantos" <anon@mgfairfax.rr.com>, <pgsql-general@postgreSQL.org>
References: <028f01bf5c95$0eb15b50$0200a8c0@rsdevelop>
Subject: Re: [GENERAL] How do you live without OUTER joins?
Date: Wed, 12 Jan 2000 02:09:10 +0100
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
It's maybe not the best solution, what I usually is :
- Copy the lines you want from company into a temporary
table tmp, with "com_cat_long" added with the right type,
initialized with NULL
- Update this column in tmp from company_category
- Select from tmp
- Drop tmp
Or maybe :
select company_name,com_cat_long from company,company_category where ...
union
select company_name,NULL as com_cat_long from company where
com_cat_abbr=NULL
I'm not sure about the syntax for the second one, sorry I can't try it now.
Alain
For example, how can I live without outer joins in the example below:
In my current Oracle DB, I have a number of "lookup" tables that contain
something like this:TABLE company_category:
com_cat_abbr | com_cat_long
--------------------------------------------------
SB | Small Business
LB | Large Business
NP | Not for Profitetc.
Then in my main table, lets say the "company" table I have:
company_name | com_cat_abbr
------------------------------------------------------------
Microsoft | LB
United Way | NP
Coca Cola | NULLWhat are my alternatives? What is everyone else doing in their Postgres
system? Thanks.
From bouncefilter Tue Jan 11 20:48:49 2000
Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236])
by hub.org (8.9.3/8.9.3) with ESMTP id UAA93093
for <pgsql-general@hub.org>; Tue, 11 Jan 2000 20:48:03 -0500 (EST)
(envelope-from peter@localhost.its.uu.se)
Received: from regulus.its.uu.se ([130.238.7.19]:64391 "EHLO
regulus.its.uu.se") by merganser.its.uu.se with ESMTP id
<S.sSxoh282624>; Wed, 12 Jan 2000 02:47:25 +0100
Received: from peter (helo=localhost)
by regulus.its.uu.se with local-esmtp (Exim 3.02 #2)
id 128CzQ-0001Pk-00; Wed, 12 Jan 2000 02:54:24 +0100
From: Peter Eisentraut <peter_e@gmx.net>
To: Guillaume Rousse <Guillaume.Rousse@univ-reunion.fr>
cc: pgsql-general@hub.org
Subject: Re: [GENERAL] Where is my database gone ?
In-Reply-To: <00011014531700.03937@agathe>
Message-ID: <Pine.LNX.4.21.0001120239050.3735-100000@localhost.localdomain>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Sender: Peter Eisentraut <peter@hub.org>
Date: Wed, 12 Jan 2000 02:47:25 +0100
Looks like an entry in pg_user/pg_shadow is missing. Check the tables
pg_user and pg_database and see if the database owner has a corresponding
entry.
On 2000-01-10, Guillaume Rousse mentioned:
My database coraux isn't listed anymore when i use psql -l, altough i can still
connect to it using psql coraux, but there isn't any tables listed by \dt.
Files are still present in $PGDATA, with their content.
What's the problem, and how can i recover it ?
-- --
Guillaume Rousse
*******************************************
Iremia - Universit� de la R�union
15 avenue Ren� Cassin, BP 7151
97715 Saint Denis, messagerie cedex 9
Tel:0262938287 Fax:0262938260 ICQ:10756815
Mail:Guillaume.Rousse@univ-reunion.frBRIDGEKEEPER: What... is the air-speed velocity of an unladen swallow?
ARTHUR: What do you mean? An African or European swallow?************
--
Peter Eisentraut Sernanders v�g 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden
From bouncefilter Tue Jan 11 20:48:49 2000
Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236])
by hub.org (8.9.3/8.9.3) with ESMTP id UAA93090
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 20:48:01 -0500 (EST)
(envelope-from peter@localhost.its.uu.se)
Received: from regulus.its.uu.se ([130.238.7.19]:64502 "EHLO
regulus.its.uu.se") by merganser.its.uu.se with ESMTP id
<S.sSxov280594>; Wed, 12 Jan 2000 02:47:39 +0100
Received: from peter (helo=localhost)
by regulus.its.uu.se with local-esmtp (Exim 3.02 #2)
id 128Czf-0001Qc-00; Wed, 12 Jan 2000 02:54:39 +0100
From: Peter Eisentraut <peter_e@gmx.net>
To: Guillaume Rousse <Guillaume.Rousse@univ-reunion.fr>
cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Inheritance and primary key
In-Reply-To: <00011017381300.00654@agathe>
Message-ID: <Pine.LNX.4.21.0001120237460.3735-100000@localhost.localdomain>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Sender: Peter Eisentraut <peter@hub.org>
Date: Wed, 12 Jan 2000 02:47:39 +0100
This is a known bug (TODO item "Unique index on base column not honored on
inserts from inherited table"). Not sure though when or how this will be
fixed.
On 2000-01-10, Guillaume Rousse mentioned:
I use a super-class S (virtual, in fact) ans three inheritated classes S1, S2
and S3. i wish to have a primary key for all these classes, in order to use
queries as : SELECT * FROM S* WHERE s.id=x
I use a serial ID field for S as a primary key. Sequencing is OK, as any
insertion in any of the four classes increments the counter. But uniqueness
constraint is lost, as i can have duplicated values between differents classes.
And even in the same class for the inherited ones, as primary key propertie of
ID column is lost through inheritance. And i can't specify a unique constraint
on this column, as it is not present in the class definition.
How to solve this problem ?--
Guillaume Rousse
*******************************************
Iremia -Universit� de la R�union
15 avenue Ren� Cassin, BP 7151
97715 Saint Denis, messagerie cedex 9
Tel:0262938287 Fax:0262938260 ICQ:10756815
Mail:Guillaume.Rousse@univ-reunion.frBRIDGEKEEPER: What... is the air-speed velocity of an unladen swallow?
ARTHUR: What do you mean? An African or European swallow?************
--
Peter Eisentraut Sernanders v�g 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden
From bouncefilter Tue Jan 11 22:36:30 2000
Received: from maile.telia.com (maile.telia.com [194.22.190.16])
by hub.org (8.9.3/8.9.3) with ESMTP id WAA25642
for <pgsql-general@postgreSQL.org>;
Tue, 11 Jan 2000 22:35:46 -0500 (EST)
(envelope-from girgen@partitur.se)
Received: from d1o90.telia.com (root@d1o90.telia.com [195.67.216.241])
by maile.telia.com (8.9.3/8.9.3) with ESMTP id EAA06548;
Wed, 12 Jan 2000 04:35:44 +0100 (CET)
Received: from stordatan.telia.com (t2o90p19.telia.com [195.67.216.139])
by d1o90.telia.com (8.8.8/8.8.8) with ESMTP id EAA04153;
Wed, 12 Jan 2000 04:35:43 +0100 (CET)
Received: from partitur.se (localhost [127.0.0.1])
by stordatan.telia.com (8.9.3/8.9.1) with ESMTP id EAA01981;
Wed, 12 Jan 2000 04:35:15 +0100 (CET)
(envelope-from girgen@partitur.se)
Sender: girgen@partitur.se
Message-ID: <387BF673.EDC3BBF6@partitur.se>
Date: Wed, 12 Jan 2000 04:35:15 +0100
From: Palle Girgensohn <girgen@partitur.se>
Organization: Partitur
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.0.36 i386)
X-Accept-Language: sv, en
MIME-Version: 1.0
To: pgsql-general@postgreSQL.org
Subject: blocksize problem
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi!
I have a strange problem with FreeBSD 3.4-RELEASE, and postgresql 6.5.2. It sometimes produces signal 11 (see below).
We have a table, bigtext, which is used if some text is too large to store in one single tuple. This is done our application's C++ code, and seems to work fine. Recently, I realized that the upper
limit in recent versions of postgres was far below 8000 bytes, and rather like just above 5000. I believe I reported this a month or so ago, but haven't heard much about it. Can't find it in the
archives, so maybe I never came around to it...
Anyway; Here's an example. The file bigtext.sql contains some tuples and has been \copied from a database that has problems. The largest tuples are approx 5000 bytes. I start by loading it into a
temporary db:
girgen=> create table bigtext (id int, seqid int , "text" text);
girgen=> \copy bigtext from bigtext.sql
girgen=> select id,seqid,length("text") as len from bigtext order by len desc;
id|seqid| len
----+-----+----
2347| 0|4890
2357| 0|4817
2357| 2|4797
2357| 1|4789
2347| 1|3917
2357| 3|1428
(6 rows)
girgen=> vacuum;
VACUUM
girgen=> vacuum analyze;
ERROR: Tuple is too big: size 9736
girgen=> vacuum verbose analyze bigtext;
NOTICE: CreatePortal: portal <vacuum> already exists
NOTICE: --Relation bigtext--
NOTICE: Pages 5: Changed 0, Reapped 0, Empty 0, New 0; Tup 6: Vac 0, Keep/VTL 0/0, Crash 0, UnUsed 0, MinLen 1472, MaxLen 4934; Re-using: Free/Avail. Space 0/0; EndEmpty/Avail. Pages 0/0. Elapsed 0/3
sec.
ERROR: Tuple is too big: size 9736
As you can see, the size is twice as big as the tuple. How come? What is the real limit? How come it isn't the same limit as the filesystem blocksize, 8192? This seem to happen for pg_dump, vacuum and
probably some other commands.
Now, if I run this on certain machines the frontend crashes with signal 11. This might be only on machines using vinum, a software disk raid system (see <http://www.lemis.com/vinum.html>) I have not
verified this yet, though, and it seems unlikely, imho.
BTW. Here's another example. Same table, but on another occasion:
foobar=> vacuum analyze;
ERROR: Tuple is too big: size 8144, max size 8140
foobar=> select id,seqid,length("text") as len from bigtext order by len desc;
id|seqid| len
----+-----+----
9592| 1|5149
9590| 1|2939
9590| 1|2909
9593| 1|2693
9595| 1|2600
9595| 1|1285
9595| 1|1285
9567| 2| 293
(8 rows)
<modify database...>
foobar=> select id,seqid,length("text") as len from bigtext order by len desc;
id|seqid| len
----+-----+----
9592| 1|5148
9590| 1|2939
9590| 1|2909
9593| 1|2693
9595| 1|2600
9595| 1|1285
9595| 1|1285
9567| 2| 293
(8 rows)
foobar=> vacuum analyze;
VACUUM
So... What shall I set as the upper limit for this table? After running this last example, I set it to 5000, but according to the new results at beginning of this text, I should go even lower? Why can
I insert stuff into the db, if it can't handle it? I read everywhere that the limit is the blocksize, 8192 default... Seems, this is not quite true in all cases. Is postgres doing some copying that
limits the size of individual fields?
Regards,
Palle Girgensohn
From bouncefilter Tue Jan 11 22:54:30 2000
Received: from mail2.mgfairfax.rr.com (fe2.southeast.rr.com [24.93.67.49])
by hub.org (8.9.3/8.9.3) with ESMTP id WAA28992
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 22:54:28 -0500 (EST)
(envelope-from anon@mgfairfax.rr.com)
Received: from rsdevelop ([24.28.195.122]) by mail2.mgfairfax.rr.com with
Microsoft SMTPSVC(5.5.1877.197.19); Tue, 11 Jan 2000 22:54:27 -0500
Message-ID: <02e901bf5cb1$3c9a5fa0$0200a8c0@rsdevelop>
From: "Bruce Bantos" <anon@mgfairfax.rr.com>
To: "admin" <admin@wtbwts.com>
Cc: <pgsql-general@postgresql.org>
References: <Pine.BSF.4.10.10001112242530.60807-100000@server.b0x.com>
Subject: Re: [GENERAL] How do you live without OUTER joins?
Date: Tue, 11 Jan 2000 22:58:08 -0500
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
I'm not sure if this is what you're looking for, but you can try:
select company_category.com_cat_long, company.company_name from
company_category, company where
company_category.com_cat_abbr=company.com_cat_abbr;
A simple join like that will inlcude only the company records with a
com_cat_abbr equal to an entry in the company_category table. You would not
get all the records in the company table. In the example below, you would
only get records for Microsoft and the United Way...the Coca Cola entry
would not be included in the query. Thus the need for outer joins....
This is what I use myself, but I'm not quite sure this is the best
solution. If I could have feedback from other people as well, I'd be very
greatful also.For example, how can I live without outer joins in the example below:
In my current Oracle DB, I have a number of "lookup" tables that contain
something like this:TABLE company_category:
com_cat_abbr | com_cat_long
--------------------------------------------------
SB | Small Business
LB | Large Business
NP | Not for Profitetc.
Then in my main table, lets say the "company" table I have:
company_name | com_cat_abbr
------------------------------------------------------------
Microsoft | LB
United Way | NP
Coca Cola | NULLIf I allow nulls in my com_cat_abbr column above, then how could I do a
simple query to show the company table with the full com_cat_long
description? These alternatives do not appear attractive:- Don't allow nulls and force a default value in the com_cat_abbr column
- Don't do the query - if you want to display it that way handle it in
the
client
- get rid of the lookup table and store the full text in the company
table
I like to have the lookup tables because I use them in the front end
client
to populate pulldowns, they save storage space, they allow some limited
flexibility in changing the definition for the abbreviation, and they
allow
administrators to be able to see the abbreviation and understand what
they
are looking at. When referential integrity becomes available, I will use
these lookup tables to enforce integrity.What are my alternatives? What is everyone else doing in their Postgres
system? Thanks.- B
************
From bouncefilter Tue Jan 11 22:59:31 2000
Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236])
by hub.org (8.9.3/8.9.3) with ESMTP id WAA32018
for <pgsql-general@postgresql.org>;
Tue, 11 Jan 2000 22:59:28 -0500 (EST)
(envelope-from peter@localhost.its.uu.se)
Received: from regulus.its.uu.se ([130.238.7.19]:64708 "EHLO
regulus.its.uu.se") by merganser.its.uu.se with ESMTP id
<S.sSzjx194579>; Wed, 12 Jan 2000 04:58:53 +0100
Received: from peter (helo=localhost)
by regulus.its.uu.se with local-esmtp (Exim 3.02 #2)
id 128Eac-0002lK-00; Wed, 12 Jan 2000 04:36:54 +0100
From: Peter Eisentraut <peter_e@gmx.net>
To: Dale Anderson <danderso@crystalsugar.com>
cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] PSQL Function() help....
In-Reply-To: <s87b5eb3.081@crystalsugar.com>
Message-ID: <Pine.LNX.4.21.0001120420130.3735-100000@localhost.localdomain>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Sender: Peter Eisentraut <peter@hub.org>
Date: Wed, 12 Jan 2000 04:58:53 +0100
On 2000-01-12, Dale Anderson mentioned:
Here is what I am trying to do. I an trying to create a function
that is passed two numbers, get_people(2000,1). The first value is a
year, and the second is a week. What I want the function to do, is to
select all the names from a name table, and return a list of names
that don't have an entry in the data table for the year, and week
specified. Can this be done??
No. Functions cannot return result sets. Certainly a deficiency, but
nobody is perfect.
--
Peter Eisentraut Sernanders v�g 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden
From bouncefilter Wed Jan 12 02:55:33 2000
Received: from outthere.thinx.ch (outthere.thinx.ch [194.158.233.34])
by hub.org (8.9.3/8.9.3) with ESMTP id CAA12337
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 02:55:06 -0500 (EST)
(envelope-from Herbert.Liechti@thinx.ch)
Received: from venus.net.thinx.ch (root@dyna-ol-24.dial.eunet.ch
[193.72.192.247])
by outthere.thinx.ch (8.9.2/8.9.2) with ESMTP id IAA30872;
Wed, 12 Jan 2000 08:54:15 +0100 (CET)
Received: from thinx.ch (herbie@tobi.net.thinx.ch [192.168.0.9])
by venus.net.thinx.ch (8.8.8/8.8.8) with ESMTP id IAA00467;
Wed, 12 Jan 2000 08:54:24 +0100
Sender: herbie@thinx.ch
Message-ID: <387C3339.86CA7717@thinx.ch>
Date: Wed, 12 Jan 2000 08:54:33 +0100
From: Herbert Liechti <Herbert.Liechti@thinx.ch>
Organization: ThinX networked business services
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5 i686)
X-Accept-Language: de-CH, en
MIME-Version: 1.0
To: Bruce Bantos <anon@mgfairfax.rr.com>,
postgres <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] How do you live without OUTER joins?
References: <Pine.BSF.4.10.10001112242530.60807-100000@server.b0x.com>
<02e901bf5cb1$3c9a5fa0$0200a8c0@rsdevelop>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Bruce Bantos wrote:
I'm not sure if this is what you're looking for, but you can try:
select company_category.com_cat_long, company.company_name from
company_category, company where
company_category.com_cat_abbr=company.com_cat_abbr;A simple join like that will inlcude only the company records with a
com_cat_abbr equal to an entry in the company_category table. You would not
get all the records in the company table. In the example below, you would
only get records for Microsoft and the United Way...the Coca Cola entry
would not be included in the query. Thus the need for outer joins....
You may solve the problem with a union select by selecting the joined
records in the first statement and the remaining records in the second
statement.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti E-Mail: Herbert.Liechti@thinx.ch
ThinX networked business services Stahlrain 10, CH-5200 Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From bouncefilter Wed Jan 12 03:11:34 2000
Received: from cap-ferrat.albourne.com (cap-ferrat.albourne.com
[195.89.178.227]) by hub.org (8.9.3/8.9.3) with ESMTP id DAA23127
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 03:10:50 -0500 (EST)
(envelope-from a.joubert@albourne.com)
Received: from albourne.com (bishop-rock.albourne.com [195.89.178.230])
by cap-ferrat.albourne.com (8.9.3/8.9.3/Albourne/UKS/2.9/MAPS) with
ESMTP id IAA06702; Wed, 12 Jan 2000 08:10:41 GMT
Sender: a.joubert@albourne.com
Message-ID: <387C3706.8EB49E94@albourne.com>
Date: Wed, 12 Jan 2000 08:10:46 +0000
From: Adriaan Joubert <a.joubert@albourne.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.14 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Sarah Officer <officers@aries.tucson.saic.com>
CC: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] constant column value in view with union
References: <387BA3A7.6F937A4D@aries.tucson.saic.com>
<387BA7FF.6465C6BD@aries.tucson.saic.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sarah Officer wrote:
Oh dear. The problem I mentioned here occured when I just based my
view on one select statement. When I add the union clause, I am
informed that views can't handle unions. Is there a standard
work-around? I'm afraid I was planning a couple of other views
which look at this one.
No, views are a problem at the moment. One of the biggest problems is
that the plan to execute a view is stored in a database table and there
is a limit of 8192 bytes per tuple. This is quite quickly exceeded by the
size of the plan. Jan Wieck has implemented a compressed text type, which
will allow the system to store larger views in the view table and is
working on a mechanism to store fields that still don't fit in a
secondary table. The compressed data type will be in the next version of
postgres (Feb-Mar 2000), whether the secondary tables make it is a bit
touch and go.
Views with unions is on the todo list, but i don't know whether that is
going to happen by the next version.
Adriaan
From bouncefilter Wed Jan 12 04:23:34 2000
Received: from news.tht.net (news.hub.org [216.126.91.242])
by hub.org (8.9.3/8.9.3) with ESMTP id EAA61422;
Wed, 12 Jan 2000 04:22:54 -0500 (EST)
(envelope-from news@news.tht.net)
Received: (from news@localhost) by news.tht.net (8.9.3/8.9.3) id EAA99540;
Wed, 12 Jan 2000 04:02:12 -0500 (EST) (envelope-from news)
X-Authentication-Warning: news.tht.net: news set sender to <news> using -f
From: "Netra systems" <julien@netra-systems.com>
X-Newsgroups: comp.databases.postgresql, comp.databases.postgresql.admin,
comp.databases.postgresql.hackers,
comp.databases.postgresql.questions, linux.act.postgres
Subject: postgresql installation
Date: Wed, 12 Jan 2000 09:52:06 +0100
Lines: 9
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID: <387c40b0@feednews.internext.fr>
X-Trace: 12 Jan 2000 09:52:00 +0100, intx165.alternext.net
To:
pgsql-hackers@postgresql.org.pgsql-admin@postgresql.org.pgsql-questions@postgresql.org
hello,
i have pb with the postgre sql installation :
i compile all .. ok
but when i want to run postmaster or anything else it say : no db dir :
data/../template1 ...
i have no data dir in my postgre dinstalled dir ....
how can i have this dir with all into ?
From bouncefilter Wed Jan 12 05:39:35 2000
Received: from ara.zf.jcu.cz (zakkr@ara.zf.jcu.cz [160.217.161.4])
by hub.org (8.9.3/8.9.3) with ESMTP id FAA79200
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 05:39:02 -0500 (EST) (envelope-from zakkr@zf.jcu.cz)
Received: from localhost (zakkr@localhost)
by ara.zf.jcu.cz (8.9.3/8.9.3/Debian/GNU) with SMTP id LAA22593;
Wed, 12 Jan 2000 11:24:13 +0100
Date: Wed, 12 Jan 2000 11:24:13 +0100 (CET)
From: Karel Zak - Zakkr <zakkr@zf.jcu.cz>
To: Nina Kuznetsova <nina@kinetics.nsc.ru>
cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] query with LIKE
In-Reply-To: <387C7F88.2A281E6@kinetics.nsc.ru>
Message-ID: <Pine.LNX.3.96.1000112112126.21492A-100000@ara.zf.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Wed, 12 Jan 2000, Nina Kuznetsova wrote:
Hi all! Can anyone get me particular description of LIKE operator.
Regards Nina.
Why? Is description in current PostgreSQL documentation insufficient?
Karel
From bouncefilter Wed Jan 12 05:41:35 2000
Received: from arka.poznan.mtl.pl (IDENT:root@arka.poznan.mtl.pl
[195.116.164.132]) by hub.org (8.9.3/8.9.3) with ESMTP id FAA79419
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 05:40:40 -0500 (EST)
(envelope-from m.mazurek@multinet.pl)
Received: from localhost (mazek@localhost)
by arka.poznan.mtl.pl (8.9.3/8.9.2) with ESMTP id LAA61187;
Wed, 12 Jan 2000 11:37:02 +0100 (CET)
X-Authentication-Warning: arka.poznan.mtl.pl: mazek owned process doing -bs
Date: Wed, 12 Jan 2000 11:37:02 +0100 (CET)
From: Marcin Mazurek - Multinet SA - Poznan <m.mazurek@multinet.pl>
X-Sender: mazek@arka.poznan.mtl.pl
To: Nina Kuznetsova <nina@kinetics.nsc.ru>
cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] query with LIKE
In-Reply-To: <387C7F88.2A281E6@kinetics.nsc.ru>
Message-ID: <Pine.BSF.4.21.0001121136020.98162-100000@arka.poznan.mtl.pl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Wed, 12 Jan 2000, Nina Kuznetsova wrote:
Hi all! Can anyone get me particular description of LIKE operator.
Regards Nina.
select names from workers where first_name LIKE 'nina';:)
mazek
From bouncefilter Wed Jan 12 06:12:35 2000
Received: from kuolema.infodrom.north.de (postfix@kuolema.Infodrom.North.DE
[194.94.254.227]) by hub.org (8.9.3/8.9.3) with ESMTP id GAA86578
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 06:12:00 -0500 (EST)
(envelope-from joey@finlandia.Infodrom.North.DE)
Received: from finlandia.Infodrom.North.DE (finlandia.Infodrom.North.DE
[194.94.254.226]) by kuolema.infodrom.north.de (Postfix) with ESMTP
id E8794146E7C; Wed, 12 Jan 2000 12:11:46 +0100 (CET)
Received: at Infodrom Oldenburg (/\##/\ Smail-3.2.0.102 1998-Aug-2 #2)
by finlandia.Infodrom.North.DE via smail from stdin
id <m128Lgi-000bK4C@finlandia.Infodrom.North.DE>
for yura@vpcit.ru; Wed, 12 Jan 2000 12:11:40 +0100 (CET)
Date: Wed, 12 Jan 2000 12:11:40 +0100
From: Martin Schulze <joey@finlandia.Infodrom.North.DE>
To: yura <yura@vpcit.ru>
Cc: pgsql-general <pgsql-general@postgreSQL.org>
Subject: Re: case-insensitive like operator
Message-ID: <20000112121140.E19482@finlandia.infodrom.north.de>
Reply-To: Martin Schulze <joey@infodrom.north.de>
References: <15659.000115@vpcit.ru>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.0i
In-Reply-To: <15659.000115@vpcit.ru>;
from yura@vpcit.ru on Sat, Jan 15, 2000 at 03:49:35PM +0500
yura wrote:
Hello All,
I have a following problem:
We have ported MS Acess database to PostgreSQL. Everything ok, but our
user are used to search data in tables using filters, and Access does
case insensitive search, but when working with Postgres database it
converts filters into queries with 'like' operator. So is there any
way to make 'like' operator case insensitive? Or maybe somebody has
the same problems and knows the solution?
Use *~ (or ~*, I always mistype it).
Regards,
Joey
--
The MS-DOS filesystem is nice for removable media. -- H. Peter Anvin
From bouncefilter Wed Jan 12 06:25:35 2000
Received: from cap-ferrat.albourne.com (cap-ferrat.albourne.com
[195.89.178.227]) by hub.org (8.9.3/8.9.3) with ESMTP id GAA87729
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 06:24:50 -0500 (EST)
(envelope-from a.joubert@albourne.com)
Received: from albourne.com (bishop-rock.albourne.com [195.89.178.230])
by cap-ferrat.albourne.com (8.9.3/8.9.3/Albourne/UKS/2.9/MAPS) with
ESMTP id LAA10265; Wed, 12 Jan 2000 11:24:46 GMT
Sender: a.joubert@albourne.com
Message-ID: <387C6485.19D8D772@albourne.com>
Date: Wed, 12 Jan 2000 11:24:53 +0000
From: Adriaan Joubert <a.joubert@albourne.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.14 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: yura <yura@vpcit.ru>
CC: pgsql-general <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] case-insensitive like operator
References: <15659.000115@vpcit.ru>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Postgres has a load of text search operators. The most powerful is ~*
whcih gives you a case insensitive regular expression search.
Adriaan
From bouncefilter Wed Jan 12 06:29:35 2000
Received: from arka.poznan.mtl.pl (IDENT:root@arka.poznan.mtl.pl
[195.116.164.132]) by hub.org (8.9.3/8.9.3) with ESMTP id GAA88171
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 06:28:53 -0500 (EST)
(envelope-from m.mazurek@multinet.pl)
Received: from localhost (mazek@localhost)
by arka.poznan.mtl.pl (8.9.3/8.9.2) with ESMTP id MAA65880
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 12:28:52 +0100 (CET)
X-Authentication-Warning: arka.poznan.mtl.pl: mazek owned process doing -bs
Date: Wed, 12 Jan 2000 12:28:51 +0100 (CET)
From: Marcin Mazurek - Multinet SA - Poznan <m.mazurek@multinet.pl>
X-Sender: mazek@arka.poznan.mtl.pl
cc: pgsql-general <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] case-insensitive like operator
In-Reply-To: <15659.000115@vpcit.ru>
Message-ID: <Pine.BSF.4.21.0001121228080.98162-100000@arka.poznan.mtl.pl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Sat, 15 Jan 2000, yura wrote:
We have ported MS Acess database to PostgreSQL. Everything ok, but our
user are used to search data in tables using filters, and Access does
case insensitive search, but when working with Postgres database it
converts filters into queries with 'like' operator. So is there any
way to make 'like' operator case insensitive? Or maybe somebody has
the same problems and knows the solution?
take a look at ~= and etc. operators, everything you need is there.
mazek
Marcin Mazurek
--
administrator
MULTINET SA o/Poznan
http://www.multinet.pl/
From bouncefilter Wed Jan 12 06:55:36 2000
Received: from genesis.sundayta.co.uk (mail.sundayta.co.uk [212.24.70.227])
by hub.org (8.9.3/8.9.3) with ESMTP id GAA94713
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 06:54:55 -0500 (EST)
(envelope-from david@sundayta.co.uk)
Received: from kings.sundayta.co.uk
([192.168.100.31] helo=sundayta.co.uk ident=david)
by genesis.sundayta.co.uk with esmtp (Exim 3.11 #1 (Debian))
id 128NCg-0003E8-00; Wed, 12 Jan 2000 12:48:46 +0000
Sender: david
Message-ID: <387C663B.96BD362@sundayta.co.uk>
Date: Wed, 12 Jan 2000 11:32:11 +0000
From: David Warnock <david@sundayta.co.uk>
Organization: Sundayta Ltd
X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.0.36 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] How do you live without OUTER joins?
References: <028f01bf5c95$0eb15b50$0200a8c0@rsdevelop>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Bruce,
Can't a sub select do this (mind you not sure if PostgreSQL supports sub
selects)?
eg
select company_name, (select com_cat_long from company_category cat
where cat.com_cat_abbr = cpy.com_cat_abbr) from company cpy
Dave
From bouncefilter Wed Jan 12 06:50:36 2000
Received: from agni.wipinfo.soft.net (agni.wipinfo.soft.net [164.164.6.20])
by hub.org (8.9.3/8.9.3) with ESMTP id GAA94152
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 06:50:11 -0500 (EST)
(envelope-from shadkam@wipinfo.soft.net)
Received: from vayu.wipinfo.soft.net (vayu [192.168.200.170])
by agni.wipinfo.soft.net (8.9.3/8.9.3) with ESMTP id RAA29618;
Wed, 12 Jan 2000 17:18:22 +0500 (GMT)
Received: from trishul.wipinfo.soft.net (root@trishul.wipinfo.soft.net
[192.168.245.153])
by vayu.wipinfo.soft.net (8.9.3/8.9.3) with ESMTP id RAA27016;
Wed, 12 Jan 2000 17:19:23 +0500 (GMT)
Received: from trishul.wipinfo.soft.net (shadkam@trishul.wipinfo.soft.net
[192.168.245.153])
by trishul.wipinfo.soft.net (8.9.3/8.9.3) with SMTP id RAA02632;
Wed, 12 Jan 2000 17:11:21 +0530
Date: Wed, 12 Jan 2000 17:11:20 +0530 (IST)
From: Shadkam Islam <shadkam@wipinfo.soft.net>
To: yura <yura@vpcit.ru>
cc: pgsql-general <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] case-insensitive like operator
In-Reply-To: <15659.000115@vpcit.ru>
Message-ID: <Pine.LNX.3.96.1000112170646.120D-100000@trishul.wipinfo.soft.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Hi Yury,
I do not know the most correct solution but I used a work around while
encountering a similar problem
select * from table_name
where upper (field_name) like 'SOME_THING_IN_UPPERCASE'
Hope it helps.
- Cheers
- Shad.
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
| Each human owes infinitely more to the human race than to the |
| particular country in which he was born. -- Francois Fenelon |
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
On Sat, 15 Jan 2000, yura wrote:
Hello All,
I have a following problem:
We have ported MS Acess database to PostgreSQL. Everything ok, but our
user are used to search data in tables using filters, and Access does
case insensitive search, but when working with Postgres database it
converts filters into queries with 'like' operator. So is there any
way to make 'like' operator case insensitive? Or maybe somebody has
the same problems and knows the solution?Best regards,
Yury mailto:yura@vpcit.ru************
From bouncefilter Wed Jan 12 07:11:36 2000
Received: from genesis.sundayta.co.uk (mail.sundayta.co.uk [212.24.70.227])
by hub.org (8.9.3/8.9.3) with ESMTP id HAA00388
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 07:10:43 -0500 (EST)
(envelope-from david@sundayta.co.uk)
Received: from kings.sundayta.co.uk
([192.168.100.31] helo=sundayta.co.uk ident=david)
by genesis.sundayta.co.uk with esmtp (Exim 3.11 #1 (Debian))
id 128NRy-0003Et-00
for <pgsql-general@postgreSQL.org>; Wed, 12 Jan 2000 13:04:34 +0000
Sender: david
Message-ID: <387C69F0.BBE21314@sundayta.co.uk>
Date: Wed, 12 Jan 2000 11:48:00 +0000
From: David Warnock <david@sundayta.co.uk>
Organization: Sundayta Ltd
X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.0.36 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] case-insensitive like operator
References: <15659.000115@vpcit.ru>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Yura,
As you have no control over the queries generated by MS Access I guess
you need to create extra columns which hold the uppercase version of the
data. Then to search use these columns and uppercase the data you are
searching for
eg if you have a column name then add a new column name_upper, change
your data entry to always put upper(name) into name_upper
Your search should be where name_upper like "UPPERCASED VALUE"
Dave
yura wrote:
Hello All,
I have a following problem:
We have ported MS Acess database to PostgreSQL. Everything ok, but our
user are used to search data in tables using filters, and Access does
case insensitive search, but when working with Postgres database it
converts filters into queries with 'like' operator. So is there any
way to make 'like' operator case insensitive? Or maybe somebody has
the same problems and knows the solution?Best regards,
Yury mailto:yura@vpcit.ru************
From bouncefilter Wed Jan 12 07:35:36 2000
Received: from vpcit.ru (qmailr@dialup.vpcit.ru [195.38.52.246])
by hub.org (8.9.3/8.9.3) with SMTP id HAA06667
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 07:35:13 -0500 (EST) (envelope-from yura@vpcit.ru)
Received: (qmail 14783 invoked from network); 12 Jan 2000 12:35:11 -0000
Received: from gercon.vpcit.ru (195.38.52.226)
by dialup.vpcit.ru with SMTP; 12 Jan 2000 12:35:11 -0000
Date: Wed, 12 Jan 2000 17:34:34 +0500
From: yura <yura@vpcit.ru>
X-Mailer: The Bat! (v1.36) S/N F29DEE5D / Educational
Reply-To: yura <yura@vpcit.ru>
Organization: Gercon
X-Priority: 3 (Normal)
Message-ID: <3732.000112@vpcit.ru>
To: pgsql-general <pgsql-general@postgreSQL.org>
Subject: Re[2]: [GENERAL] case-insensitive like operator
In-reply-To: <387C69F0.BBE21314@sundayta.co.uk>
References: <387C69F0.BBE21314@sundayta.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello David,
Wednesday, January 12, 2000, 4:48:00 PM, you wrote:
DW> Yura,
DW> As you have no control over the queries generated by MS Access I guess
DW> you need to create extra columns which hold the uppercase version of the
DW> data. Then to search use these columns and uppercase the data you are
DW> searching for
DW> eg if you have a column name then add a new column name_upper, change
DW> your data entry to always put upper(name) into name_upper
DW> Your search should be where name_upper like "UPPERCASED VALUE"
DW> Dave
DW> yura wrote:
Hello All,
I have a following problem:
We have ported MS Acess database to PostgreSQL. Everything ok, but our
user are used to search data in tables using filters, and Access does
case insensitive search, but when working with Postgres database it
converts filters into queries with 'like' operator. So is there any
way to make 'like' operator case insensitive? Or maybe somebody has
the same problems and knows the solution?Best regards,
Yury mailto:yura@vpcit.ru************
DW> ************
Thanks for all replies, I have found the solution.
I have redefined the operator '~~' (it's the same as 'like') so now it
compares strings case insentively.
drop function ictextlike(text, text);
create function ictextlike(text, text)
returns bool
as '
begin
if textlike(upper($1), upper($2)) then
return TRUE;
else
return FALSE;
end if;
end;
'
language 'plpgsql';
drop operator ~~ (text, text);
create operator ~~ (
leftarg=text,
rightarg=text,
procedure=ictextlike,
negator='!~~'
);
Best regards,
yura mailto:yura@vpcit.ru
From bouncefilter Wed Jan 12 12:57:40 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id MAA92621
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 12:56:44 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id 271E71FE8; Wed, 12 Jan 2000 12:55:40 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1])
by pcr.ca (Postfix) with ESMTP id 123341F8C
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 12:55:40 +0000 (GMT)
Date: Wed, 12 Jan 2000 12:55:40 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: pgsql-general@postgresql.org
Subject: indices on tab1.a=tab2.a
Message-ID: <Pine.BSF.4.10.10001121250410.68208-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
I have unfortunately deleted a message to pgsql-general today which
contained a query like:
SELECT tab1.b, tab2.c FROM tab1, tab2 WHERE tab1.a=tab2.a;
There was also a UNION following, but my memory fails me. My question is
though, can an index be used for the above query? When I try it with an
index on tab1.a and tab2.a, I get two hash joins and two seq scans.
If there's any way to optimise this query, please let me know,
Marc
From bouncefilter Wed Jan 12 05:21:35 2000
Received: from mx.nsu.ru (root@mx.nsu.ru [193.124.215.71])
by hub.org (8.9.3/8.9.3) with ESMTP id FAA73867
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 05:20:50 -0500 (EST)
(envelope-from nina@kinetics.nsc.ru)
Received: from ns.kinetics.nsc.ru (root@[194.85.127.69])
by mx.nsu.ru (8.9.1/8.9.0) with ESMTP id QAA16991
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 16:18:34 +0600 (NOVT)
Received: from kinetics.nsc.ru ([194.85.127.87])
by ns.kinetics.nsc.ru (8.9.3/8.9.3) with ESMTP id QAA15499
for <pgsql-general@postgreSQL.org>; Wed, 12 Jan 2000 16:18:50 +0600
Message-ID: <387C7F88.2A281E6@kinetics.nsc.ru>
Date: Wed, 12 Jan 2000 16:20:08 +0300
From: Nina Kuznetsova <nina@kinetics.nsc.ru>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en,ru
MIME-Version: 1.0
To: pgsql-general@postgreSQL.org
Subject: query with LIKE
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
Hi all! Can anyone get me particular description of LIKE operator.
Regards Nina.
From bouncefilter Wed Jan 12 09:21:37 2000
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id JAA35293
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 09:20:48 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id
JAA26143;
Wed, 12 Jan 2000 09:16:59 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001121416.JAA26143@candle.pha.pa.us>
Subject: Re: [GENERAL] How do you live without OUTER joins?
In-Reply-To: <387C663B.96BD362@sundayta.co.uk> from David Warnock at "Jan 12,
2000 11:32:11 am"
To: David Warnock <david@sundayta.co.uk>
Date: Wed, 12 Jan 2000 09:16:58 -0500 (EST)
CC: pgsql-general@postgreSQL.org
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Bruce,
Can't a sub select do this (mind you not sure if PostgreSQL supports sub
selects)?eg
select company_name, (select com_cat_long from company_category cat
where cat.com_cat_abbr = cpy.com_cat_abbr) from company cpy
Only 7.0 will support subselects in the target list. 6.5.* only
supports them in the WHERE clause.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From bouncefilter Wed Jan 12 09:24:37 2000
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id JAA35637
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 09:24:04 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id
JAA28003;
Wed, 12 Jan 2000 09:19:21 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001121419.JAA28003@candle.pha.pa.us>
Subject: Re: [GENERAL] query with LIKE
In-Reply-To: <387C7F88.2A281E6@kinetics.nsc.ru> from Nina Kuznetsova at "Jan
12, 2000 04:20:08 pm"
To: Nina Kuznetsova <nina@kinetics.nsc.ru>
Date: Wed, 12 Jan 2000 09:19:21 -0500 (EST)
CC: pgsql-general@postgreSQL.org
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
[Charset koi8-r unsupported, filtering to ASCII...]
Hi all! Can anyone get me particular description of LIKE operator.
Regards Nina.************
See my book on the web documentation page. It has a section about LIKE
with examples.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From bouncefilter Wed Jan 12 08:39:37 2000
Received: from chekov.Belgium.EU.net (chekov.belgium.eu.net [193.74.208.161])
by hub.org (8.9.3/8.9.3) with ESMTP id IAA26876
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 08:38:47 -0500 (EST)
(envelope-from wim.ceulemans@nice.be)
Received: from (IDENT:0@idialup279.brussels2.eunet.be [193.75.159.24])
by chekov.Belgium.EU.net with ESMTP id OAA28577
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 14:38:44 +0100 (MET)
Received: from nice.be ; Wed, 12 Jan 2000 14:38:28 +0100
Sender: Wim.Ceulemans@nice.be
Message-ID: <387C9321.6497B3C1@nice.be>
Date: Wed, 12 Jan 2000 15:43:45 +0100
From: Wim Ceulemans <wim.ceulemans@nice.be>
Organization: Nice bvba
X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.13 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] constant column value in view with union
References: <387BA3A7.6F937A4D@aries.tucson.saic.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sarah Officer wrote:
I am converting some Oracle stuff to Postgres (or attempting to
convert it :) ), and I'm having trouble with my views. I have
figured out the syntax difference between Oracle & Postgres, I
think, but Postgres doesn't seem to know the type of a constant text
column. How can I make this work?The view is something like this:
create view Foo as
select a, b, c, 'OK' as status
from table1
where ...
union
select a, b, c, 'BAD' as status
from table1
where ...
select a, b, c, 'OK'::varchar(3) as status ...
Concerning the union:
1. create separate views with the same structure
2. use a select of the form:
select a, b, c, status from view1 where ... union select a, b, c, status
from view2 where ...
Regards
Wim
From bouncefilter Wed Jan 12 09:48:38 2000
Received: from scaup.prod.itd.earthlink.net (scaup.prod.itd.earthlink.net
[207.217.121.49]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA42083
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 09:48:24 -0500 (EST)
(envelope-from aardvark@ibm.net)
Received: from fries (1Cust112.tnt2.altoona.pa.da.uu.net [63.24.4.112])
by scaup.prod.itd.earthlink.net (8.9.3/8.9.3) with SMTP id GAA12853
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 06:48:22 -0800 (PST)
From: "Barnes" <aardvark@ibm.net>
To: <pgsql-general@postgreSQL.org>
Subject: RE: [GENERAL] query with LIKE
Date: Wed, 12 Jan 2000 09:50:40 -0500
Message-ID: <001201bf5d0c$65be6330$0a64a8c0@fries>
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
In-Reply-To: <200001121419.JAA28003@candle.pha.pa.us>
And it is very well done, I might add.
Barnes
-----Original Message-----
From: owner-pgsql-general@postgreSQL.org
[mailto:owner-pgsql-general@postgreSQL.org]On Behalf Of Bruce Momjian
Sent: Wednesday, January 12, 2000 9:19 AM
To: Nina Kuznetsova
Cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] query with LIKE
[Charset koi8-r unsupported, filtering to ASCII...]
Hi all! Can anyone get me particular description of LIKE operator.
Regards Nina.************
See my book on the web documentation page. It has a section about LIKE
with examples.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
************
From bouncefilter Wed Jan 12 10:34:38 2000
Received: from portal.west.saic.com (portal.west.saic.com [198.151.12.15])
by hub.org (8.9.3/8.9.3) with SMTP id KAA54623
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 10:34:27 -0500 (EST)
(envelope-from officers@aries.tucson.saic.com)
Received: from gatespass.tucson.saic.com by portal.west.saic.com
via smtpd (for postgresql.org [216.126.84.28]) with SMTP;
12 Jan 2000 15:34:26 UT
Received: (from adm@localhost) by gatespass.tucson.saic.com (8.8.2/8.8.2) id
IAA00934; Wed, 12 Jan 2000 08:34:20 -0700 (MST)
X-Authentication-Warning: gatespass.tucson.saic.com: adm set sender to
<officers@aries.tucson.saic.com> using -f
Received: from wasp.tucson.saic.com(139.121.3.171) by
gatespass.tucson.saic.com via smap (V2.0)
id xma000932; Wed, 12 Jan 00 08:34:08 -0700
Received: from aries.tucson.saic.com (localhost [127.0.0.1]) by
wasp.tucson.saic.com (980427.SGI.8.8.8/950213.SGI.AUTOCF) via
ESMTP id IAA45562; Wed, 12 Jan 2000 08:34:07 -0700 (MST)
Sender: officers@aries.tucson.saic.com
Message-ID: <387C9EEE.401AEFA1@aries.tucson.saic.com>
Date: Wed, 12 Jan 2000 08:34:06 -0700
From: Sarah Officer <officers@aries.tucson.saic.com>
X-Mailer: Mozilla 4.07C-SGI [en] (X11; I; IRIX 6.5 IP32)
MIME-Version: 1.0
To: Bruce Bantos <anon@mgfairfax.rr.com>, pgsql-general@postgresql.org
Subject: Re: [GENERAL] How do you live without OUTER joins?
References: <Pine.BSF.4.10.10001112242530.60807-100000@server.b0x.com>
<02e901bf5cb1$3c9a5fa0$0200a8c0@rsdevelop>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
How about using a union?
select cc.com_cat_long, co.company_name
from company_category cc, company co
where cc.com_cat_abbr = co.com_cat_abbr
union
select 'unknown' as com_cat_long, company_name
from company
where com_cat_abbr is null;
You still won't see entries for companies which have been assigned
an abbreviation that isn't in the company_category table. I suppose
you'll have some other way to enforce the data integrity.
I hope this helps.
Sarah Officer
officers@aries.tucson.saic.com
Bruce Bantos wrote:
I'm not sure if this is what you're looking for, but you can try:
select company_category.com_cat_long, company.company_name from
company_category, company where
company_category.com_cat_abbr=company.com_cat_abbr;A simple join like that will inlcude only the company records with a
com_cat_abbr equal to an entry in the company_category table. You would not
get all the records in the company table. In the example below, you would
only get records for Microsoft and the United Way...the Coca Cola entry
would not be included in the query. Thus the need for outer joins....This is what I use myself, but I'm not quite sure this is the best
solution. If I could have feedback from other people as well, I'd be very
greatful also.For example, how can I live without outer joins in the example below:
In my current Oracle DB, I have a number of "lookup" tables that contain
something like this:TABLE company_category:
com_cat_abbr | com_cat_long
--------------------------------------------------
SB | Small Business
LB | Large Business
NP | Not for Profitetc.
Then in my main table, lets say the "company" table I have:
company_name | com_cat_abbr
------------------------------------------------------------
Microsoft | LB
United Way | NP
Coca Cola | NULLIf I allow nulls in my com_cat_abbr column above, then how could I do a
simple query to show the company table with the full com_cat_long
description? These alternatives do not appear attractive:- Don't allow nulls and force a default value in the com_cat_abbr column
- Don't do the query - if you want to display it that way handle it inthe
client
- get rid of the lookup table and store the full text in the companytable
I like to have the lookup tables because I use them in the front end
client
to populate pulldowns, they save storage space, they allow some limited
flexibility in changing the definition for the abbreviation, and theyallow
administrators to be able to see the abbreviation and understand what
they
are looking at. When referential integrity becomes available, I will use
these lookup tables to enforce integrity.What are my alternatives? What is everyone else doing in their Postgres
system? Thanks.- B
************
************
From bouncefilter Wed Jan 12 10:40:38 2000
Received: from keeper.siac.com (gate.siac.com [162.69.5.193])
by hub.org (8.9.3/8.9.3) with ESMTP id KAA55496
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 10:40:24 -0500 (EST)
(envelope-from rwagner@siac.com)
Received: from keeper. (keeper.siac.com [162.69.5.1]) by keeper.siac.com with
SMTP (8.8.6 (PHNE_14041)/8.7.1) id KAA12018;
Wed, 12 Jan 2000 10:41:15 -0500 (EST)
Received: from bigmouth.siac.com ([162.69.5.8]) by keeper.siac.com;
Wed, 12 Jan 2000 10:41:14 +0000 (EST)
Received: by SIAC_NOTES_001.wisdom.siac.com(Lotus SMTP MTA v1.2 (600.1
3-26-1998)) id 85256864.0055D47B ; Wed, 12 Jan 2000 10:37:29 -0500
X-Lotus-FromDomain: SIAC_01
From: "Robert Wagner" <rwagner@siac.com>
To: pgsql-general@postgreSQL.org
cc: squires@com.net
Message-ID: <85256864.00542073.00@SIAC_NOTES_001.wisdom.siac.com>
Date: Wed, 12 Jan 2000 10:37:13 -0500
Subject: identifying performance hits: how to ???
Mime-Version: 1.0
Content-type: text/plain; charset=us-ascii
Content-Disposition: inline
Hello All,
Anyone know if read performance on a postgres database decreases at an
increasing rate, as the number of stored records increase?
This is a TCL app, which makes entries into a single, table and from time
to time repopulates a grid control. It must rebuild the data in the grid
control, because other clients have since written to the same table.
It seems as if I'm missing something fundamental... maybe I am... is some
kind of database cleanup necessary? With less than ten records, the grid
populates very quickly. Beyond that, performance slows to a crawl, until
it _seems_ that every new record doubles the time needed to retrieve the
records. My quick fix was to cache the data locally in TCL, and only
retrieve changed data from the database. But now as client demand
increases, as well as the number of clients making changes to the table,
I'm reaching the bottleneck again.
The client asked me yesterday to start evaluating "more mainstream"
databases, which means that they're pissed off. Postgres is fun to work
with, but it's hard to learn about, and hard to justify to clients.
By the way, I have experimented with populating the exact same grid control
on Windows NT, using MS Access (TCL runs just about anywhere). The grid
seemed to populate just about instantaneously. So, is the bottleneck in
Unix, in Postgres, and does anybody know how to make it faster?
Cheers,
Rob
From bouncefilter Wed Jan 12 11:14:39 2000
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA64380
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 11:14:31 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id LAA03508
for pgsql-general@postgreSQL.org; Wed, 12 Jan 2000 11:11:12 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001121611.LAA03508@candle.pha.pa.us>
Subject: Simulating an outer join
To: PostgreSQL-general <pgsql-general@postgreSQL.org>
Date: Wed, 12 Jan 2000 11:11:12 -0500 (EST)
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
I have been thinking about how to simulate an outer join. It seems the
best way is to do:
SELECT tab1.col1, tab2.col3
FROM tab1, tab2
WHERE tab1.col1 = tab2.col2
UNION ALL
SELECT tab1.col1, NULL
FROM tab1
WHERE tab1.col1 NOT IN (SELECT tab2.col2 FROM tab2)
Comments? I know someone was asking about this recently.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From bouncefilter Wed Jan 12 11:24:39 2000
Received: from sakaki.communique.net (sakaki.communique.net [204.27.64.202])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA66005
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 11:24:23 -0500 (EST)
(envelope-from davidb@vectormath.com)
From: davidb@vectormath.com
Received: from bullwinkle (adsl-204-1-67-149.indi.se.verio.net [204.1.67.149])
by sakaki.communique.net (8.8.8/8.8.8) with SMTP id KAA09586;
Wed, 12 Jan 2000 10:23:55 -0600 (CST)
Message-ID: <009801bf5d19$2b6be4c0$0602010a@bullwinkle.vectormath>
To: "Robert Wagner" <rwagner@siac.com>, <pgsql-general@postgresql.org>
Cc: <squires@com.net>
Subject: Re: [GENERAL] identifying performance hits: how to ???
Date: Wed, 12 Jan 2000 10:21:54 -0600
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
By asking about missing something fundamental, you have invited
less-than-expert feedback (i.e. feedback from me).
'adding a record doubles the retrieval time' makes it sound as though
somewhere in your query to populate the grid control you are requiring a
combinatorial operation (that is, "compare every record in table A with
every record in table B"). This, of course, assumes that there is some
discrepancy between what you are running on Postgres and what you tried on
Windows NT (MS-SQL?).
David Boerwinkle
-----Original Message-----
From: Robert Wagner <rwagner@siac.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Cc: squires@com.net <squires@com.net>
Date: Wednesday, January 12, 2000 9:56 AM
Subject: [GENERAL] identifying performance hits: how to ???
Hello All,
Anyone know if read performance on a postgres database decreases at an
increasing rate, as the number of stored records increase?This is a TCL app, which makes entries into a single, table and from time
to time repopulates a grid control. It must rebuild the data in the grid
control, because other clients have since written to the same table.It seems as if I'm missing something fundamental... maybe I am... is some
kind of database cleanup necessary? With less than ten records, the grid
populates very quickly. Beyond that, performance slows to a crawl, until
it _seems_ that every new record doubles the time needed to retrieve the
records. My quick fix was to cache the data locally in TCL, and only
retrieve changed data from the database. But now as client demand
increases, as well as the number of clients making changes to the table,
I'm reaching the bottleneck again.The client asked me yesterday to start evaluating "more mainstream"
databases, which means that they're pissed off. Postgres is fun to work
with, but it's hard to learn about, and hard to justify to clients.By the way, I have experimented with populating the exact same grid control
on Windows NT, using MS Access (TCL runs just about anywhere). The grid
seemed to populate just about instantaneously. So, is the bottleneck in
Unix, in Postgres, and does anybody know how to make it faster?Cheers,
Rob************
From bouncefilter Wed Jan 12 11:23:39 2000
Received: from alert.infoplease.com (range.infoplease.com [208.222.166.25])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA65698
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 11:22:44 -0500 (EST)
(envelope-from kdebisschop@range.infoplease.com)
Received: from skillet.infoplease.com (skillet [10.0.1.212])
by alert.infoplease.com (8.9.3+Sun/8.9.3) with ESMTP id LAA00069;
Wed, 12 Jan 2000 11:22:12 -0500 (EST)
Received: (from kdebisschop@localhost)
by skillet.infoplease.com (8.9.3/8.9.1) id LAA09441;
Wed, 12 Jan 2000 11:22:13 -0500
Date: Wed, 12 Jan 2000 11:22:13 -0500
Message-Id: <200001121622.LAA09441@skillet.infoplease.com>
X-Authentication-Warning: skillet.infoplease.com: kdebisschop set sender to
kdebisschop@spaceheater.infoplease.com using -f
From: Karl DeBisschop <kdebisschop@range.infoplease.com>
To: pgsql-general@postgreSQL.org, rwagner@siac.com, squires@com.net
In-reply-to: <85256864.00542073.00@SIAC_NOTES_001.wisdom.siac.com>
(rwagner@siac.com)
Subject: Re: [GENERAL] identifying performance hits: how to ???
Reply-to: kdebisschop@range.infoplease.com
References: <85256864.00542073.00@SIAC_NOTES_001.wisdom.siac.com>
Anyone know if read performance on a postgres database decreases at
an increasing rate, as the number of stored records increase?It seems as if I'm missing something fundamental... maybe I am... is
some kind of database cleanup necessary? With less than ten
records, the grid populates very quickly. Beyond that, performance
slows to a crawl, until it _seems_ that every new record doubles the
time needed to retrieve...
Are you using indexes?
Are you vacuuming?
I may have incorrectly inferred table sizes and such, but the behavior
you describe seems odd - we typically work with hundreds of thousands
of entries in our tables with good results (though things do slow down
for the one DB we use with tens of millions of entries).
The client asked me yesterday to start evaluating "more mainstream"
databases, which means that they're pissed off. Postgres is fun to
work with, but it's hard to learn about, and hard to justify to
clients.
As for using a 'more mainstream' app, of course there's always that
pressure. FWIW, we have done well with the product so far. In about
a year of use for important (maybe even 'mission-critical') purposes,
we have only had one problem that was not easily solved ourselves.
And Postgresql, Inc. solved that one for us. With alot less
aggravation than most of our 'mainstream' vendors when we have a
problem involving their software.
--
Karl DeBisschop <kdebisschop@alert.infoplease.com>
617.832.0332 (Fax: 617.956.2696)
Information Please - your source for FREE online reference
http://www.infoplease.com - Your Ultimate Fact Finder
http://kids.infoplease.com - The Great Homework Helper
Netsaint Plugins Development
http://netsaintplug.sourceforge.net
From bouncefilter Wed Jan 12 11:23:40 2000
Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA65780
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 11:23:13 -0500 (EST) (envelope-from scrappy@hub.org)
Received: from localhost (scrappy@localhost)
by thelab.hub.org (8.9.3/8.9.1) with ESMTP id MAA64588;
Wed, 12 Jan 2000 12:23:28 -0400 (AST) (envelope-from scrappy@hub.org)
X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs
Date: Wed, 12 Jan 2000 12:23:23 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org>
To: Robert Wagner <rwagner@siac.com>
cc: pgsql-general@postgresql.org, squires@com.net
Subject: Re: [GENERAL] identifying performance hits: how to ???
In-Reply-To: <85256864.00542073.00@SIAC_NOTES_001.wisdom.siac.com>
Message-ID: <Pine.BSF.4.21.0001121221320.46499-100000@thelab.hub.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Have/do you perform reasonably regular vacuum's of the database?
Do you make use of indices to increase SELECT/UPDATE performance?
Have you checked out your queries using psql+EXPLAIN, to see that said
indices are being used?
What operating system are you using? hardware?
How are you starting up the postmaster?
On Wed, 12 Jan 2000, Robert Wagner wrote:
Hello All,
Anyone know if read performance on a postgres database decreases at an
increasing rate, as the number of stored records increase?This is a TCL app, which makes entries into a single, table and from time
to time repopulates a grid control. It must rebuild the data in the grid
control, because other clients have since written to the same table.It seems as if I'm missing something fundamental... maybe I am... is some
kind of database cleanup necessary? With less than ten records, the grid
populates very quickly. Beyond that, performance slows to a crawl, until
it _seems_ that every new record doubles the time needed to retrieve the
records. My quick fix was to cache the data locally in TCL, and only
retrieve changed data from the database. But now as client demand
increases, as well as the number of clients making changes to the table,
I'm reaching the bottleneck again.The client asked me yesterday to start evaluating "more mainstream"
databases, which means that they're pissed off. Postgres is fun to work
with, but it's hard to learn about, and hard to justify to clients.By the way, I have experimented with populating the exact same grid control
on Windows NT, using MS Access (TCL runs just about anywhere). The grid
seemed to populate just about instantaneously. So, is the bottleneck in
Unix, in Postgres, and does anybody know how to make it faster?Cheers,
Rob************
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
From bouncefilter Wed Jan 12 11:53:40 2000
Received: from news.tht.net (news.hub.org [216.126.91.242])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA74552;
Wed, 12 Jan 2000 11:52:55 -0500 (EST)
(envelope-from news@news.tht.net)
Received: (from news@localhost) by news.tht.net (8.9.3/8.9.3) id LAA29511;
Wed, 12 Jan 2000 11:23:39 -0500 (EST) (envelope-from news)
X-Authentication-Warning: news.tht.net: news set sender to <news> using -f
Sender: ckempf@singularity.enigami.com
X-Newsgroups: comp.databases.postgresql, comp.databases.postgresql.admin,
comp.databases.postgresql.hackers,
comp.databases.postgresql.questions, linux.act.postgres
Subject: Re: postgresql installation
References: <387c40b0@feednews.internext.fr>
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: text/plain; charset=US-ASCII
From: Cory Kempf <ckempf@enigami.com>
Message-ID: <5faembw96k.fsf@singularity.enigami.com>
Lines: 30
X-Newsreader: Gnus v5.6.45/XEmacs 21.1 - "Big Bend"
X-Trace: tw11.nn.bcandid.com 947694214 216.204.32.42 (Wed,
12 Jan 2000 09:23:34 MST)
Organization: bCandid - Powering the world's discussions - http://bCandid.com
Date: Wed, 12 Jan 2000 16:23:35 GMT
To:
pgsql-hackers@postgresql.org.pgsql-admin@postgresql.org.pgsql-questions@postgresql.org
"Netra systems" <julien@netra-systems.com> writes:
hello,
i have pb with the postgre sql installation :
i compile all .. ok
but when i want to run postmaster or anything else it say : no db dir :
data/../template1 ...
i have no data dir in my postgre dinstalled dir ....
how can i have this dir with all into ?
Have you run initdb? My guess is no.
Also, when you run initdb, the data directory it uses (I use /var/lib/pgsql,
which I set up by having my .zshrc file export PGDATA=/var/lib/pgsql
for my postgres account) needs to be the same as that passed to postmaster
via the -D option.
Oh, initdb really should be run as the postgres user. Definately not as
root! Make sure your permissions are set up ahead of time!
+C
--
Have you signed up to be a bone marrow doner? All it takes is a simple
blood test, and it can save a life. <http://www.marrow.org>
Cory Kempf Macintosh / Unix Consulting & Software Development
ckempf@enigami.com <http://www.enigami.com/~ckempf/>
From bouncefilter Wed Jan 12 11:28:40 2000
Received: from sakaki.communique.net (sakaki.communique.net [204.27.64.202])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA66597
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 11:28:16 -0500 (EST)
(envelope-from davidb@vectormath.com)
From: davidb@vectormath.com
Received: from bullwinkle (adsl-204-1-67-149.indi.se.verio.net [204.1.67.149])
by sakaki.communique.net (8.8.8/8.8.8) with SMTP id KAA11822
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 10:28:15 -0600 (CST)
Message-ID: <009f01bf5d19$c1665d20$0602010a@bullwinkle.vectormath>
To: <pgsql-general@postgresql.org>
Subject: Fw: [GENERAL] identifying performance hits: how to ???
Date: Wed, 12 Jan 2000 10:26:16 -0600
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
I forgot the punch line:
If you are requiring some sort of combinatorial operation, you might
consider restructuring your query or doing some of the query's work
programmatically.
David Boerwinkle
-----Original Message-----
From: davidb@vectormath.com <davidb@vectormath.com>
To: Robert Wagner <rwagner@siac.com>; pgsql-general@postgresql.org
<pgsql-general@postgresql.org>
Cc: squires@com.net <squires@com.net>
Date: Wednesday, January 12, 2000 10:21 AM
Subject: Re: [GENERAL] identifying performance hits: how to ???
By asking about missing something fundamental, you have invited
less-than-expert feedback (i.e. feedback from me).'adding a record doubles the retrieval time' makes it sound as though
somewhere in your query to populate the grid control you are requiring a
combinatorial operation (that is, "compare every record in table A with
every record in table B"). This, of course, assumes that there is some
discrepancy between what you are running on Postgres and what you tried on
Windows NT (MS-SQL?).David Boerwinkle
-----Original Message-----
From: Robert Wagner <rwagner@siac.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Cc: squires@com.net <squires@com.net>
Date: Wednesday, January 12, 2000 9:56 AM
Subject: [GENERAL] identifying performance hits: how to ???Hello All,
Anyone know if read performance on a postgres database decreases at an
increasing rate, as the number of stored records increase?This is a TCL app, which makes entries into a single, table and from time
to time repopulates a grid control. It must rebuild the data in the grid
control, because other clients have since written to the same table.It seems as if I'm missing something fundamental... maybe I am... is some
kind of database cleanup necessary? With less than ten records, the grid
populates very quickly. Beyond that, performance slows to a crawl, until
it _seems_ that every new record doubles the time needed to retrieve the
records. My quick fix was to cache the data locally in TCL, and only
retrieve changed data from the database. But now as client demand
increases, as well as the number of clients making changes to the table,
I'm reaching the bottleneck again.The client asked me yesterday to start evaluating "more mainstream"
databases, which means that they're pissed off. Postgres is fun to work
with, but it's hard to learn about, and hard to justify to clients.By the way, I have experimented with populating the exact same grid
control
on Windows NT, using MS Access (TCL runs just about anywhere). The grid
seemed to populate just about instantaneously. So, is the bottleneck in
Unix, in Postgres, and does anybody know how to make it faster?Cheers,
Rob************
From bouncefilter Wed Jan 12 11:55:40 2000
Received: from mailbox.reptiles.org (IDENT:root@mailbox.reptiles.org
[198.96.117.155]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA75092
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 11:55:21 -0500 (EST)
(envelope-from jim@reptiles.org)
Received: from localhost (2027 bytes) by mailbox.reptiles.org
via sendmail with P:stdio/R:bind_hosts/T:inet_zone_bind_smtp
(sender: <jim>) (ident <jim> using unix)
id <m128R31-000814C@mailbox.reptiles.org>
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 11:55:03 -0500 (EST)
(Smail-3.2.0.108 1999-Sep-19 #3 built 1999-Oct-27)
Date: Wed, 12 Jan 2000 11:55:03 -0500
From: Jim Mercer <jim@reptiles.org>
To: The Hermit Hacker <scrappy@hub.org>
Cc: Robert Wagner <rwagner@siac.com>, pgsql-general@postgreSQL.org,
squires@com.net
Subject: Re: [GENERAL] identifying performance hits: how to ???
Message-ID: <20000112115502.U4188@reptiles.org>
References: <85256864.00542073.00@SIAC_NOTES_001.wisdom.siac.com>
<Pine.BSF.4.21.0001121221320.46499-100000@thelab.hub.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0i
In-Reply-To: <Pine.BSF.4.21.0001121221320.46499-100000@thelab.hub.org>;
from scrappy@hub.org on Wed, Jan 12, 2000 at 12:23:23PM -0400
On Wed, Jan 12, 2000 at 12:23:23PM -0400, The Hermit Hacker wrote:
Have/do you perform reasonably regular vacuum's of the database?
on my databases, i have only been successful in doing a "VACUUM VERBOSE" on
my tables.
i suspect i've got the syntax wrong or something:
nagoss=> \h vacuum
Command: vacuum
Description: vacuum the database, i.e. cleans out deleted records, updates statistics
Syntax:
VACUUM [VERBOSE] [ANALYZE] [table]
or
VACUUM [VERBOSE] ANALYZE [table [(attr1, ...attrN)]];
nagoss=> vacuum verbose analyse switches;
ERROR: parser: parse error at or near "switches"
nagoss=> vacuum verbose switches;
NOTICE: --Relation switches--
NOTICE: Pages 1: Changed 1, Reapped 0, Empty 0, New 0; Tup 9: Vac 0, Keep/VTL 0/0, Crash 0, UnUsed 0, MinLen 78, MaxLen 78; Re-using: Free/Avail. Space 0/0; EndEmpty/Avail. Pages 0/0. Elapsed 0/0 sec.
NOTICE: Index switch_name: Pages 2; Tuples 9. Elapsed 0/0 sec.
VACUUM
what is the correct syntax for doing a vacuum analyse?
--
[ Jim Mercer jim@reptiles.org +1 416 506-0654 ]
[ Reptilian Research -- Longer Life through Colder Blood ]
[ Don't be fooled by cheap Finnish imitations; BSD is the One True Code. ]
From bouncefilter Wed Jan 12 17:44:43 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id RAA26423
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 17:44:01 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id 6FBE31FE8; Wed, 12 Jan 2000 17:42:47 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1])
by pcr.ca (Postfix) with ESMTP id 667701F8C
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 17:42:47 +0000 (GMT)
Date: Wed, 12 Jan 2000 17:42:47 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: pgsql-general@postgresql.org
Subject: rule or trigger on select?
Message-ID: <Pine.BSF.4.10.10001121730230.68777-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
How can I update on select?
From the User's Guide, it seems triggers can only be used on INSERT,
UPDATE and DELTE events. As for rules, the guide says they can be used on
SELECT. When I actually tried updating on select using rules, here's what
I got:
test=> CREATE RULE tab_rule AS ON select
test-> TO tab
test-> DO UPDATE tab SET stats=stats+1;
ERROR: only instead-select rules currently supported on select
My ultimate goal is to keep statistics for tab counting how many times
records are being selected. Unfortunately, I cannot simply use UPDATE
since my SELECT queries use LIMIT, which is not supported by UPDATE.
Looking forward to any suggestions,
Marc
From bouncefilter Wed Jan 12 12:55:40 2000
Received: from corvette.mascari.com (dhcp26142035.columbus.rr.com
[24.26.142.35]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA92293
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 12:54:42 -0500 (EST)
(envelope-from mascarm@mascari.com)
Received: from mascari.com (ferrari.mascari.com [192.168.2.1])
by corvette.mascari.com (8.9.3/8.9.3) with ESMTP id MAA01337;
Wed, 12 Jan 2000 12:47:49 -0500
Message-ID: <387CBDF9.F5696981@mascari.com>
Date: Wed, 12 Jan 2000 12:46:33 -0500
From: Mike Mascari <mascarm@mascari.com>
Organization: Mascari Development Inc
X-Mailer: Mozilla 4.7 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us>
CC: PostgreSQL-general <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] Simulating an outer join
References: <200001121611.LAA03508@candle.pha.pa.us>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Bruce Momjian wrote:
I have been thinking about how to simulate an outer join. It seems the
best way is to do:SELECT tab1.col1, tab2.col3
FROM tab1, tab2
WHERE tab1.col1 = tab2.col2
UNION ALL
SELECT tab1.col1, NULL
FROM tab1
WHERE tab1.col1 NOT IN (SELECT tab2.col2 FROM tab2)Comments? I know someone was asking about this recently.
I wouldn't use IN ;-)
SELECT table1.key, table2.value
FROM table1, table2
WHERE table1.key = table2.key
UNION ALL
SELECT table1.key, NULL
FROM table1 WHERE NOT EXISTS
(SELECT table2.key FROM table2 WHERE table1.key = table2.key);
Mike Mascari
From bouncefilter Wed Jan 12 12:54:41 2000
Received: from scorpexc4.houstoncell.com (zeus.houstoncellular.com
[206.109.152.194]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA92033
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 12:53:40 -0500 (EST)
(envelope-from YoungblG@houstoncellular.com)
Received: by scorpexc4.houstoncell.com with Internet Mail Service
(5.5.2650.21)
id <CZZYBZCF>; Wed, 12 Jan 2000 11:53:04 -0600
Message-ID: <2B9713A99045D211BB4E0008C7566869DC9F8D@scorpexc1.houstoncell.com>
From: Greg Youngblood <YoungblG@houstoncellular.com>
To: "'PostgreSQL General List'" <pgsql-general@postgresql.org>
Subject: Rules, triggers, ??? - What is the best way to enforce data-valid
ation tests?
Date: Wed, 12 Jan 2000 11:52:52 -0600
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
I am in the process of creating a large relational database. One of the key
things I need to include in this database is a system to maintain data
integrity across multiple tables.
here's an example:
Table: items
item_id description vendor_id model
cost
stuff1 Stuff stuff s-1
14.25
Table: vendors
vendor_id vendor contact phone
stuff Stuff Inc. Mr. Stuff
xxx.xxx.xxxx
Table: order
order_id item_id qty
price
1 stuff1 3
19.95
In this example, table "items" would be populated with a list of items with
item_id being a unique key; table "vendors" would be a list of vendors with
vendor_id being a unique key; and, table "order" would be line items from an
order. These are just samples, what i'm trying to illustrate are the
relationships between the tables.
The first relationship would be between "items" and "vendors" and the second
would be between "items" and "order". The same type of relationship exists
in both examples. My goal is to make the database validate any new records
or changes to existing records such that vendor_id in "items" must already
exist in "vendors", and that item_id in "order" must already exist in
"items".
you could not add or change a record to "order" where item_id does not
already exist in "items", and, you could not add or change a record in
"items" where vendor_id does not already exist in "vendors".
There are two ways to handle this. The first way, and the way I've generally
done in the past, is making the data-validation tests part of the program.
This means I could go in to psql and manually enter invalid data. It also
means there is the possibility of the program, due to bug or other problems,
not always enforcing the integrity rules.
The second way is to place these criteria in the database itself, and this
is what I want to do. This is also where I'm at my weakest.
What is the best way to implement this. Best, to me, refers to the simplest,
most direct, and having the least impact on performance. Would it be by
using triggers? Or rules? Or keeping it in the program and not in the
database? Or something else entirely?
In the past I've tried triggers and rules and never did get them to work to
my satisfaction. Either they would work for some tasks, but I couldn't adapt
them to work in more complicated tables, or there were syntax problems and I
never got them to work at all. If anyone can help, and provide some
examples, i would greatly appreciate it.
I currently have postgres 6.5.0 on the production server, and 6.5.1 or 6.5.2
on my development boxes.
Many thanks in advance.
Greg
Gregory S. Youngblood
ext 2164
From bouncefilter Wed Jan 12 12:58:40 2000
Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60])
by hub.org (8.9.3/8.9.3) with ESMTP id MAA92816
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 12:58:12 -0500 (EST) (envelope-from scrappy@hub.org)
Received: from localhost (scrappy@localhost)
by thelab.hub.org (8.9.3/8.9.1) with ESMTP id NAA65742;
Wed, 12 Jan 2000 13:57:42 -0400 (AST) (envelope-from scrappy@hub.org)
X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs
Date: Wed, 12 Jan 2000 13:57:36 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org>
To: Karl DeBisschop <kdebisschop@range.infoplease.com>
cc: pgsql-general@postgreSQL.org, rwagner@siac.com, squires@com.net
Subject: Re: [GENERAL] identifying performance hits: how to ???
In-Reply-To: <200001121622.LAA09441@skillet.infoplease.com>
Message-ID: <Pine.BSF.4.21.0001121356380.46499-100000@thelab.hub.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Wed, 12 Jan 2000, Karl DeBisschop wrote:
Anyone know if read performance on a postgres database decreases at
an increasing rate, as the number of stored records increase?It seems as if I'm missing something fundamental... maybe I am... is
some kind of database cleanup necessary? With less than ten
records, the grid populates very quickly. Beyond that, performance
slows to a crawl, until it _seems_ that every new record doubles the
time needed to retrieve...Are you using indexes?
Are you vacuuming?
I may have incorrectly inferred table sizes and such, but the behavior
you describe seems odd - we typically work with hundreds of thousands
of entries in our tables with good results (though things do slow down
for the one DB we use with tens of millions of entries).
An example of a large database that ppl can see in action...the search
engine we are using on PostgreSQL, when fully populated, works out to
around 6million records... and is reasnably quick...
From bouncefilter Wed Jan 12 13:01:40 2000
Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60])
by hub.org (8.9.3/8.9.3) with ESMTP id NAA95969
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 13:00:56 -0500 (EST) (envelope-from scrappy@hub.org)
Received: from localhost (scrappy@localhost)
by thelab.hub.org (8.9.3/8.9.1) with ESMTP id OAA65826;
Wed, 12 Jan 2000 14:00:18 -0400 (AST) (envelope-from scrappy@hub.org)
X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs
Date: Wed, 12 Jan 2000 14:00:17 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org>
To: Jim Mercer <jim@reptiles.org>
cc: Robert Wagner <rwagner@siac.com>, pgsql-general@postgreSQL.org,
squires@com.net
Subject: Re: [GENERAL] identifying performance hits: how to ???
In-Reply-To: <20000112115502.U4188@reptiles.org>
Message-ID: <Pine.BSF.4.21.0001121358230.46499-100000@thelab.hub.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Wed, 12 Jan 2000, Jim Mercer wrote:
On Wed, Jan 12, 2000 at 12:23:23PM -0400, The Hermit Hacker wrote:
Have/do you perform reasonably regular vacuum's of the database?
on my databases, i have only been successful in doing a "VACUUM VERBOSE" on
my tables.i suspect i've got the syntax wrong or something:
nagoss=> \h vacuum
Command: vacuum
Description: vacuum the database, i.e. cleans out deleted records, updates statistics
Syntax:
VACUUM [VERBOSE] [ANALYZE] [table]
or
VACUUM [VERBOSE] ANALYZE [table [(attr1, ...attrN)]];nagoss=> vacuum verbose analyse switches;
ERROR: parser: parse error at or near "switches"
nagoss=> vacuum verbose switches;
NOTICE: --Relation switches--
NOTICE: Pages 1: Changed 1, Reapped 0, Empty 0, New 0; Tup 9: Vac 0, Keep/VTL 0/0, Crash 0, UnUsed 0, MinLen 78, MaxLen 78; Re-using: Free/Avail. Space 0/0; EndEmpty/Avail. Pages 0/0. Elapsed 0/0 sec.
NOTICE: Index switch_name: Pages 2; Tuples 9. Elapsed 0/0 sec.
VACUUMwhat is the correct syntax for doing a vacuum analyse?
I've generally just done a 'vacuum verbose analyze' and do the whole
database ...
But, just tried it on a table and:
udmsearch=> vacuum verbose analyze url;
NOTICE: --Relation url--
NOTICE: Pages 240: Changed 2, Reapped 213, Empty 0, New 0; Tup 2740: Vac 5648, Keep/VTL 0/0, Crash 0, UnUsed 0, MinLen 120, MaxLen 616; Re-using: Free/Avail. Space 813836/811912; EndEmpty/Avail. Pages 0/212. Elapsed 0/0 sec.
NOTICE: Index url_next_index_time: Pages 35; Tuples 2740: Deleted 5648. Elapsed 0/0 sec.
NOTICE: Index url_crc: Pages 34; Tuples 2740: Deleted 5648. Elapsed 0/0 sec.
NOTICE: Index url_url: Pages 90; Tuples 2740: Deleted 4973. Elapsed 0/0 sec.
NOTICE: Index url_pkey: Pages 25; Tuples 2740: Deleted 4973. Elapsed 0/0 sec.
NOTICE: Rel url: Pages: 240 --> 142; Tuple(s) moved: 1486. Elapsed 0/0 sec.
NOTICE: Index url_next_index_time: Pages 38; Tuples 2740: Deleted 1486. Elapsed 0/0 sec.
NOTICE: Index url_crc: Pages 46; Tuples 2740: Deleted 1486. Elapsed 0/0 sec.
NOTICE: Index url_url: Pages 90; Tuples 2740: Deleted 1486. Elapsed 0/0 sec.
NOTICE: Index url_pkey: Pages 26; Tuples 2740: Deleted 1486. Elapsed 0/0 sec.
VACUUM
udmsearch=>
What version of PostgreSQL are you using?
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
From bouncefilter Wed Jan 12 13:09:40 2000
Received: from mailgate1a.bridge.com (firewall-user@mailgate1a.ext.bridge.com
[167.76.159.72]) by hub.org (8.9.3/8.9.3) with SMTP id NAA97996
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 13:09:35 -0500 (EST)
(envelope-from tayers@bridge.com)
From: tayers@bridge.com
Received: by mailgate1a.bridge.com; id MAA15591;
Wed, 12 Jan 2000 12:09:33 -0600
Received: from unknown(167.76.56.34) by mailgate1a.bridge.com via smap (V5.5)
id xma015491; Wed, 12 Jan 00 12:09:13 -0600
Received: from mnmailhost (mnmailhost.bridge.com [167.76.59.14]) by
mail1srv.bridge.com (8.8.8/8.7.3) with SMTP id MAA14153;
Wed, 12 Jan 2000 12:09:11 -0600 (CST)
Received: from 89-8 by mnmailhost (SMI-8.6/SMI-4.1)
id NAA05995; Wed, 12 Jan 2000 13:09:08 -0500
Date: Wed, 12 Jan 2000 13:09:08 -0500
Message-Id: <200001121809.NAA05995@mnmailhost>
To: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] identifying performance hits: how to ???
References: <85256864.00542073.00@SIAC_NOTES_001.wisdom.siac.com>
<Pine.BSF.4.21.0001121221320.46499-100000@thelab.hub.org>
<20000112115502.U4188@reptiles.org>
Reply-To: tayers@bridge.com
Hi Jim,
"J" == Jim Mercer <jim@reptiles.org> writes:
J> i suspect i've got the syntax wrong or something:
Good suspicion.
J> nagoss=> \h vacuum
J> Command: vacuum
J> Description: vacuum the database, i.e. cleans out deleted records, updates statistics
J> Syntax:
J> VACUUM [VERBOSE] [ANALYZE] [table]
J> or
J> VACUUM [VERBOSE] ANALYZE [table [(attr1, ...attrN)]];
J> what is the correct syntax for doing a vacuum analyse?
The correct syntax as shown in the help message is
'vacuum analyze'. Notice the alternative spelling of analyse with a
'z' not an 's'.
Hope you have a very nice day, :-)
Tim Ayers (tayers@bridge.com)
Norman, Oklahoma
From bouncefilter Wed Jan 12 13:28:40 2000
Received: from portal.west.saic.com (portal.west.saic.com [198.151.12.15])
by hub.org (8.9.3/8.9.3) with SMTP id NAA02555
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 13:28:34 -0500 (EST)
(envelope-from officers@aries.tucson.saic.com)
Received: from gatespass.tucson.saic.com by portal.west.saic.com
via smtpd (for postgresql.org [216.126.84.28]) with SMTP;
12 Jan 2000 18:28:33 UT
Received: (from adm@localhost) by gatespass.tucson.saic.com (8.8.2/8.8.2) id
LAA02053 for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 11:28:31 -0700 (MST)
X-Authentication-Warning: gatespass.tucson.saic.com: adm set sender to
<officers@aries.tucson.saic.com> using -f
Received: from wasp.tucson.saic.com(139.121.3.171) by
gatespass.tucson.saic.com via smap (V2.0)
id xma002051; Wed, 12 Jan 00 11:28:27 -0700
Received: from aries.tucson.saic.com (localhost [127.0.0.1]) by
wasp.tucson.saic.com (980427.SGI.8.8.8/950213.SGI.AUTOCF) via
ESMTP id LAA45826 for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 11:28:26 -0700 (MST)
Sender: officers@aries.tucson.saic.com
Message-ID: <387CC7CA.7D2AB0F5@aries.tucson.saic.com>
Date: Wed, 12 Jan 2000 11:28:26 -0700
From: Sarah Officer <officers@aries.tucson.saic.com>
X-Mailer: Mozilla 4.07C-SGI [en] (X11; I; IRIX 6.5 IP32)
MIME-Version: 1.0
To: PostgreSQL-general <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] Simulating an outer join
References: <200001121611.LAA03508@candle.pha.pa.us>
<387CBDF9.F5696981@mascari.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Can somebody comment on using EXISTS vs. IN in a subselect? I have
some statements with subselects, and I'd like to understand the
ramifications of choosing EXISTS or IN.
Sarah Officer
officers@aries.tucson.saic.com
Mike Mascari wrote:
Bruce Momjian wrote:
I have been thinking about how to simulate an outer join. It seems the
best way is to do:SELECT tab1.col1, tab2.col3
FROM tab1, tab2
WHERE tab1.col1 = tab2.col2
UNION ALL
SELECT tab1.col1, NULL
FROM tab1
WHERE tab1.col1 NOT IN (SELECT tab2.col2 FROM tab2)Comments? I know someone was asking about this recently.
I wouldn't use IN ;-)
SELECT table1.key, table2.value
FROM table1, table2
WHERE table1.key = table2.key
UNION ALL
SELECT table1.key, NULL
FROM table1 WHERE NOT EXISTS
(SELECT table2.key FROM table2 WHERE table1.key = table2.key);Mike Mascari
************
From bouncefilter Wed Jan 12 13:53:41 2000
Received: from news.tht.net (news.hub.org [216.126.91.242])
by hub.org (8.9.3/8.9.3) with ESMTP id NAA11413
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 13:52:56 -0500 (EST)
(envelope-from news@news.tht.net)
Received: (from news@localhost) by news.tht.net (8.9.3/8.9.3) id NAA38557
for pgsql-general@postgresql.org; Wed, 12 Jan 2000 13:35:58 -0500 (EST)
(envelope-from news)
X-Authentication-Warning: news.tht.net: news set sender to <news> using -f
From: "T.D. Brace" <brace@stargate.org>
X-Newsgroups: comp.databases.postgresql.questions
Subject: Postgresql vs Mysql
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
Message-ID: <gQ3f4.2469$sb.58290@news1.sttls1.wa.home.com>
Date: Wed, 12 Jan 2000 18:35:56 GMT
X-Complaints-To: abuse@home.net
X-Trace: news1.sttls1.wa.home.com 947702156 24.1.30.98 (Wed,
12 Jan 2000 10:35:56 PST)
Organization: @Home Network
To: pgsql-questions@postgresql.org
Hello,
I have a simple search engine written for MySQL currently. I am in the
middle of rewriting it
for more speed and functionality, but I am finding MySQL somewhat lacking
(or perhaps it's
my own skill?). The search engine contains from 5000 - 20000 records at any
time. There
are about 5 text (char(255)) fields that need to be searched with simple
boolean operators
of AND, OR, and NOT. This seems to take quite some time currently - up to
60 seconds
on an idle FreeBSD 3.2 server (dual p3 500's, 512mb ram, lvd scsi). If I
rewrite for Postgresql,
can I hope to see any speed increases - or at least equivilant speed?
Under postgres can I
check for a word NOT existing in a set? For example: %rob% <> "Fred Sally
Robert Robin John" ?
(ignoring the case)?
I am looking for general info here - if I should head towards postgres or
not.
Thanks for any help.
Ted
From bouncefilter Wed Jan 12 14:06:41 2000
Received: from mailbox.reptiles.org (IDENT:root@mailbox.reptiles.org
[198.96.117.155]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA16604
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 14:06:14 -0500 (EST)
(envelope-from jim@reptiles.org)
Received: from localhost (1712 bytes) by mailbox.reptiles.org
via sendmail with P:stdio/R:bind_hosts/T:inet_zone_bind_smtp
(sender: <jim>) (ident <jim> using unix)
id <m128T5w-000814C@mailbox.reptiles.org>
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 14:06:12 -0500 (EST)
(Smail-3.2.0.108 1999-Sep-19 #3 built 1999-Oct-27)
Date: Wed, 12 Jan 2000 14:06:12 -0500
From: Jim Mercer <jim@reptiles.org>
To: tayers@bridge.com
Cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] identifying performance hits: how to ???
Message-ID: <20000112140611.V4188@reptiles.org>
References: <85256864.00542073.00@SIAC_NOTES_001.wisdom.siac.com>
<Pine.BSF.4.21.0001121221320.46499-100000@thelab.hub.org>
<20000112115502.U4188@reptiles.org>
<200001121809.NAA05995@mnmailhost>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0i
In-Reply-To: <200001121809.NAA05995@mnmailhost>;
from tayers@bridge.com on Wed, Jan 12, 2000 at 01:09:08PM -0500
On Wed, Jan 12, 2000 at 01:09:08PM -0500, tayers@bridge.com wrote:
J> nagoss=> \h vacuum
J> Command: vacuum
J> Description: vacuum the database, i.e. cleans out deleted records, updates statistics
J> Syntax:
J> VACUUM [VERBOSE] [ANALYZE] [table]
J> or
J> VACUUM [VERBOSE] ANALYZE [table [(attr1, ...attrN)]];J> what is the correct syntax for doing a vacuum analyse?
The correct syntax as shown in the help message is
'vacuum analyze'. Notice the alternative spelling of analyse with a
'z' not an 's'.Hope you have a very nice day, :-)
[ picture of jim slapping himself in the forehead ]
geez.
i know it was right in front of me, but, grrrr.
[ in his best homer simpson voice ] Doh!
--
[ Jim Mercer jim@reptiles.org +1 416 506-0654 ]
[ Reptilian Research -- Longer Life through Colder Blood ]
[ Don't be fooled by cheap Finnish imitations; BSD is the One True Code. ]
From bouncefilter Wed Jan 12 14:59:44 2000
Received: from datmail03.dat.com ([209.241.199.3])
by hub.org (8.9.3/8.9.3) with ESMTP id OAA27706
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 14:58:53 -0500 (EST)
(envelope-from philip.culberson@dat.com)
Received: by datmail03.dat.com with Internet Mail Service (5.5.2448.0)
id <XF5BZ2RC>; Wed, 12 Jan 2000 11:58:20 -0800
Message-ID: <A95EFC3B707BD311986C00A0C9E95B6A04B3E0@datmail03.dat.com>
From: "Culberson, Philip" <philip.culberson@dat.com>
To: "'Mike Mascari'" <mascarm@mascari.com>, Bruce Momjian
<pgman@candle.pha.pa.us>, "'Bruce Bantos'" <anon@mgfairfax.rr.com>
Cc: PostgreSQL-general <pgsql-general@postgreSQL.org>
Subject: RE: [GENERAL] Simulating an outer join
Date: Wed, 12 Jan 2000 11:58:19 -0800
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Content-Type: text/plain;
charset="iso-8859-1"
It seems to me that in this case Bruce would be better off to use a default
value and NOT "simulate" an outer join.
I suggest the following:
Instead of using a character abbreviation for the relation, use a number.
Since the list of categories is most likely going to remain small, you can
use an int2. This has two advantages.
1) It is then truly divorced from the text description. If you ever change
"Small Business" to "Not Really Big Business", the abbreviation "SB" loses
it's meaning.
2) Less storage. Per the user documentation, an int2 takes 2 bytes of
storage. Both char[n] and varchar[n] take 4+n bytes of storage, so even if
com_cat_abbr is NULL, you still burn at least 4 bytes!
Default the value of com_cat_abbr to 0 and make an appropriate entry in the
company_category table (say, with a com_cat_long value of "Undefined").
Since you are already using the lookup table to populate pulldowns,
enforcing that the user makes a choice in your client app should not be a
problem.
Now you can just do a straight join and not incur the cost of doing a union
or sub-selects, etc.
Hope this helps.
Phil Culberson
-----Original Message-----
From: Mike Mascari [mailto:mascarm@mascari.com]
Sent: Wednesday, January 12, 2000 9:47 AM
To: Bruce Momjian
Cc: PostgreSQL-general
Subject: Re: [GENERAL] Simulating an outer join
Bruce Momjian wrote:
I have been thinking about how to simulate an outer join. It seems the
best way is to do:SELECT tab1.col1, tab2.col3
FROM tab1, tab2
WHERE tab1.col1 = tab2.col2
UNION ALL
SELECT tab1.col1, NULL
FROM tab1
WHERE tab1.col1 NOT IN (SELECT tab2.col2 FROM tab2)Comments? I know someone was asking about this recently.
I wouldn't use IN ;-)
SELECT table1.key, table2.value
FROM table1, table2
WHERE table1.key = table2.key
UNION ALL
SELECT table1.key, NULL
FROM table1 WHERE NOT EXISTS
(SELECT table2.key FROM table2 WHERE table1.key = table2.key);
Mike Mascari
************
From bouncefilter Wed Jan 12 15:37:42 2000
Received: from mail2.mgfairfax.rr.com (fe2.southeast.rr.com [24.93.67.49])
by hub.org (8.9.3/8.9.3) with ESMTP id PAA82551
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 15:37:28 -0500 (EST)
(envelope-from anon@mgfairfax.rr.com)
Received: from rsdevelop ([24.28.195.122]) by mail2.mgfairfax.rr.com with
Microsoft SMTPSVC(5.5.1877.197.19); Wed, 12 Jan 2000 15:37:23 -0500
Message-ID: <042e01bf5d3d$5bf256a0$0200a8c0@rsdevelop>
From: "Bruce Bantos" <anon@mgfairfax.rr.com>
To: "PostgreSQL-general" <pgsql-general@postgresql.org>
References: <A95EFC3B707BD311986C00A0C9E95B6A04B3E0@datmail03.dat.com>
Subject: Re: [GENERAL] Simulating an outer join
Date: Wed, 12 Jan 2000 15:41:10 -0500
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
I was originally trying to avoid this, but I think you make a good point.
The default value is probably best for this case. Thanks for the solid
argument.
----- Original Message -----
From: "Culberson, Philip" <philip.culberson@dat.com>
It seems to me that in this case Bruce would be better off to use a
default
value and NOT "simulate" an outer join.
I suggest the following:
Instead of using a character abbreviation for the relation, use a number.
Since the list of categories is most likely going to remain small, you can
use an int2. This has two advantages.1) It is then truly divorced from the text description. If you ever
change
"Small Business" to "Not Really Big Business", the abbreviation "SB" loses
it's meaning.2) Less storage. Per the user documentation, an int2 takes 2 bytes of
storage. Both char[n] and varchar[n] take 4+n bytes of storage, so even
if
com_cat_abbr is NULL, you still burn at least 4 bytes!
Default the value of com_cat_abbr to 0 and make an appropriate entry in
the
company_category table (say, with a com_cat_long value of "Undefined").
Since you are already using the lookup table to populate pulldowns,
enforcing that the user makes a choice in your client app should not be a
problem.Now you can just do a straight join and not incur the cost of doing a
union
or sub-selects, etc.
Hope this helps.
Phil Culberson
-----Original Message-----
From: Mike Mascari [mailto:mascarm@mascari.com]
Sent: Wednesday, January 12, 2000 9:47 AM
To: Bruce Momjian
Cc: PostgreSQL-general
Subject: Re: [GENERAL] Simulating an outer joinBruce Momjian wrote:
I have been thinking about how to simulate an outer join. It seems the
best way is to do:SELECT tab1.col1, tab2.col3
FROM tab1, tab2
WHERE tab1.col1 = tab2.col2
UNION ALL
SELECT tab1.col1, NULL
FROM tab1
WHERE tab1.col1 NOT IN (SELECT tab2.col2 FROM tab2)Comments? I know someone was asking about this recently.
I wouldn't use IN ;-)
SELECT table1.key, table2.value
FROM table1, table2
WHERE table1.key = table2.key
UNION ALL
SELECT table1.key, NULL
FROM table1 WHERE NOT EXISTS
(SELECT table2.key FROM table2 WHERE table1.key = table2.key);Mike Mascari
************
From bouncefilter Wed Jan 12 15:52:42 2000
Received: from post.webmailer.de (natmail2.webmailer.de [192.67.198.65])
by hub.org (8.9.3/8.9.3) with ESMTP id PAA84727
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 15:52:04 -0500 (EST) (envelope-from o@mueschke.de)
Received: from ompc9.dom.de (A11a2.pppool.de [213.6.17.162])
by post.webmailer.de (8.9.3/8.8.7) with ESMTP id VAA00746;
Wed, 12 Jan 2000 21:51:54 +0100 (MET)
Received: from ompc3.dom.de (mueschke.de) [192.168.47.13] (om)
by ompc9.dom.de with esmtp (Exim 2.05 #1 (Debian))
id 128UjO-0004Yn-00; Wed, 12 Jan 2000 21:51:02 +0100
Sender: om@post.webmailer.de
Message-ID: <387CE893.D1383668@mueschke.de>
Date: Wed, 12 Jan 2000 20:48:19 +0000
From: Oliver Mueschke <o@mueschke.de>
X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.13-7mdksmp-fb i686)
X-Accept-Language: de, en
MIME-Version: 1.0
To: Sarah Officer <officers@aries.tucson.saic.com>
CC: pgsql-general@postgresql.org
Subject: Re: [GENERAL] constant column value in view with union
References: <387BA3A7.6F937A4D@aries.tucson.saic.com>
<387BA7FF.6465C6BD@aries.tucson.saic.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sarah Officer wrote:
The view is something like this:
create view Foo as
select a, b, c, 'OK' as status
from table1
where ...
union
select a, b, c, 'BAD' as status
from table1
where ...
you could try it with a CASE WHEN ... THEN ... ELSE ... END
oliver
From bouncefilter Wed Jan 12 15:59:42 2000
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id PAA85857
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 15:59:34 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id
PAA14434;
Wed, 12 Jan 2000 15:55:57 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001122055.PAA14434@candle.pha.pa.us>
Subject: Re: [GENERAL] Simulating an outer join
In-Reply-To: <387CBDF9.F5696981@mascari.com> from Mike Mascari at "Jan 12,
2000
12:46:33 pm"
To: Mike Mascari <mascarm@mascari.com>
Date: Wed, 12 Jan 2000 15:55:57 -0500 (EST)
CC: PostgreSQL-general <pgsql-general@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Bruce Momjian wrote:
I have been thinking about how to simulate an outer join. It seems the
best way is to do:SELECT tab1.col1, tab2.col3
FROM tab1, tab2
WHERE tab1.col1 = tab2.col2
UNION ALL
SELECT tab1.col1, NULL
FROM tab1
WHERE tab1.col1 NOT IN (SELECT tab2.col2 FROM tab2)Comments? I know someone was asking about this recently.
I wouldn't use IN ;-)
SELECT table1.key, table2.value
FROM table1, table2
WHERE table1.key = table2.key
UNION ALL
SELECT table1.key, NULL
FROM table1 WHERE NOT EXISTS
(SELECT table2.key FROM table2 WHERE table1.key = table2.key);
Yes, this is our brain-damaged parser/optmizer that likes the usually
slower EXISTS with correlated subquery to the much clearer NOT IN.
Bummer.
I want to avoid having to put this workaround into my book, but I may
have no choice. The work around is so non-obvious as to be a terrible
hinderance for normal users.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From bouncefilter Wed Jan 12 16:04:42 2000
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id QAA89841
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 16:04:04 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id
QAA14618;
Wed, 12 Jan 2000 16:00:40 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001122100.QAA14618@candle.pha.pa.us>
Subject: Re: [GENERAL] Simulating an outer join
In-Reply-To: <387CC7CA.7D2AB0F5@aries.tucson.saic.com> from Sarah Officer at
"Jan 12, 2000 11:28:26 am"
To: Sarah Officer <officers@aries.tucson.saic.com>
Date: Wed, 12 Jan 2000 16:00:40 -0500 (EST)
CC: PostgreSQL-general <pgsql-general@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Can somebody comment on using EXISTS vs. IN in a subselect? I have
some statements with subselects, and I'd like to understand the
ramifications of choosing EXISTS or IN.
We have some brain-damaged code that is faster with EXISTS than IN.
With IN, the subquery is evaluated and the result put in a temp
relation. Every test for IN sequentially scans the subquery result
looking for a match. EXISTS uses an index on the subquery result. Not
sure why we can't just fix this, but I don't understand enough to know
the reason. People who do understand say there is no good solution
until we redesign the query tree in 7.1.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From bouncefilter Wed Jan 12 17:09:45 2000
Received: from ultra.levelogic.com (ultra.levelogic.com [209.75.61.10])
by hub.org (8.9.3/8.9.3) with ESMTP id RAA06124
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 17:08:42 -0500 (EST)
(envelope-from arthur@levelogic.com)
Received: from levelogic.com (arthur.levelogic.com [209.75.61.100])
by ultra.levelogic.com (8.9.1a/8.9.1) with ESMTP id OAA13845
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 14:08:39 -0800 (PST)
Message-ID: <387CFB3A.E5E1C7A9@levelogic.com>
Date: Wed, 12 Jan 2000 14:07:55 -0800
From: "Arthur M. Kang" <arthur@levelogic.com>
Organization: Levelogic, Inc. - http://www.levelogic.com
X-Mailer: Mozilla 4.7 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: pgsql-general@postgresql.org
Subject: Stumped. Somebody Help me please!
Content-Type: multipart/alternative;
boundary="------------66DE53F4180E81FA5023218F"
--------------66DE53F4180E81FA5023218F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I'm trying to create a table which has two keys, but on of the keys
auto-increments depending on the second key.
key1 | key2
------------
1 | NJ
2 | NJ
1 | CA
2 | CA
3 | CA
4 | CA
Now, with a single insert statement, I would like the next entry to be
(3,'NJ');
Can anyone point me in the right direction or give me any clues?
I would be MOST appreciative. TIA.
Arthur
--------------66DE53F4180E81FA5023218F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I'm trying to create a table which has two keys, but on of the keys auto-increments
depending on the second key.
<p><tt>key1 | key2</tt>
<br><tt>------------</tt>
<br><tt>1 | NJ</tt>
<br><tt>2 | NJ</tt>
<br><tt>1 | CA</tt>
<br><tt>2 | CA</tt>
<br><tt>3 | CA</tt>
<br><tt>4 | CA</tt><tt></tt>
<p>Now, with a single insert statement, I would like the next entry to
be (3,'NJ');
<br>Can anyone point me in the right direction or give me any clues?
<p>I would be MOST appreciative. TIA.
<p>Arthur</html>
--------------66DE53F4180E81FA5023218F--
From bouncefilter Wed Jan 12 17:19:43 2000
Received: from ultra.levelogic.com (ultra.levelogic.com [209.75.61.10])
by hub.org (8.9.3/8.9.3) with ESMTP id RAA20199
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 17:18:56 -0500 (EST)
(envelope-from arthur@levelogic.com)
Received: from levelogic.com (arthur.levelogic.com [209.75.61.100])
by ultra.levelogic.com (8.9.1a/8.9.1) with ESMTP id OAA13971
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 14:18:53 -0800 (PST)
Message-ID: <387CFDA0.920CFE7C@levelogic.com>
Date: Wed, 12 Jan 2000 14:18:08 -0800
From: "Arthur M. Kang" <arthur@levelogic.com>
Organization: Levelogic, Inc. - http://www.levelogic.com
X-Mailer: Mozilla 4.7 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: pgsql-general@postgresql.org
Subject: Help Please!
Content-Type: multipart/alternative;
boundary="------------C6DF963DD0CF0D0DC81EFA03"
--------------C6DF963DD0CF0D0DC81EFA03
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I'm trying to create a table which has two keys, but on of the keys
auto-increments depending on the second key.
key1 | key2
------------
1 | NJ
2 | NJ
1 | CA
2 | CA
3 | CA
4 | CA
Now, with a single insert statement, I would like the next entry to be
(3,'NJ'); the 3 being the next incremented value corresponding with 'NJ.
Can anyone point me in the right direction or give me any clues?
I would be MOST appreciative. TIA.
Arthur
--------------C6DF963DD0CF0D0DC81EFA03
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I'm trying to create a table which has two keys, but on of the keys auto-increments
depending on the second key.
<p><tt>key1 | key2</tt>
<br><tt>------------</tt>
<br><tt>1 | NJ</tt>
<br><tt>2 | NJ</tt>
<br><tt>1 | CA</tt>
<br><tt>2 | CA</tt>
<br><tt>3 | CA</tt>
<br><tt>4 | CA</tt>
<p>Now, with a single insert statement, I would like the next entry to
be (3,'NJ'); the 3 being the next incremented value corresponding with
'NJ.
<br>Can anyone point me in the right direction or give me any clues?
<p>I would be MOST appreciative. TIA.
<p>Arthur</html>
--------------C6DF963DD0CF0D0DC81EFA03--
From bouncefilter Wed Jan 12 18:04:44 2000
Received: from smtp.callnetuk.com ([212.67.128.5])
by hub.org (8.9.3/8.9.3) with ESMTP id SAA37796
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 18:04:24 -0500 (EST)
(envelope-from jscarfe@callnetuk.com)
Received: from callnetuk.com [212.67.129.112] by smtp.callnetuk.com with ESMTP
(SMTPD32-5.05) id A86B4E024A; Wed, 12 Jan 2000 23:04:11 +0000
Message-ID: <387D0873.DDC8F28E@callnetuk.com>
Date: Wed, 12 Jan 2000 23:04:19 +0000
From: Julian Scarfe <jscarfe@callnetuk.com>
X-Mailer: Mozilla 4.04 [en] (WinNT; I)
MIME-Version: 1.0
To: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Subject: Making points into paths
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I'd like to take a set of points and link them into a path. But I can't see a
single operator/function that creates a path from points! ;-(
It seems like a fairly fundamental operation, unlike some of Postgres's
delightfully rich set of geometric datatypes, operators and functions. It
doesn't look too hard to write an external function that appends a point to a
path, but am missing something obvious?
Thanks
Julian Scarfe
From bouncefilter Wed Jan 12 18:16:44 2000
Received: from smtp.callnetuk.com ([212.67.128.5])
by hub.org (8.9.3/8.9.3) with ESMTP id SAA39534
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 18:16:07 -0500 (EST)
(envelope-from jscarfe@callnetuk.com)
Received: from callnetuk.com [212.67.129.112] by smtp.callnetuk.com with ESMTP
(SMTPD32-5.05) id AB33CA0116; Wed, 12 Jan 2000 23:16:03 +0000
Message-ID: <387D0B3B.7D7F3AD8@callnetuk.com>
Date: Wed, 12 Jan 2000 23:16:11 +0000
From: Julian Scarfe <jscarfe@callnetuk.com>
X-Mailer: Mozilla 4.04 [en] (WinNT; I)
MIME-Version: 1.0
To: PostgreSQL-general <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] Simulating an outer join
References: <200001121611.LAA03508@candle.pha.pa.us>
<387CBDF9.F5696981@mascari.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Bruce Momjian wrote:
I have been thinking about how to simulate an outer join. It seems the
best way is to do:SELECT tab1.col1, tab2.col3
FROM tab1, tab2
WHERE tab1.col1 = tab2.col2
UNION ALL
SELECT tab1.col1, NULL
FROM tab1
WHERE tab1.col1 NOT IN (SELECT tab2.col2 FROM tab2)Comments? I know someone was asking about this recently.
Mike Mascari wrote:
I wouldn't use IN ;-)
SELECT table1.key, table2.value
FROM table1, table2
WHERE table1.key = table2.key
UNION ALL
SELECT table1.key, NULL
FROM table1 WHERE NOT EXISTS
(SELECT table2.key FROM table2 WHERE table1.key = table2.key);
FWIW, that's exactly Joe Celko's SQL-89 workaround for OUTER JOINs in 'SQL for
Smarties'. Well in fact he uses (SELECT * FROM table2 WHERE table1.key =
table2.key) as the subquery, but I presume that's an insignificant difference.
Julian Scarfe
From bouncefilter Wed Jan 12 18:23:58 2000
Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236])
by hub.org (8.9.3/8.9.3) with ESMTP id SAA40596
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 18:23:22 -0500 (EST)
(envelope-from peter@localhost.its.uu.se)
Received: from regulus.its.uu.se ([130.238.7.19]:64793 "EHLO
regulus.its.uu.se")
by merganser.its.uu.se with ESMTP id <S239637AbQALXWs>;
Thu, 13 Jan 2000 00:22:48 +0100
Received: from peter (helo=localhost)
by regulus.its.uu.se with local-esmtp (Exim 3.02 #2)
id 128XD4-0001Is-00; Thu, 13 Jan 2000 00:29:50 +0100
Date: Thu, 13 Jan 2000 00:29:50 +0100 (CET)
From: Peter Eisentraut <peter_e@gmx.net>
To: Robert Wagner <rwagner@siac.com>
cc: pgsql-general@postgresql.org, squires@com.net
Subject: Re: [GENERAL] identifying performance hits: how to ???
In-Reply-To: <85256864.00542073.00@SIAC_NOTES_001.wisdom.siac.com>
Message-ID: <Pine.LNX.4.21.0001122348270.1646-100000@localhost.localdomain>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Sender: Peter Eisentraut <peter@hub.org>
FAQ items 3.10 and 4.9 might give you a running start.
On 2000-01-12, Robert Wagner mentioned:
Hello All,
Anyone know if read performance on a postgres database decreases at an
increasing rate, as the number of stored records increase?This is a TCL app, which makes entries into a single, table and from time
to time repopulates a grid control. It must rebuild the data in the grid
control, because other clients have since written to the same table.It seems as if I'm missing something fundamental... maybe I am... is some
kind of database cleanup necessary? With less than ten records, the grid
populates very quickly. Beyond that, performance slows to a crawl, until
it _seems_ that every new record doubles the time needed to retrieve the
records. My quick fix was to cache the data locally in TCL, and only
retrieve changed data from the database. But now as client demand
increases, as well as the number of clients making changes to the table,
I'm reaching the bottleneck again.The client asked me yesterday to start evaluating "more mainstream"
databases, which means that they're pissed off. Postgres is fun to work
with, but it's hard to learn about, and hard to justify to clients.By the way, I have experimented with populating the exact same grid control
on Windows NT, using MS Access (TCL runs just about anywhere). The grid
seemed to populate just about instantaneously. So, is the bottleneck in
Unix, in Postgres, and does anybody know how to make it faster?Cheers,
Rob************
--
Peter Eisentraut Sernanders v�g 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden
From bouncefilter Wed Jan 12 18:35:45 2000
Received: from portal.west.saic.com (portal.west.saic.com [198.151.12.15])
by hub.org (8.9.3/8.9.3) with SMTP id SAA46079
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 18:35:26 -0500 (EST)
(envelope-from officers@aries.tucson.saic.com)
Received: from gatespass.tucson.saic.com by portal.west.saic.com
via smtpd (for postgresql.org [216.126.84.28]) with SMTP;
12 Jan 2000 23:35:25 UT
Received: (from adm@localhost) by gatespass.tucson.saic.com (8.8.2/8.8.2) id
QAA03761 for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 16:35:23 -0700 (MST)
X-Authentication-Warning: gatespass.tucson.saic.com: adm set sender to
<officers@aries.tucson.saic.com> using -f
Received: from wasp.tucson.saic.com(139.121.3.171) by
gatespass.tucson.saic.com via smap (V2.0)
id xma003759; Wed, 12 Jan 00 16:35:08 -0700
Received: from aries.tucson.saic.com (localhost [127.0.0.1]) by
wasp.tucson.saic.com (980427.SGI.8.8.8/950213.SGI.AUTOCF) via
ESMTP id QAA46307 for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 16:35:06 -0700 (MST)
Sender: officers@aries.tucson.saic.com
Message-ID: <387D0FAA.D1202AD5@aries.tucson.saic.com>
Date: Wed, 12 Jan 2000 16:35:06 -0700
From: Sarah Officer <officers@aries.tucson.saic.com>
X-Mailer: Mozilla 4.07C-SGI [en] (X11; I; IRIX 6.5 IP32)
MIME-Version: 1.0
To: pgsql-general@postgresql.org
Subject: triggers & functions
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I'm porting a database from Oracle, and I'm having difficulty
working out the syntax & logic for porting the triggers.
Here's an example of what I have in Oracle:
create table Images (
id varchar(100) PRIMARY KEY,
title varchar(25) NOT NULL,
filepath varchar(256) NOT NULL UNIQUE,
status_code varchar(5) NOT NULL
) ;
create table Istatus (
status_code varchar(5) PRIMARY KEY,
status_desc varchar(100) NOT NULL
);
When I delete a record in Istatus, I want to delete any records in
Images that have the given status code. Okay, this is a rather
crude example, but I think if I can do this, I can do the rest.
In Oracle, I write the trigger something like this:
CREATE TRIGGER istatus_delete_trigger
AFTER DELETE ON Istatus
FOR EACH ROW
BEGIN
delete from Images i
where i.status_code = :old.status_code;
END;
Based on the documents and regression tests in the distribution, it
looks like I need to move the meat of the trigger into a function
for postgres. In postgres I'll call the procedure from the trigger.
Well, after going through the docs & looking at examples, I haven't
figured it out. My inclination is to write:
CREATE FUNCTION remove_status_func()
RETURNS int4 AS '
delete from Images
where Images.status_code = old.status_code ;
select 1 as val;
' LANGUAGE 'sql' ;
I don't want to return anything, but that doesn't seem to be an
option. Is opaque equivalent to no return value? I couldn't find it
in the docs. Postgres gave me a message that opaque types weren't
allowed if the language is sql. Why?
So I have a dummy return value, but now Postgres doesn't seem to
like the reference to 'old'. I see examples of functions which use
'old' in the plpgsql.sql regression set, but those specify a
different language (even though that language looks like sql). I
didn't find the definition of that language after poking around.
Can anyone set me straight here? An example of a trigger which
calls a sql procedure would be much appreciated! I'd like the
function to be able to access the rows which are being removed.
Thanks,
Sarah Officer
officers@aries.tucson.saic.com
From bouncefilter Wed Jan 12 18:49:44 2000
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id SAA49005
for <pgsql-general@postgreSQL.org>;
Wed, 12 Jan 2000 18:49:13 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id
SAA20709;
Wed, 12 Jan 2000 18:45:52 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001122345.SAA20709@candle.pha.pa.us>
Subject: Re: [GENERAL] Simulating an outer join
In-Reply-To: <387D0B3B.7D7F3AD8@callnetuk.com> from Julian Scarfe at "Jan 12,
2000 11:16:11 pm"
To: Julian Scarfe <jscarfe@callnetuk.com>
Date: Wed, 12 Jan 2000 18:45:52 -0500 (EST)
CC: PostgreSQL-general <pgsql-general@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
UNION ALL
SELECT table1.key, NULL
FROM table1 WHERE NOT EXISTS
(SELECT table2.key FROM table2 WHERE table1.key = table2.key);FWIW, that's exactly Joe Celko's SQL-89 workaround for OUTER JOINs in 'SQL for
Smarties'. Well in fact he uses (SELECT * FROM table2 WHERE table1.key =
table2.key) as the subquery, but I presume that's an insignificant difference.
I am just writing the EXISTS section from my book. I don't think it
matters what fields are returned from an EXISTS subquery. If I am
wrong, someone please let me know.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From bouncefilter Thu Jan 13 03:52:54 2000
Received: from hotmail.com (law-f115.hotmail.com [209.185.131.178])
by hub.org (8.9.3/8.9.3) with SMTP id DAA09034
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 03:52:20 -0500 (EST)
(envelope-from oomoomi@hotmail.com)
Received: (qmail 45694 invoked by uid 0); 13 Jan 2000 08:51:49 -0000
Message-ID: <20000113085149.45693.qmail@hotmail.com>
Received: from 195.200.226.110 by www.hotmail.com with HTTP;
Thu, 13 Jan 2000 00:51:49 PST
X-Originating-IP: [195.200.226.110]
From: "omid omoomi" <oomoomi@hotmail.com>
To: peter_e@gmx.net, danderso@crystalsugar.com
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] PSQL Function() help....
Date: Thu, 13 Jan 2000 00:51:49 PST
Mime-Version: 1.0
Content-Type: text/plain; format=flowed
Hello,
Sure you can use arrays as returned results in your function.
regards.
Omid Omoomi
From: Peter Eisentraut <peter_e@gmx.net>
To: Dale Anderson <danderso@crystalsugar.com>
CC: pgsql-general@postgresql.org
Subject: Re: [GENERAL] PSQL Function() help....
Date: Wed, 12 Jan 2000 04:58:53 +0100On 2000-01-12, Dale Anderson mentioned:
Here is what I am trying to do. I an trying to create a function
that is passed two numbers, get_people(2000,1). The first value is a
year, and the second is a week. What I want the function to do, is to
select all the names from a name table, and return a list of names
that don't have an entry in the data table for the year, and week
specified. Can this be done??No. Functions cannot return result sets. Certainly a deficiency, but
nobody is perfect.--
Peter Eisentraut Sernanders v�g 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden************
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
From bouncefilter Wed Jan 12 19:52:50 2000
Received: from Mail.austin.rr.com (sm2.texas.rr.com [24.93.35.55])
by hub.org (8.9.3/8.9.3) with ESMTP id TAA65423
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 19:51:50 -0500 (EST)
(envelope-from eloehr@austin.rr.com)
Received: from austin.rr.com ([24.27.30.243]) by Mail.austin.rr.com with
Microsoft SMTPSVC(5.5.1877.197.19); Wed, 12 Jan 2000 18:42:42 -0600
Sender: ed
Message-ID: <387D21FB.FC5C8BEA@austin.rr.com>
Date: Wed, 12 Jan 2000 18:53:15 -0600
From: Ed Loehr <eloehr@austin.rr.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20smp i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Sarah Officer <officers@aries.tucson.saic.com>
CC: pgsql-general@postgresql.org
Subject: Re: [GENERAL] triggers & functions
References: <387D0FAA.D1202AD5@aries.tucson.saic.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sarah Officer wrote:
Can anyone set me straight here? An example of a trigger which
calls a sql procedure would be much appreciated! I'd like the
function to be able to access the rows which are being removed.
How about examples of a trigger that calls a *PL/pgSQL* procedure that
has access to the rows being removed?
http://www.deja.com/getdoc.xp?AN=570616874
Oh, and I don't understand the opaque business yet, either. But it
seems I must return an opaque type for any function called directly by
a trigger, and that OLD and NEW are only available to that function...
Cheers,
Ed Loehr
From bouncefilter Wed Jan 12 20:01:47 2000
Received: from Mail.austin.rr.com (sm2.texas.rr.com [24.93.35.55])
by hub.org (8.9.3/8.9.3) with ESMTP id UAA68545
for <pgsql-general@postgresql.org>;
Wed, 12 Jan 2000 20:00:48 -0500 (EST)
(envelope-from eloehr@austin.rr.com)
Received: from austin.rr.com ([24.27.30.243]) by Mail.austin.rr.com with
Microsoft SMTPSVC(5.5.1877.197.19); Wed, 12 Jan 2000 18:51:40 -0600
Sender: ed
Message-ID: <387D2415.6D46BECB@austin.rr.com>
Date: Wed, 12 Jan 2000 19:02:13 -0600
From: Ed Loehr <eloehr@austin.rr.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20smp i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Sarah Officer <officers@aries.tucson.saic.com>,
pgsql-general@postgresql.org
Subject: Re: [GENERAL] triggers & functions
References: <387D0FAA.D1202AD5@aries.tucson.saic.com>
<387D21FB.FC5C8BEA@austin.rr.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Oh, and one other thing...
The example has a typo. In the function, 'temp' and 'cust' should be the
same variable (doesn't matter what it's called).
Cheers,
Ed Loehr
Ed Loehr wrote:
Sarah Officer wrote:
Can anyone set me straight here? An example of a trigger which
calls a sql procedure would be much appreciated! I'd like the
function to be able to access the rows which are being removed.How about examples of a trigger that calls a *PL/pgSQL* procedure that
has access to the rows being removed?http://www.deja.com/getdoc.xp?AN=570616874
Oh, and I don't understand the opaque business yet, either. But it
seems I must return an opaque type for any function called directly by
a trigger, and that OLD and NEW are only available to that function...Cheers,
Ed Loehr
From bouncefilter Thu Jan 13 00:59:48 2000
Received: from elwood.cais.com (elwood.cais.com [199.0.216.215])
by hub.org (8.9.3/8.9.3) with ESMTP id AAA71719
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 00:59:11 -0500 (EST)
(envelope-from clark.evans@manhattanproject.com)
Received: from cauchy.clarkevans.com (IDENT:clark@209-9-30-66.sdsl.cais.net
[209.9.30.66]) by elwood.cais.com (8.9.1/Elwood) with ESMTP
id BAA02603; Thu, 13 Jan 2000 01:02:50 -0500 (EST)
Date: Thu, 13 Jan 2000 01:02:23 -0500 (EST)
From: "Clark C. Evans" <clark.evans@manhattanproject.com>
X-Sender: clark@cauchy.clarkevans.com
To: Bruce Bantos <anon@mgfairfax.rr.com>
cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] How do you live without OUTER joins?
In-Reply-To: <028f01bf5c95$0eb15b50$0200a8c0@rsdevelop>
Message-ID: <Pine.LNX.4.10.10001130056520.8597-100000@cauchy.clarkevans.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Tue, 11 Jan 2000, Bruce Bantos wrote:
In my current Oracle DB, I have a number of "lookup" tables
that contain something like this:
You make a "lookup" function, and you call the
function in your select list.
It's been a few months since I've played with
PostgreSQL, so I don't remember the syntax.
An Oraclish example:
CREATE FUNCTION LOOKUP_CATEGORY_LONG_(VARCHAR2 ABBREV)
AS
myVar COMPANY_CATEGORY.COM_CAT_LONG%TYPE;
BEGIN
SELECT COM_CAT_LONG
INTO myVar
FROM COMPANY_CATEGORY
WHERE COM_CAT_ABBR = ABBREV;
RETURN myVar;
END;
SELECT COMPANY_NAME, LOOKUP_CATEGORY_LONG(COM_CAT_ABBR) CATEGORY
FROM COMPANY;
From bouncefilter Thu Jan 13 08:08:57 2000
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id IAA83535
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 08:08:05 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id IAA24808
for pgsql-general@postgreSQL.org; Thu, 13 Jan 2000 08:04:48 -0500 (EST)
Received: from renoir.op.net (root@renoir.op.net [207.29.195.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id DAA12850
for <maillist@candle.pha.pa.us>; Thu, 13 Jan 2000 03:01:00 -0500 (EST)
Received: from firewall.pc-szoftver.mgx.hu (IDENT:root@pc-szoftver.mgx.hu
[194.143.245.130]) by renoir.op.net (o1/$Revision: 1.18 $) with
ESMTP id CAA27956 for <maillist@candle.pha.pa.us>;
Thu, 13 Jan 2000 02:37:48 -0500 (EST)
Received: from ECSABAW2000 (ecsaba.pc-szoftver.mgx.hu [10.255.255.185])
by firewall.pc-szoftver.mgx.hu (8.9.2/8.8.7) with SMTP id IAA02694
for <maillist@candle.pha.pa.us>; Thu, 13 Jan 2000 08:35:23 +0100 (CET)
Message-ID: <000801bf5d99$38c97710$b9ffff0a@ECSABAW2000>
From: "Erdei Csaba" <ecsaba@pc-szoftver.mgx.hu>
To: <maillist@candle.pha.pa.us>
Subject: Erdei Csaba : Help me
Date: Thu, 13 Jan 2000 08:38:43 +0100
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0005_01BF5DA1.99A10E10"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.5600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.5600
Sender: pgman@candle.pha.pa.us
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01BF5DA1.99A10E10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Dear Developers,
How can I make referential integrity constraints ? In which version of =
postgresql can I the FOREIGN KEY and the REFERENCES syntax ?
In which version is it functioning (I mean really implemented) properly, =
or in which version will be implemented ?
Please answer me,
Best Regards,
Erdei Csaba=20
------=_NextPart_000_0005_01BF5DA1.99A10E10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2919.3800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Developers,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>How can I make referential integrity =
constraints ?=20
In which version of postgresql can I the FOREIGN KEY and the =
REFERENCES=20
syntax ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>In which version is it functioning (I =
mean really=20
implemented) properly, or in which version will be implemented=20
?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Please answer me,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Best Regards,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Erdei =
Csaba</FONT> </DIV></BODY></HTML>
------=_NextPart_000_0005_01BF5DA1.99A10E10--
From bouncefilter Thu Jan 13 03:38:54 2000
Received: from smtp.callnetuk.com ([212.67.128.5])
by hub.org (8.9.3/8.9.3) with ESMTP id DAA07765
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 03:38:45 -0500 (EST)
(envelope-from jscarfe@callnetuk.com)
Received: from callnetuk.com [212.67.132.165] by smtp.callnetuk.com with ESMTP
(SMTPD32-5.05) id AECB6B30144; Thu, 13 Jan 2000 08:37:31 +0000
Message-ID: <387D8ED4.70E123E4@callnetuk.com>
Date: Thu, 13 Jan 2000 08:37:40 +0000
From: Julian Scarfe <jscarfe@callnetuk.com>
X-Mailer: Mozilla 4.04 [en] (WinNT; I)
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us>
CC: PostgreSQL-general <pgsql-general@postgreSQL.org>
Subject: Re: [GENERAL] Simulating an outer join
References: <200001122345.SAA20709@candle.pha.pa.us>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Bruce Momjian wrote:
I am just writing the EXISTS section from my book. I don't think it
matters what fields are returned from an EXISTS subquery. If I am
wrong, someone please let me know.
Celko also writes (in his chapter on EXISTS in "SQL for Smarties"):
"In general the SELECT * option should perform better than the actual column.
It lets the query optimizer decide which column to use. If a column has an
index on it, then simply seeing a pointer to the index is enough to determine
that something exists."
Obviously you're in a much better position than me to judge whether that's the
case in pgsql! But it might be worth a test.
Julian Scarfe
From bouncefilter Thu Jan 13 04:04:55 2000
Received: from w3.unica.edu (unica.edu [194.133.59.58] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id EAA13581
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 04:04:37 -0500 (EST) (envelope-from gabi@unica.edu)
Received: from alpha.fert.es (alpha.unica.edu [172.20.1.1])
by w3.unica.edu (8.9.3/8.9.3) with SMTP id JAA07230
for <pgsql-general@postgreSQL.org>; Thu, 13 Jan 2000 09:26:41 GMT
Received: from unica.edu ([172.20.2.2]) by alpha.fert.es (4.1/1.11) Thu,
13 Jan 00 10:04:19 GMT
Message-Id: <387D94F8.9CB6F223@unica.edu>
Date: Thu, 13 Jan 2000 10:03:52 +0100
From: Gabriel Fernandez <gabi@unica.edu>
X-Mailer: Mozilla 4.7 [en-gb] (Win98; I)
X-Accept-Language: en
Mime-Version: 1.0
To: PostgreSQL-general <pgsql-general@postgreSQL.org>
Subject: Confussion with table-lock levels and isolation levels
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi fellows !
I would only want to ask some questions concerning table-locking levels
and isolation levels:
* First of all: should I assume that AccessXXXXXXX modes imply locking
the complete table and RowXXXX imply locking only the rows which have
been accessed ? Will then the conflicts be solved according the
hierarchy between modes ?
* Second:
- What does exactly mean that a mode 'CONFLICTS' with another
?
- Does it mean that another concurrent transactions having
these modes will have to wait until the first transaction
have finished (commit or roll back) ?
- Can we determine (when accessing a row in a table) wether we
will have a conflict or not according to the criteria
explained in the previous question (Access-> complete table,
Row -> rows accessed) ?
*Third:
If all the previous assumptions are true:
- When there is a conflict, will the only consequence be
that all concurrent transactions will be processed in a
FIFO serie and not in parallel ?
- What about all the others concurrent transactions which
haven't conflicted ? How can you avoid falling into
contradiction with the isolation level (and assure the
protection against non-repeteable reads or phantom
reads ?
- I feel those two levels (transactions and isolation
levels) are two layers so the transactions will be
processed according to a FIFO serie when exist any
problem concerning the isolation level or the
table-locking. Is this a good way to describe the way
PostgreSQL manages the things ?
Thank you very much for your help. By the way, is the first time i'm
subscribed to a mailing list so if I do anything inappropiate or strange
please tell me.
Best regards
Gabi :-)
From bouncefilter Thu Jan 13 04:11:54 2000
Received: from sapphire.albourne.com (root@sapphire.albourne.com
[195.212.241.227]) by hub.org (8.9.3/8.9.3) with ESMTP id EAA14361
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 04:11:43 -0500 (EST)
(envelope-from alessio@albourne.com)
Received: from albourne.com (akamas.albourne.com [195.212.241.254])
by sapphire.albourne.com (8.9.3/8.9.3/Albourne/CYS/1.8/MAPS) with ESMTP
id LAA21909; Thu, 13 Jan 2000 11:11:35 +0200 (EET)
Sender: alessio@albourne.com
Message-ID: <387D96C6.2DD34505@albourne.com>
Date: Thu, 13 Jan 2000 11:11:34 +0200
From: Alessio Bragadini <alessio@albourne.com>
Organization: APL Financial Services (Overseas) Ltd.
X-Mailer: Mozilla 4.7 [en] (X11; I; OSF1 V4.0 alpha)
X-Accept-Language: it, en, sv
MIME-Version: 1.0
To: Sarah Officer <officers@aries.tucson.saic.com>
CC: Bruce Bantos <anon@mgfairfax.rr.com>, pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] How do you live without OUTER joins?
References: <Pine.BSF.4.10.10001112242530.60807-100000@server.b0x.com>
<02e901bf5cb1$3c9a5fa0$0200a8c0@rsdevelop>
<387C9EEE.401AEFA1@aries.tucson.saic.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sarah Officer wrote:
How about using a union?
select cc.com_cat_long, co.company_name
from company_category cc, company co
where cc.com_cat_abbr = co.com_cat_abbr
union
select 'unknown' as com_cat_long, company_name
from company
where com_cat_abbr is null;
Yes, would be the best way to go. Unfortunately I need one of this outer
joins in a VIEW, and seems to me that a VIEW cannot be created with a
UNION.
Therefore, for one of our projects we had to setup an intermediate table
kept consistent using a number of triggers. Having outer joins or UNION
in VIEWs would definitively be a much better way!
--
Alessio F. Bragadini alessio@albourne.com
APL Financial Services http://www.sevenseas.org/~alessio
Nicosia, Cyprus phone: +357-2-750652
"It is more complicated than you think"
-- The Eighth Networking Truth from RFC 1925
From bouncefilter Thu Jan 13 06:04:11 2000
Received: from cs.huji.ac.il (cs.huji.ac.il [132.65.16.10])
by hub.org (8.9.3/8.9.3) with ESMTP id GAA56517
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 06:03:57 -0500 (EST)
(envelope-from chana@cs.huji.ac.il)
Received: from shuldig.cs.huji.ac.il ([132.65.16.8] ident=exim)
by cs.huji.ac.il with esmtp (Exim 3.10 #1) id 128i2l-00027t-00
for pgsql-general@postgresql.org; Thu, 13 Jan 2000 13:03:55 +0200
Received: from chana by shuldig.cs.huji.ac.il with local (Exim 3.03 #1)
id 128i2l-0004xo-00
for pgsql-general@postgreSQL.org; Thu, 13 Jan 2000 13:03:55 +0200
To: pgsql-general@postgresql.org
Message-Id: <E128i2l-0004xo-00@shuldig.cs.huji.ac.il>
From: Chana Slutzkin <chana@cs.huji.ac.il>
Date: Thu, 13 Jan 2000 13:03:55 +0200
subscribe
end
From bouncefilter Thu Jan 13 11:06:55 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id LAA33097
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 11:05:58 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id 5A0E11FE8; Thu, 13 Jan 2000 11:04:54 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1])
by pcr.ca (Postfix) with ESMTP id 48D371F8C
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 11:04:49 +0000 (GMT)
Date: Thu, 13 Jan 2000 11:04:49 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: pgsql-general@postgresql.org
Subject: oid data type
Message-ID: <Pine.BSF.4.10.10001131104240.70595-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Where can I find more information about the oid data type? I've looked
at the User's Guide, Chapter 3. Data Types, but it didn't seem to be
there. I've also looked around in the Programmer's Guide but, seeing I'm
still learning the ropes, I'm not really sure where I should be looking.
Once again, I'd appreciate if someone could point me in the right
direction,
Marc
From bouncefilter Thu Jan 13 06:22:57 2000
Received: from cs.huji.ac.il (cs.huji.ac.il [132.65.16.10])
by hub.org (8.9.3/8.9.3) with ESMTP id GAA58905
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 06:22:01 -0500 (EST)
(envelope-from chana@cs.huji.ac.il)
Received: from shuldig.cs.huji.ac.il ([132.65.16.8] ident=exim)
by cs.huji.ac.il with esmtp (Exim 3.10 #1) id 128iKE-0002Mo-00
for pgsql-general@postgresql.org; Thu, 13 Jan 2000 13:21:58 +0200
Received: from chana by shuldig.cs.huji.ac.il with local (Exim 3.03 #1)
id 128iKE-0005DI-00
for pgsql-general@postgreSQL.org; Thu, 13 Jan 2000 13:21:58 +0200
To: pgsql-general@postgresql.org
Message-Id: <E128iKE-0005DI-00@shuldig.cs.huji.ac.il>
From: Chana Slutzkin <chana@cs.huji.ac.il>
Date: Thu, 13 Jan 2000 13:21:58 +0200
unsubscribe
end
From bouncefilter Thu Jan 13 08:22:54 2000
Received: from candle.pha.pa.us (root@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id IAA86231
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 08:22:09 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id
IAA24854;
Thu, 13 Jan 2000 08:06:38 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001131306.IAA24854@candle.pha.pa.us>
Subject: Re: [GENERAL] Simulating an outer join
In-Reply-To: <387D8ED4.70E123E4@callnetuk.com> from Julian Scarfe at "Jan 13,
2000 08:37:40 am"
To: Julian Scarfe <jscarfe@callnetuk.com>
Date: Thu, 13 Jan 2000 08:06:37 -0500 (EST)
CC: PostgreSQL-general <pgsql-general@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Bruce Momjian wrote:
I am just writing the EXISTS section from my book. I don't think it
matters what fields are returned from an EXISTS subquery. If I am
wrong, someone please let me know.Celko also writes (in his chapter on EXISTS in "SQL for Smarties"):
"In general the SELECT * option should perform better than the actual column.
It lets the query optimizer decide which column to use. If a column has an
index on it, then simply seeing a pointer to the index is enough to determine
that something exists."Obviously you're in a much better position than me to judge whether that's the
case in pgsql! But it might be worth a test.
In psql, I think * would generate all the columns, then throw it away,
while a specific column would only carry around that column in the
subquery result. so a single column is better.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From bouncefilter Thu Jan 13 13:40:57 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id NAA75343
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 13:39:59 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id B3ADA1FE8; Thu, 13 Jan 2000 13:38:50 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1])
by pcr.ca (Postfix) with ESMTP id AC6BD1F8C
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 13:38:45 +0000 (GMT)
Date: Thu, 13 Jan 2000 13:38:45 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: pgsql-general@postgresql.org
Subject: searching oid's
Message-ID: <Pine.BSF.4.10.10001131327050.70888-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
I've been contemplating the idea of replacing my current char(32)
identification numbers with oid's. Apart from the significant space
gained, I was hoping there would also be a speed gain or some other
incentives.
First, I tried searching tables by their oid, but explain returned
sequential scans. Second, I tried specifing the oid as the primary key in
a table, but the oid column wasn't found. Finally, I created an index for
oid which worked fine. In the end, I feel I'm back to square one having to
use the same index as with my char(32) id's. It seems my only gain would
be 28 bytes per row and no speed gain, apart perhaps for building the
index which should be a bit slower for a char(32) datatype rather than an
integer.
If there's something I'm missing, I'd appreciate if someone could share
their tips and tricks to using oid's more efficiently.
Thanks,
Marc
From bouncefilter Thu Jan 13 08:57:54 2000
Received: from mail.piter-press.ru (mail.piter-press.ru [195.239.142.35])
by hub.org (8.9.3/8.9.3) with ESMTP id IAA96847
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 08:57:10 -0500 (EST)
(envelope-from alexey@byte-unix.piter-press.ru)
Received: from byte-unix.piter-press.ru ([195.239.142.37]) by
mail.piter-press.ru with SMTP (Microsoft Exchange Internet Mail
Service Version 5.5.2650.21)
id CG8MZX7X; Thu, 13 Jan 2000 16:53:53 +0300
Received: from alexey by byte-unix.piter-press.ru with local (Exim 3.11 #1
(Debian)) id 128kjx-0001Vx-00
for <pgsql-general@postgreSQL.org>; Thu, 13 Jan 2000 16:56:41 +0300
Date: Thu, 13 Jan 2000 16:56:41 +0300
From: Alexey Vyskubov <alexey@byte-unix.piter-press.ru>
To: pgsql-general@postgresql.org
Subject: PostgreSQL external functions under OpenBSD
Message-ID: <20000113165641.A5810@byte-unix.piter-press.ru>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.0i
Organization: BYTE/Russia magazine
Hello.
I was trying to compile external function for PostgreSQL under OpenBSD 2.6 and
failed.
I did:
gcc -fpic -c -o test.o test.c
ld -Nshareable -o test.so test.o
Then I created postgres function from test.so module. But it doesn't work
showing:
ERROR: init_fcache: Cache lookup failed for procedure 139520
Could somebody point me where I did something wrong?
P.S. I used following code
DROP FUNCTION test();
CREATE FUNCTION test() RETURNS int4
AS '/usr/local/pgsql/lib/test.so' LANGUAGE 'c';
--
Alexey
From bouncefilter Thu Jan 13 14:23:57 2000
Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged))
by hub.org (8.9.3/8.9.3) with ESMTP id OAA85806
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 14:23:33 -0500 (EST)
(envelope-from admin@wtbwts.com)
Received: by pcr.ca (Postfix, from userid 1000)
id 350451FE8; Thu, 13 Jan 2000 14:22:34 +0000 (GMT)
Received: from localhost (localhost [127.0.0.1]) by pcr.ca (Postfix) with
ESMTP
id 1E4AB1F8C; Thu, 13 Jan 2000 14:22:34 +0000 (GMT)
Date: Thu, 13 Jan 2000 14:22:34 +0000 (GMT)
From: admin <admin@wtbwts.com>
X-Sender: admin@server.b0x.com
To: Adriaan Joubert <a.joubert@albourne.com>
Cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] searching oid's
In-Reply-To: <387E2319.2A11D310@albourne.com>
Message-ID: <Pine.BSF.4.10.10001131420450.71001-100000@server.b0x.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Actually, I think pg_dump with the -o flag keeps oid's, therefore allowing
me to keep referential integrity after backup.
First, I tried searching tables by their oid, but explain returned
sequential scans. Second, I tried specifing the oid as the primary key in
a table, but the oid column wasn't found. Finally, I created an index for
oid which worked fine. In the end, I feel I'm back to square one having to
use the same index as with my char(32) id's. It seems my only gain would
be 28 bytes per row and no speed gain, apart perhaps for building the
index which should be a bit slower for a char(32) datatype rather than an
integer.Using oid's is not a good idea, as they don't automatically get dumped with
pg_dump. And once your referential integrity gets screwed up and you are
using oid's you are really in a mess, as you cannot change oids. Use a serial
field to generate a key for every row, which generates you a sequence of
integers. It is much better than oids at a cost of 4 bytes.As far as i have understood you need an index if you want to avoid a
sequential scan as tuples are not stored in a hierarchy in the table. Only in
indexes do you get b-trees etc. So define your serial field as a primary key
and you are done. And comparing 4-byte ints is much faster than comparing
32-byte text fields, that's for sure.Adriaan
From bouncefilter Thu Jan 13 10:11:55 2000
Received: from falla.videotron.net (falla.videotron.net [205.151.222.106])
by hub.org (8.9.3/8.9.3) with ESMTP id KAA15160
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 10:11:51 -0500 (EST)
(envelope-from web@inter-resa.com)
Received: from inter-resa.com ([24.200.100.43])
by falla.videotron.net (Sun Internet Mail Server
sims.3.5.1999.12.14.10.29.p8)
with ESMTP id <0FOA0003U4UWAI@falla.videotron.net> for
pgsql-general@postgresql.org; Thu, 13 Jan 2000 10:11:20 -0500 (EST)
Date: Thu, 13 Jan 2000 10:09:35 -0500
From: Web Manager <web@inter-resa.com>
Subject: Default date format to ISO + 1 bug
Sender: www@falla.videotron.net
To: pgsql-general@postgresql.org
Message-id: <387DEAAF.87986711@inter-resa.com>
Organization: The INTER-Res@ tourism network
MIME-version: 1.0
X-Mailer: Mozilla 4.51 [en] (X11; I; FreeBSD 3.1-RELEASE i386)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
X-Accept-Language: en
Hello,
since I am a simple Postgres user, I don't understand the instruction to
change the postgresql default date format from 01-13-2000 to 2000-01-13
The timestamp format is OK with : 2000-01-13 09:11:24-05 but
Date gives : month-day-year
For Postgres v6.5 (and earlier) the default date/time style is
"non-European traditional Postgres" (I guess that means that timestamp
does not follow this default format). How do I change this?
And then... I have a second broblem:
I have postgres version 6.4.2
I created a new testing db.
createdb test
create table toto (num int2, name varchar(16), date_insc date);
When I : insert into toto values (1,'mapaquin',date('now'));
it give me : 1|mapaquin|12-31-1999
BUT IT IS JAN 13th !!!!!!
(yes, my PC has the rigth date!)
When I create a new table:
insert into toto2 (num int2, name varchar(16), date_insc timestamp
default now());
I make an insert: insert into toto values (1,'mapaquin');
it gives me: 1|mapaquin|2000-01-13 09:11:24-05
and now, it's OK!!!!
What is wrong?
Thank's!
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marc Andre Paquin
From bouncefilter Thu Jan 13 10:40:55 2000
Received: from mailbox.reptiles.org (IDENT:root@mailbox.reptiles.org
[198.96.117.155]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA25263
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 10:40:24 -0500 (EST)
(envelope-from jim@reptiles.org)
Received: from localhost (1612 bytes) by mailbox.reptiles.org
via sendmail with P:stdio/R:bind_hosts/T:inet_zone_bind_smtp
(sender: <jim>) (ident <jim> using unix)
id <m128mLo-000814C@mailbox.reptiles.org>
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 10:39:52 -0500 (EST)
(Smail-3.2.0.108 1999-Sep-19 #3 built 1999-Oct-27)
Date: Thu, 13 Jan 2000 10:39:52 -0500
From: Jim Mercer <jim@reptiles.org>
To: Web Manager <web@inter-resa.com>
Cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Default date format to ISO + 1 bug
Message-ID: <20000113103952.B4188@reptiles.org>
References: <387DEAAF.87986711@inter-resa.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0i
In-Reply-To: <387DEAAF.87986711@inter-resa.com>;
from web@inter-resa.com on Thu, Jan 13, 2000 at 10:09:35AM -0500
On Thu, Jan 13, 2000 at 10:09:35AM -0500, Web Manager wrote:
since I am a simple Postgres user, I don't understand the instruction to
change the postgresql default date format from 01-13-2000 to 2000-01-13The timestamp format is OK with : 2000-01-13 09:11:24-05 but
Date gives : month-day-yearFor Postgres v6.5 (and earlier) the default date/time style is
"non-European traditional Postgres" (I guess that means that timestamp
does not follow this default format). How do I change this?
you can use the set command to change the datestyle:
SET DATESTYLE TO 'ISO'|'SQL'|'Postgres'|'European'|'US'|'NonEuropean'
i set mine to 'ISO' which is 'yyyy-mm-dd hh:mm:ss-tz'
to make it permanent, you can set the environment variable PGDATESTYLE
in your startup script.
--
[ Jim Mercer jim@reptiles.org +1 416 506-0654 ]
[ Reptilian Research -- Longer Life through Colder Blood ]
[ Don't be fooled by cheap Finnish imitations; BSD is the One True Code. ]
From bouncefilter Thu Jan 13 10:58:55 2000
Received: from henry.newn.cam.ac.uk (henry.newn.cam.ac.uk [131.111.204.130])
by hub.org (8.9.3/8.9.3) with ESMTP id KAA28385
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 10:58:11 -0500 (EST)
(envelope-from prlw1@newn.cam.ac.uk)
Received: from [131.111.204.180] (helo=quartz.newn.cam.ac.uk)
by henry.newn.cam.ac.uk with esmtp (Exim 2.12 #1)
id 128mda-0005W5-00; Thu, 13 Jan 2000 15:58:14 +0000
Received: from prlw1 by quartz.newn.cam.ac.uk with local (Exim 2.12 #1)
id 128mdR-0004dL-00; Thu, 13 Jan 2000 15:58:05 +0000
Date: Thu, 13 Jan 2000 15:58:05 +0000
From: Patrick Welche <prlw1@newn.cam.ac.uk>
To: Web Manager <web@inter-resa.com>
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Default date format to ISO + 1 bug
Message-ID: <20000113155805.J12705@quartz.newn.cam.ac.uk>
References: <387DEAAF.87986711@inter-resa.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.1.1i
In-Reply-To: <387DEAAF.87986711@inter-resa.com>;
from web@inter-resa.com on Thu, Jan 13, 2000 at 10:09:35AM -0500
On Thu, Jan 13, 2000 at 10:09:35AM -0500, Web Manager wrote:
Hello,
since I am a simple Postgres user, I don't understand the instruction to
change the postgresql default date format from 01-13-2000 to 2000-01-13
Either set the environment variable 'PGDATESTYLE', eg for csh
setenv PGDATESTYLE European
or in your connection to the database
SET DateStyle TO 'European';
And then... I have a second broblem:
... 'now' broken, now() working
What is wrong?
I think this one was mentioned a few days ago, so it's a "known problem"?
Cheers,
Patrick
From bouncefilter Thu Jan 13 12:14:10 2000
Received: from datmail03.dat.com ([209.241.199.3])
by hub.org (8.9.3/8.9.3) with ESMTP id MAA49556
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 12:12:20 -0500 (EST)
(envelope-from philip.culberson@dat.com)
Received: by datmail03.dat.com with Internet Mail Service (5.5.2448.0)
id <XF5BZMNG>; Thu, 13 Jan 2000 09:11:47 -0800
Message-ID: <A95EFC3B707BD311986C00A0C9E95B6A04B3ED@datmail03.dat.com>
From: "Culberson, Philip" <philip.culberson@dat.com>
To: "'Bruce Momjian'" <pgman@candle.pha.pa.us>, Julian Scarfe
<jscarfe@callnetuk.com>
Cc: PostgreSQL-general <pgsql-general@postgreSQL.org>
Subject: RE: [GENERAL] Simulating an outer join
Date: Thu, 13 Jan 2000 09:11:39 -0800
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Content-Type: text/plain;
charset="iso-8859-1"
How about no column at all? I see Oracle do a lot of these. Maybe for
referential integrity checks?
test1=> select 'WORKS!' as "Result" from geo
test1-> where EXISTS (select null from geo where city = 'Portland' and state
= 'OR');
Result
------
WORKS!
(1 row)
-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: Thursday, January 13, 2000 5:07 AM
To: Julian Scarfe
Cc: PostgreSQL-general
Subject: Re: [GENERAL] Simulating an outer join
Bruce Momjian wrote:
I am just writing the EXISTS section from my book. I don't think it
matters what fields are returned from an EXISTS subquery. If I am
wrong, someone please let me know.Celko also writes (in his chapter on EXISTS in "SQL for Smarties"):
"In general the SELECT * option should perform better than the actual
column.
It lets the query optimizer decide which column to use. If a column has
an
index on it, then simply seeing a pointer to the index is enough to
determine
that something exists."
Obviously you're in a much better position than me to judge whether that's
the
case in pgsql! But it might be worth a test.
In psql, I think * would generate all the columns, then throw it away,
while a specific column would only carry around that column in the
subquery result. so a single column is better.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
************
From bouncefilter Thu Jan 13 12:22:56 2000
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id MAA51064
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 12:22:42 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id
MAA02391;
Thu, 13 Jan 2000 12:18:46 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001131718.MAA02391@candle.pha.pa.us>
Subject: Re: [GENERAL] oid data typeu
In-Reply-To: <Pine.BSF.4.10.10001131104240.70595-100000@server.b0x.com> from
admin at "Jan 13, 2000 11:04:49 am"
To: admin <admin@wtbwts.com>
Date: Thu, 13 Jan 2000 12:18:46 -0500 (EST)
CC: pgsql-general@postgreSQL.org
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Where can I find more information about the oid data type? I've looked
at the User's Guide, Chapter 3. Data Types, but it didn't seem to be
there. I've also looked around in the Programmer's Guide but, seeing I'm
still learning the ropes, I'm not really sure where I should be looking.
Chapter 7 in my book has this. We web site under documentation.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From bouncefilter Thu Jan 13 12:25:56 2000
Received: from mail.austin.rr.com (sm1.texas.rr.com [24.93.35.54])
by hub.org (8.9.3/8.9.3) with ESMTP id MAA51536
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 12:25:54 -0500 (EST)
(envelope-from eloehr@austin.rr.com)
Received: from austin.rr.com ([24.27.30.243]) by mail.austin.rr.com with
Microsoft SMTPSVC(5.5.1877.197.19); Thu, 13 Jan 2000 11:25:55 -0600
Sender: ed
Message-ID: <387E0ADA.CB863926@austin.rr.com>
Date: Thu, 13 Jan 2000 11:26:50 -0600
From: Ed Loehr <eloehr@austin.rr.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20smp i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Sarah Officer <officers@aries.tucson.saic.com>,
pgsql-general@postgresql.org
Subject: Re: [GENERAL] triggers & functions
References: <387D0FAA.D1202AD5@aries.tucson.saic.com>
<387D21FB.FC5C8BEA@austin.rr.com> <387D2415.6D46BECB@austin.rr.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Did this help? If not, what was missing? [I'm giving this advice
repeatedly, but not sure it's helping...]
Cheers,
Ed Loehr
Ed Loehr wrote:
Oh, and one other thing...
The example has a typo. In the function, 'temp' and 'cust' should be the
same variable (doesn't matter what it's called).Cheers,
Ed LoehrEd Loehr wrote:
Sarah Officer wrote:
Can anyone set me straight here? An example of a trigger which
calls a sql procedure would be much appreciated! I'd like the
function to be able to access the rows which are being removed.How about examples of a trigger that calls a *PL/pgSQL* procedure that
has access to the rows being removed?http://www.deja.com/getdoc.xp?AN=570616874
Oh, and I don't understand the opaque business yet, either. But it
seems I must return an opaque type for any function called directly by
a trigger, and that OLD and NEW are only available to that function...Cheers,
Ed Loehr************
From bouncefilter Thu Jan 13 12:37:56 2000
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id MAA57025
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 12:37:28 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id
MAA03229;
Thu, 13 Jan 2000 12:33:39 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001131733.MAA03229@candle.pha.pa.us>
Subject: Re: [GENERAL] oid data typeu
In-Reply-To: <200001131718.MAA02391@candle.pha.pa.us> from Bruce Momjian at
"Jan 13, 2000 12:18:46 pm"
To: Bruce Momjian <pgman@candle.pha.pa.us>
Date: Thu, 13 Jan 2000 12:33:39 -0500 (EST)
CC: admin <admin@wtbwts.com>, pgsql-general@postgreSQL.org
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Where can I find more information about the oid data type? I've looked
at the User's Guide, Chapter 3. Data Types, but it didn't seem to be
there. I've also looked around in the Programmer's Guide but, seeing I'm
still learning the ropes, I'm not really sure where I should be looking.Chapter 7 in my book has this. We web site under documentation.
Sorry for my poor typing. I have a section on it in my book, chapter 7,
Uniquely Numbering Rows. The book is accessible from the postgresql
main web site under Documentation.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From bouncefilter Thu Jan 13 12:58:56 2000
Received: from qube.dsdeurne.nl (58.17.dialup.globalxs.nl [213.196.17.58] (may
be forged)) by hub.org (8.9.3/8.9.3) with ESMTP id MAA60889
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 12:58:12 -0500 (EST)
(envelope-from w.aarts@dsdeurne.nl)
Received: from dsdeurne.nl (qube.dsdeurne.nl [10.254.211.253])
by qube.dsdeurne.nl (8.9.2/8.9.2) with SMTP id SAA07142
for pgsql-general@postgreSQL.org; Thu, 13 Jan 2000 18:54:40 +0100 (CET)
Date: Thu, 13 Jan 2000 18:54:40 +0100 (CET)
Message-Id: <200001131754.SAA07142@qube.dsdeurne.nl>
To: pgsql-general@postgreSQL.org
Subject: Database synchronisation over the internet...
From: Wim Aarts <w.aarts@dsdeurne.nl>
X-Mailer: TWIG 2.1.0
Reply-To: w.aarts@dsdeurne.nl
Hi All,
Availabilty is going to play an important role in some postgreSQL applications
we've build, (mission critical for those who wants to know).
Up until now everything has been straight forward SQL. And for backups we rely
on dumps and tapes. In the near future we would like to have a system that
enables synchronisation of data over the internet.
The requirements are:
security of data... (SSL ? in Europe)
master slave concept where the data on the slave is only changed by the master
and is allowed to be 10 minutes behind.
What might we a good strategy for implementing such a system?
--
Wim Aarts
From bouncefilter Thu Jan 13 12:56:56 2000
Received: from scaup.prod.itd.earthlink.net (scaup.prod.itd.earthlink.net
[207.217.121.49]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA60633
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 12:56:38 -0500 (EST)
(envelope-from aardvark@ibm.net)
Received: from fries (1Cust60.tnt2.altoona.pa.da.uu.net [63.24.4.60])
by scaup.prod.itd.earthlink.net (8.9.3/8.9.3) with SMTP id JAA06511;
Thu, 13 Jan 2000 09:56:35 -0800 (PST)
From: "Barnes" <aardvark@ibm.net>
To: "'admin'" <admin@wtbwts.com>, <pgsql-general@postgreSQL.org>
Subject: RE: [GENERAL] oid data type
Date: Thu, 13 Jan 2000 12:58:58 -0500
Message-ID: <002a01bf5def$de3fe700$0a64a8c0@fries>
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
In-Reply-To: <Pine.BSF.4.10.10001131104240.70595-100000@server.b0x.com>
Chapter 7 of Bruce's book has a nice discussion of oid.
ftp://postgresql.org/pub/doc/aw_pgsql_book.pdf
Barnes
-----Original Message-----
From: owner-pgsql-general@postgreSQL.org
[mailto:owner-pgsql-general@postgreSQL.org]On Behalf Of admin
Sent: Thursday, January 13, 2000 6:05 AM
To: pgsql-general@postgreSQL.org
Subject: [GENERAL] oid data type
Where can I find more information about the oid data type? I've looked
at the User's Guide, Chapter 3. Data Types, but it didn't seem to be
there. I've also looked around in the Programmer's Guide but, seeing I'm
still learning the ropes, I'm not really sure where I should be looking.
Once again, I'd appreciate if someone could point me in the right
direction,
Marc
************
From bouncefilter Thu Jan 13 13:27:57 2000
Received: from mailb.telia.com (root@mailb.telia.com [194.22.194.6])
by hub.org (8.9.3/8.9.3) with ESMTP id NAA69924
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 13:27:15 -0500 (EST)
(envelope-from girgen@partitur.se)
Received: from d1o90.telia.com (d1o90.telia.com [195.67.216.241])
by mailb.telia.com (8.9.3/8.9.3) with ESMTP id TAA00404;
Thu, 13 Jan 2000 19:26:47 +0100 (CET)
Received: from stordatan.telia.com (t4o90p76.telia.com [195.67.217.196])
by d1o90.telia.com (8.8.8/8.8.8) with ESMTP id TAA15695;
Thu, 13 Jan 2000 19:26:39 +0100 (CET)
Received: from partitur.se (localhost [127.0.0.1])
by stordatan.telia.com (8.9.3/8.9.1) with ESMTP id TAA00778;
Thu, 13 Jan 2000 19:26:09 +0100 (CET)
(envelope-from girgen@partitur.se)
Sender: girgen@partitur.se
Message-ID: <387E18C1.B87266B3@partitur.se>
Date: Thu, 13 Jan 2000 19:26:09 +0100
From: Palle Girgensohn <girgen@partitur.se>
Organization: Partitur
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.0.36 i386)
X-Accept-Language: sv, en
MIME-Version: 1.0
To: Web Manager <web@inter-resa.com>
CC: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Default date format to ISO + 1 bug
References: <387DEAAF.87986711@inter-resa.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Web Manager wrote:
And then... I have a second broblem:
I have postgres version 6.4.2I created a new testing db.
createdb test
create table toto (num int2, name varchar(16), date_insc date);When I : insert into toto values (1,'mapaquin',date('now'));
it give me : 1|mapaquin|12-31-1999BUT IT IS JAN 13th !!!!!!
Here's with 6.5.2:
girgen=> select date('now');
date
----------
2000-01-01 <----- not quite right ;-)
(1 row)
girgen=> select 'now'::date;
?column?
----------
2000-01-13
(1 row)
girgen=> select date('now'::date);
date
----------
2000-01-13
(1 row)
girgen=> select date('1999-04-01 15:38:15'::date);
date
----------
1999-04-01
(1 row)
It seems, the date() function can't take a string, it needs a date/time type of some sort? This is the cleanest way, probably:
insert into toto values (1,'mapaquin','now');
You can also use 'now'::date with date(), like date('now'::date)...
date() is probably broken in a way; it gives 2000-01-01 for anything it doesn't understand:
pp=> select date(1072842322);
date
----------
2003-12-31
(1 row)
pp=> select date(10728423224); <----- too large number
date
----------
2000-01-01
(1 row)
Maybe this is better than failing, I'm not sure...
PS. I have the line
PGDATESTYLE=ISO; export PGDATESTYLE
in my ~pgsql/.profile, which gives ISO dates, as previously pointed out. You also probably want to set LC_COLLATE or LC_ALL to your proper locale for sorting etc.
/Palle
From bouncefilter Thu Jan 13 06:02:10 2000
Received: from probity.mcc.ac.uk (probity.mcc.ac.uk [130.88.200.94])
by hub.org (8.9.3/8.9.3) with ESMTP id GAA56228
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 06:01:33 -0500 (EST)
(envelope-from crispin@cs.man.ac.uk)
Received: from pm1-48.mcc.ac.uk ([194.66.22.48] helo=spud)
by probity.mcc.ac.uk with smtp (Exim 1.92 #3)
for pgsql-general@postgreSQL.org
id 128i0P-0000p4-00; Thu, 13 Jan 2000 11:01:31 +0000
Message-ID: <00e301bf5dfa$2031b940$6feb5882@spud.sbc.man.ac.uk>
From: "Crispin Miller" <crispin@cs.man.ac.uk>
To: <pgsql-general@postgresql.org>
Subject: unscribe
Date: Thu, 13 Jan 2000 10:56:22 -0800
MIME-Version: 1.0
Content-Type: text/plain;
charset="koi8-r"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3155.0
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
unscribe
From bouncefilter Thu Jan 13 14:10:57 2000
Received: from cap-ferrat.albourne.com (cap-ferrat.albourne.com
[195.89.178.227]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA83693
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 14:10:34 -0500 (EST)
(envelope-from a.joubert@albourne.com)
Received: from albourne.com (bishop-rock.albourne.com [195.89.178.230])
by cap-ferrat.albourne.com (8.9.3/8.9.3/Albourne/UKS/2.9/MAPS) with
ESMTP id TAA16557; Thu, 13 Jan 2000 19:10:11 GMT
Sender: a.joubert@albourne.com
Message-ID: <387E2319.2A11D310@albourne.com>
Date: Thu, 13 Jan 2000 19:10:17 +0000
From: Adriaan Joubert <a.joubert@albourne.com>
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.14 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: admin <admin@wtbwts.com>
CC: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] searching oid's
References: <Pine.BSF.4.10.10001131327050.70888-100000@server.b0x.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
First, I tried searching tables by their oid, but explain returned
sequential scans. Second, I tried specifing the oid as the primary key in
a table, but the oid column wasn't found. Finally, I created an index for
oid which worked fine. In the end, I feel I'm back to square one having to
use the same index as with my char(32) id's. It seems my only gain would
be 28 bytes per row and no speed gain, apart perhaps for building the
index which should be a bit slower for a char(32) datatype rather than an
integer.
Using oid's is not a good idea, as they don't automatically get dumped with
pg_dump. And once your referential integrity gets screwed up and you are
using oid's you are really in a mess, as you cannot change oids. Use a serial
field to generate a key for every row, which generates you a sequence of
integers. It is much better than oids at a cost of 4 bytes.
As far as i have understood you need an index if you want to avoid a
sequential scan as tuples are not stored in a hierarchy in the table. Only in
indexes do you get b-trees etc. So define your serial field as a primary key
and you are done. And comparing 4-byte ints is much faster than comparing
32-byte text fields, that's for sure.
Adriaan
From bouncefilter Thu Jan 13 16:01:59 2000
Received: from rannoch.demon.co.uk (rannoch.demon.co.uk [158.152.110.117])
by hub.org (8.9.3/8.9.3) with ESMTP id QAA14984
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 16:01:12 -0500 (EST)
(envelope-from apbran@rannoch.demon.co.uk)
Received: from localhost (apbran@localhost)
by rannoch.demon.co.uk (8.9.3/8.9.3) with ESMTP id UAA17892;
Thu, 13 Jan 2000 20:41:19 GMT
Date: Thu, 13 Jan 2000 20:41:17 +0000 (GMT)
From: Paul Branston <apbran@rannoch.demon.co.uk>
To: Wim Aarts <w.aarts@dsdeurne.nl>
cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Database synchronisation over the internet...
In-Reply-To: <200001131754.SAA07142@qube.dsdeurne.nl>
Message-ID: <Pine.LNX.4.10.10001132036210.16367-100000@rannoch.demon.co.uk>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Hi Wim,
I am also working on the self same thing. I am using ssh to authenticate
and encrpyt the connection. The master database uses pg_dump, since the
data is not too large, to create a file which is securely copied via scp
to the slave host. An ssh connection then logs into the slave,drops the
table and loads the data from the dump file which has been copied over.
seems to work so far, but there must be more refinements I can add.
Paul
On Thu, 13 Jan 2000, Wim Aarts wrote:
Hi All,
Availabilty is going to play an important role in some postgreSQL applications
we've build, (mission critical for those who wants to know).
Up until now everything has been straight forward SQL. And for backups we rely
on dumps and tapes. In the near future we would like to have a system that
enables synchronisation of data over the internet.
The requirements are:
security of data... (SSL ? in Europe)
master slave concept where the data on the slave is only changed by the master
and is allowed to be 10 minutes behind.What might we a good strategy for implementing such a system?
--
Wim Aarts************
From bouncefilter Thu Jan 13 16:02:58 2000
Received: from exchange.wesleyancollege.edu (exchange.WesleyanCollege.EDU
[168.17.224.28]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA15835
for <pgsql-general@postgreSQL.org>;
Thu, 13 Jan 2000 16:02:38 -0500 (EST)
(envelope-from JGlass@WesleyanCollege.edu)
From: JGlass@WesleyanCollege.edu
Received: by exchange.wesleyancollege.edu with Internet Mail Service
(5.5.2448.0) id <C5RT8VVJ>; Thu, 13 Jan 2000 15:58:54 -0500
Message-ID:
<B1FAA13A030AD311B60100902746416F46A4E1@exchange.wesleyancollege.edu>
To: pgsql-general@postgreSQL.org
Subject:
Date: Thu, 13 Jan 2000 15:58:53 -0500
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Content-Type: text/plain;
charset="iso-8859-1"
subscribe
end
From bouncefilter Thu Jan 13 21:09:02 2000
Received: from connectnet2.connectnet.com (spool.connectnet.com
[207.110.0.12])
by hub.org (8.9.3/8.9.3) with ESMTP id VAA97171
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 21:08:31 -0500 (EST)
(envelope-from bbaldwin@indyme.com)
Received: from INDYMEEXCH.INDY.COM (indymemail.indyme.com [207.110.14.226]) by
connectnet2.connectnet.com (8.9.1/CONNECTnet-4.0/THROTTLE) with
ESMTP id SAA21334 for <pgsql-general@postgresql.org.>;
Thu, 13 Jan 2000 18:08:38 -0800 (PST)
Received: by INDYMEEXCH with Internet Mail Service (5.5.2650.21)
id <Z9XWHKJC>; Thu, 13 Jan 2000 18:07:51 -0800
Message-ID: <319A9588FB5ED2119FAC00A0C912E3292786CC@INDYMEEXCH>
From: Barry Baldwin <bbaldwin@indyme.com>
To: pgsql-general@postgresql.org
Subject: Image data type
Date: Thu, 13 Jan 2000 18:07:47 -0800
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Hi there,
I've read the users guide and administrators guide and I don't see any
mention of a data type that would allow you to store image files.
Is there such a data type? The users guide mentions being able to define
your own types but says that it is discussed elsewhere. If there is
no data type to store images, will there be in the future?
TIA,
Barry
From bouncefilter Thu Jan 13 23:23:08 2000
Received: from mercury.noida.hclt.com ([204.160.248.59])
by hub.org (8.9.3/8.9.3) with ESMTP id XAA30585
for <pgsql-general@postgresql.org>;
Thu, 13 Jan 2000 23:22:05 -0500 (EST)
(envelope-from sirishk@noida.hclt.com)
Received: from sirishk.noida.hclt.com (sirishk [204.160.254.237])
by mercury.noida.hclt.com (8.8.7/8.8.7) with SMTP id JAA32009
for <pgsql-general@postgresql.org>; Fri, 14 Jan 2000 09:54:03 +0530
Message-ID: <009601bf5e44$dc00f2e0$edfea0cc@noida.hclt.com>
From: "Sirish Kumar" <sirishk@noida.hclt.com>
To: <pgsql-general@postgresql.org>
Subject: ecpg compile
Date: Fri, 14 Jan 2000 09:37:21 +0530
Organization: HCLT
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
Hello,
I tried to create database using embedded SQL through following
statements
...
exec sql begin declare section;
char dbname[]="pgdb";
...
exec sql end declare section;
main()
{
...
exec sql create database :dbname ;
...
}
On compilation ecpg gives parser error at "...create database..." statement.
Can anybody help ?
Thanks
Sirish
----------------------------------------
Best Regards
Sirish Kumar
HCL Technologies (India) Pvt. Ltd.
Ph : +91-11-8-510813/701/702 Ext.1107
Fax : +91-11-8-510713
----------------------------------------
From bouncefilter Fri Jan 14 00:04:09 2000
Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60])
by hub.org (8.9.3/8.9.3) with ESMTP id AAA42889
for <pgsql-general@postgreSQL.org>;
Fri, 14 Jan 2000 00:03:23 -0500 (EST) (envelope-from scrappy@hub.org)
Received: from localhost (scrappy@localhost)
by thelab.hub.org (8.9.3/8.9.1) with ESMTP id BAA82763;
Fri, 14 Jan 2000 01:02:47 -0400 (AST) (envelope-from scrappy@hub.org)
X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs
Date: Fri, 14 Jan 2000 01:02:47 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org>
To: Paul Branston <apbran@rannoch.demon.co.uk>
cc: Wim Aarts <w.aarts@dsdeurne.nl>, pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Database synchronisation over the internet...
In-Reply-To: <Pine.LNX.4.10.10001132036210.16367-100000@rannoch.demon.co.uk>
Message-ID: <Pine.BSF.4.21.0001140100540.46499-100000@thelab.hub.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Thu, 13 Jan 2000, Paul Branston wrote:
Hi Wim,
I am also working on the self same thing. I am using ssh to authenticate
and encrpyt the connection. The master database uses pg_dump, since the
data is not too large, to create a file which is securely copied via scp
to the slave host. An ssh connection then logs into the slave,drops the
table and loads the data from the dump file which has been copied over.seems to work so far, but there must be more refinements I can add.
use ssh to create a tunnel between server A and server B, then, from
Server A, issue somethig like:
psql -h ServerB -p 5432 -c "drop table <tablename>";
pg_dump tablename | psql -h ServerB -p 5432 ...
sorry, haven't done this myself, so my syntax is purely a matter of giving
an idea, that is why the ... at the end :)
Paul
On Thu, 13 Jan 2000, Wim Aarts wrote:
Hi All,
Availabilty is going to play an important role in some postgreSQL applications
we've build, (mission critical for those who wants to know).
Up until now everything has been straight forward SQL. And for backups we rely
on dumps and tapes. In the near future we would like to have a system that
enables synchronisation of data over the internet.
The requirements are:
security of data... (SSL ? in Europe)
master slave concept where the data on the slave is only changed by the master
and is allowed to be 10 minutes behind.What might we a good strategy for implementing such a system?
--
Wim Aarts************
************
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
Import Notes
Reference msg id not found: 200011091646.eA9Gk4E37609@online.thecia.ieReference msg id not found: 3A0B1EC7.DC4FEBD9@cs.auc.dkReference msg id not found: x6hf5gvf63.fsf@thor.candleweb.no