Re: [GENERAL] General query optimization howto

2005-03-13 Thread Peter Eisentraut
Miroslav ¦ulc wrote: is there on the net any general howto on SQL query optimizations? We have recently moved our project from MySQL to PostgreSQL and are having problem with one of our queries. I doubt that there is a generic documentation on SQL optimization, because this heavily depends on

Re: [GENERAL] General query optimization howto

2005-03-13 Thread Ragnar Hafstað
On Sun, 2005-03-13 at 02:34 +0100, Miroslav ulc wrote: is there on the net any general howto on SQL query optimizations? We have recently moved our project from MySQL to PostgreSQL and are having problem with one of our queries. The EXPLAIN command is surely useful but I don't know how to

Re: [GENERAL] General query optimization howto

2005-03-13 Thread Miroslav ulc
Bruce Momjian wrote: Have you read the FAQ? Yes, but I have found only some useful information saying when indexes are not used. Miroslav ulc begin:vcard fn;quoted-printable:Miroslav =C5=A0ulc n;quoted-printable:=C5=A0ulc;Miroslav org:StartNet s.r.o.

Re: [GENERAL] General query optimization howto

2005-03-13 Thread Miroslav ulc
Peter Eisentraut wrote: Miroslav ¦ulc wrote: is there on the net any general howto on SQL query optimizations? We have recently moved our project from MySQL to PostgreSQL and are having problem with one of our queries. I doubt that there is a generic documentation on SQL optimization,

Re: [GENERAL] partitionning

2005-03-13 Thread Martijn van Oosterhout
On Sat, Mar 12, 2005 at 11:35:51PM -0500, Tom Lane wrote: The issue isn't really whether the planner *could* use a constraint to decide that a table need not be scanned at all. As you say, we have practically all the infrastructure needed for such inferences. To me the real reason why we

[GENERAL] where is the locale set for each server instance?

2005-03-13 Thread Palle Girgensohn
Hi! I'm pluggin ICU into PostgreSQL for unicode collation, since FreeBSD has no support for unicode collation. It works fine, but I cannot find out where to set the default locale for each backend instance. I want to use the LC_COLLATE used in initdb, now I've just hard wired it for my own

Re: [GENERAL] where is the locale set for each server instance?

2005-03-13 Thread Tom Lane
Palle Girgensohn [EMAIL PROTECTED] writes: So, I'm trying to find out where LC_COLLATE is overridden. Any tips? access/transam/xlog.c (which is the only file that touches pg_control, I believe). regards, tom lane ---(end of

Re: [GENERAL] [PATCHES] A way to let Vacuum warn if FSM settings are low. [final?]

2005-03-13 Thread Greg Stark
Bruce Momjian pgman@candle.pha.pa.us writes: These new messages: NOTICE: max_fsm_relations(1000) equals the number of relations checked HINT: You have = 44 relations. Consider increasing the configuration parameter max_fsm_relations. NOTICE: the number of

Re: [GENERAL] where is the locale set for each server instance?

2005-03-13 Thread Palle Girgensohn
--On söndag, mars 13, 2005 17.01.31 -0500 Tom Lane [EMAIL PROTECTED] wrote: Palle Girgensohn [EMAIL PROTECTED] writes: So, I'm trying to find out where LC_COLLATE is overridden. Any tips? access/transam/xlog.c (which is the only file that touches pg_control, I believe). OK, seems my problem is

Re: [GENERAL] where is the locale set for each server instance?

2005-03-13 Thread Tom Lane
Palle Girgensohn [EMAIL PROTECTED] writes: OK, seems my problem is with ICU. The xlog.c:ReadConfigFile() is not run for each backend, it seems, I assume it is forked after that. No, it is run once in the postmaster, as indeed the comments in it say. Seems ICU cannot remember a

Re: [GENERAL] where is the locale set for each server instance?

2005-03-13 Thread Palle Girgensohn
--On söndag, mars 13, 2005 18.37.24 -0500 Tom Lane [EMAIL PROTECTED] wrote: Palle Girgensohn [EMAIL PROTECTED] writes: OK, seems my problem is with ICU. The xlog.c:ReadConfigFile() is not run for each backend, it seems, I assume it is forked after that. No, it is run once in the postmaster, as

Re: [GENERAL] Postgres jobs mailing list?

2005-03-13 Thread John DeSoi
On Mar 11, 2005, at 6:49 PM, Jerry Sievers wrote: The PG mailing lists web page contains artifacts of a jobs list but no such list appeared in the dropdown of available lists. I am referring to; http://www.postgresql.org/community/lists/subscribe Is there such a resource and if so, could someone

[GENERAL] preoblem in jdbc postgresql and tomcat

2005-03-13 Thread java unix
hi, i have installed postgresql-7.4.1,and tomcat4.1.31and j2sdk1.4.2_07 for tomcat i have included path /usr/local/jakarta-tomcat-4.1.31 for j2sdk path set is /usr/local/j2sdk1.4.2_07 and CLASSPATH SET IS: /usr/local/pgsql/pg73jdbc3.jar:/usr/local/pgsql/pg74.215.jdbc3.jar:/usr/local/pg

[GENERAL] fied separator change from the shell command line

2005-03-13 Thread paulo . oliveira
Hello, I'm trying to change the usal | table field separator from the shell command line: psql -d ect -f pl_lost.sql -o pl_lost.out.txt -F \t -U asaadmin But it doesn't work. It keeps the same | separator in the output file. Can anyone please help me? I need to output to a tab separated file.

[GENERAL] sql question

2005-03-13 Thread Steven Verhoeven
Hi all My table definition : id | fref | mref --+---+-- 1 | 23 | 25 2 | 24 | 28 3 | 25 | 31 4 | 26 | 34 My problem : i need a query that results in this : id | ref --+-- 1 | 23 1 | 25 2 | 24 2 | 28 3 | 25 3 | 31 4 | 26 4 | 34 Do I need a

[GENERAL] PostgreSQL training

2005-03-13 Thread Alex Adriaanse
Hi, I'm working on an application for a client that uses PostgreSQL as its database backend. The client wants to train their team on PostgreSQL so that they can maintain the application and the database themselves after it goes live should they need to. As far as I know the majority of them

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-13 Thread Chris Travers
Tope Akinniyi wrote: Hi all, In my country Nigeria (and even African continent), we do not eat what the western world eat. We wear different styles of cloths. In the same vein, our computerisation culture is different. Having lived in Indonesia, I can sympathize with your situation. It is

[GENERAL] sql question

2005-03-13 Thread Steven Verhoeven
My table definition : id | fref | mref --+---+-- 1 | 23| 25 2 | 24| 28 3 | 25| 31 4 | 26| 34 i need a query that results in this : id |ref --+-- 1 | 23 1 | 25 2 | 24 2 |

[GENERAL] Permission's question

2005-03-13 Thread Ryan J. Cavicchioni
Hi, I am new to Postgres so please bear with me. How do you create a database where only the owner can read and write to it. I created a database owned by a user but I noticed that when logined in as another user that was not an owner of that database that they could write to it. So my question

[GENERAL] Postgres stored proc that extracts data from Oracle

2005-03-13 Thread James
Hello All, I am a beginning PL/pgSQL and PL/SQL developer and I have a question. I need to create a procedure in postgres that would compare data between a table in Postgres and a table in Oracle. Let's put it like this, I have a list of projects in a table in PG and the properties of those

Re: [GENERAL] fied separator change from the shell command line

2005-03-13 Thread Edmund Bacon
[EMAIL PROTECTED] writes: Hello, I'm trying to change the usal | table field separator from the shell command line: psql -d ect -f pl_lost.sql -o pl_lost.out.txt -F \t -U asaadmin But it doesn't work. It keeps the same | separator in the output file. Can anyone please help me? I need

[GENERAL] German umlauts problem (under WindowsXP, COBOL programm)

2005-03-13 Thread Libo Luo
Hello everyone, my colleagues and I try to convert our old data base system to PG. We created a small client-server prototype and used a java programm (J2SE, Version 1.4.1_01, JDBC-Treiber: pgdev.307.jdbc3) to test. Everything goes well and the German umlauts (ä, ö, ü, ß, Ä, Ö, Ü) can be

[GENERAL] Oracle's Virtual Private Database functionality

2005-03-13 Thread Doug Bloebaum
In the spirit of tell us what you're trying to do... I'd like to mimic a subset of Oracle's Virtual Private Database functionality (see http://dba-oracle.com/oracle_news/2004_1_16_vpd_security.htm for an overview) in Postgres: based on some per-connection setting, I'd like a query to return a

[GENERAL] PL/Java vs PL/pgSQL

2005-03-13 Thread Stanislaw Tristan
1. Who is faster? 2. Who is recomended? ---(end of broadcast)--- TIP 8: explain analyze is your friend

[GENERAL] normal user dump gives error because of plpgsql

2005-03-13 Thread Janning Vygen
Hi, i have a normal user with rights to create a db. template1 contains language plpgsql. the user wants to - dump his db - drop his db - create it again - and use the dump file to fill it. it gives errors because of CREATE LANGUAGE statements inside the dump. How can i prevent that the dump

Re: [GENERAL] LIMIT and him usage

2005-03-13 Thread Ladis
Hello, I don't have a problem. I would like know,  how is it implemented on low-level (base) layer. I'm sorry for my english. Thank you for your answers LADiS On Mon, Mar 07, 2005 at 11:31:06AM +0100, Ladislav Linhart wrote: Create temprorary table before applyes LIMIT ? Exists any way for

Re: [GENERAL] pl sql to check if table of table_name exists

2005-03-13 Thread Adam Tomjack
Shaun Clements wrote: Hi Hate to ask, but it isnt obvious to me from the documentation. How do I perform a query in pgplsql, to check it a table exists of a particular name. Thanks in advance Kind Regards, Shaun Clements -- A list of tables: SELECT schemaname, tablename FROM pg_tables; -- Returns

[GENERAL] Postgres - Tsearch2 Module

2005-03-13 Thread Raghunath Ganti
Hi, I am running Postgres 7.4.1 and donot have the TSEARCH2 module. If i download this module alone and then install, should i have to restart the database. / postmaster service. Thanks for your help, Ganti Raghunath. ---(end of broadcast)---

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-13 Thread Chris Travers
Tope Akinniyi wrote: Hi, I am wondering at this display of extreme Linux mentality being displayed by the 'top bras' of the PostgreSQL community. And I ask, are we encouraging Windows use of PostgreSQL at all? At the moment? There are some known issues... Bear in mind that the Windows port

[GENERAL] New user: Windows, Postgresql, Python

2005-03-13 Thread Paul Moore
Hi, I'm just starting to look at Postgresql. My platform (for better or worse) is Windows, and I'm quite interested in the pl/python support. However, when I run the binary installer, it is not offered to me as an option (it's there, but greyed out). The plpython.dll file is installed, however.

Re: [GENERAL] Disabling triggers in a transaction

2005-03-13 Thread Adam Tomjack
Bruce Momjian wrote: Geoffrey wrote: Terry Lee Tucker wrote: Tom, Do you feel this is a safe method for disabling triggers in the rare cases where one finds that it is prudent to do that? Do you think that the column, reltriggers, is permanent fixture in pg_class? What is your advice on this?

[GENERAL] Question about accessing current row data inside trigger

2005-03-13 Thread peter Willis
Hello, I have a trigger function written in C. The trigger function is called via: CREATE TRIGGER after_update AFTER UPDATE ON some_table FOR EACH ROW EXECUTE PROCEDURE my_trigger_function(); Since the trigger is called after each row update the actual row data should be available in some

Re: [GENERAL] Stuck with a query...

2005-03-13 Thread Edmund Bacon
[EMAIL PROTECTED] (Greg Stark) writes: Geoff Caplan [EMAIL PROTECTED] writes: Hi folks, Sorry to ask a newbie SQL question but I'm struggling... There's no efficient way to write this in standard SQL. However Postgres has an extension DISTINCT ON that would do it: select

Re: [GENERAL] sql question

2005-03-13 Thread Vincent Hikida
SELECT t1.id , t1.fref FROM t1 UNION ALL SELECT t2.id , t2.mref FROM t2 - Original Message - From: Steven Verhoeven To: pgsql-general@postgresql.org ; [EMAIL PROTECTED] Sent: Friday, March 11, 2005 4:36 AM Subject: [GENERAL] sql question Hi all My table

Re: [GENERAL] sql question

2005-03-13 Thread Russell Smith
On Fri, 11 Mar 2005 11:36 pm, Steven Verhoeven wrote: Hi all My table definition : id | fref | mref --+---+-- 1 | 23| 25 2 | 24| 28 3 | 25| 31 4 | 26| 34 My problem : i need a query that results in

Re: [GENERAL] sql question

2005-03-13 Thread Klint Gore
On Fri, 11 Mar 2005 13:36:17 +0100, Steven Verhoeven [EMAIL PROTECTED] wrote: Hi all My table definition : id | fref | mref --+---+-- 1 | 23| 25 2 | 24| 28 3 | 25| 31 4 | 26| 34 My problem : i need

Re: [NOVICE] [GENERAL] sql question

2005-03-13 Thread Vincent Hikida
OOPs. I mean SELECT t1.id , t1.fref FROM t1 UNION ALL SELECT t1.id , t1.mref FROM t1 - Original Message - From: Vincent Hikida To: Steven Verhoeven ; pgsql-general@postgresql.org ; [EMAIL PROTECTED] Sent: Sunday, March 13, 2005 6:34 PM Subject: Re:

Re: [GENERAL] [PATCHES] A way to let Vacuum warn if FSM settings are low. [final?]

2005-03-13 Thread Bruce Momjian
Ron Mayer wrote: Bruce Momjian wrote: You didn't like server_min_messages = 'notify'? I merely don't have a feeling for how much additional stuff verbose would be putting in the log files. You will probably see the creation of indexes and sequences, like this: test=

Re: [GENERAL] [PATCHES] A way to let Vacuum warn if FSM settings are

2005-03-13 Thread Bruce Momjian
Greg Stark wrote: Bruce Momjian pgman@candle.pha.pa.us writes: These new messages: NOTICE: max_fsm_relations(1000) equals the number of relations checked HINT: You have = 44 relations. Consider increasing the configuration parameter max_fsm_relations.

Re: [GENERAL] Oracle's Virtual Private Database functionality

2005-03-13 Thread Bruno Wolff III
On Wed, Mar 09, 2005 at 13:52:28 -0500, Doug Bloebaum [EMAIL PROTECTED] wrote: It's apparent why: the view determines which table it's going to use at view creation time, not at query time, so this method is no good. Is there a right way to accomplish what I'm trying to do? I think the

Re: [GENERAL] Postgres stored proc that extracts data from Oracle

2005-03-13 Thread Bruno Wolff III
On Thu, Mar 10, 2005 at 17:12:46 -0800, James [EMAIL PROTECTED] wrote: Do you guys have thoughts on how to implement this? I am not expecting an easy solution but I wish to get started asap. Any advice would be appreciated. My usual solution is to use a perl script which talks to both

Re: [GENERAL] sql question

2005-03-13 Thread George Essig
On Fri, 11 Mar 2005 13:26:07 +0100, Steven Verhoeven [EMAIL PROTECTED] wrote: My table definition : id | fref | mref --+---+-- 1 | 23| 25 2 | 24| 28 3 | 25| 31 4 | 26| 34 i need a query that results in

Re: [GENERAL] Question about accessing current row data inside trigger

2005-03-13 Thread Michael Fuhr
On Tue, Mar 08, 2005 at 11:37:14AM -0800, peter Willis wrote: I have a trigger function written in C. The trigger function is called via: CREATE TRIGGER after_update AFTER UPDATE ON some_table FOR EACH ROW EXECUTE PROCEDURE my_trigger_function(); Since the trigger is called after

Re: [GENERAL] fied separator change from the shell command line

2005-03-13 Thread Tom Lane
Edmund Bacon [EMAIL PROTECTED] writes: [EMAIL PROTECTED] writes: I'm trying to change the usal | table field separator from the shell command line: psql -d ect -f pl_lost.sql -o pl_lost.out.txt -F \t -U asaadmin Changing the field separator only works with unaligned output. You need to add

Re: [GENERAL] Question about accessing current row data inside trigger

2005-03-13 Thread Tom Lane
peter Willis [EMAIL PROTECTED] writes: I have a trigger function written in C. ... Since the trigger is called after each row update the actual row data should be available in some way to the trigger. Sure: tg_trigtuple or tg_newtuple depending on which state you want. See

Re: [GENERAL] [PATCHES] A way to let Vacuum warn if FSM settings are low. [final?]

2005-03-13 Thread Tom Lane
Bruce Momjian pgman@candle.pha.pa.us writes: Ron Mayer wrote: My reasoning why I thought the log file was more useful was that only an admin with access to the log files could really do anything about the message anyway. The log file is useful, but I think showing the VACUUM user is _more_