Re: [GENERAL] optimizer ignoring primary key and doing sequence scan

2008-07-15 Thread Edoardo Panfili
Scott Marlowe ha scritto: On Mon, Jul 14, 2008 at 1:54 PM, Chris Hoy [EMAIL PROTECTED] wrote: Hi I have a number of tables in my database where the queries appear to ignoring the primary key and doing a seq scan instead, however other tables appear to be fine. I can see any difference between

Re: [GENERAL] Backing up and deleting a database.

2008-07-15 Thread Charles Duffy
Hi, On Tue, Jul 15, 2008 at 2:52 PM, Andrew Maclean [EMAIL PROTECTED] wrote: We have a database that grows in size quite quickly. Of course we backup nightly and keep a weeks worth of data However we need to keep a few months data online, but the rest can be archived as it will be unlikley

Re: [GENERAL] Inconsistency with stemming/stop words in Tsearch2

2008-07-15 Thread Oleg Bartunov
The list of stop-words is user defined, so you can just add 'whats' to the list. We didn't insert it to the default list, since it's not frequent as much as 'what'. btw, you can use ts_debug function to see what's really happens: =# select * from ts_debug('english','what''s'); alias |

[GENERAL] C-procedure crashed in Postgres 8.3.3 when using 'text' variable (WinXP)

2008-07-15 Thread el dorado
Hello! I'd like to write C-function returning text for using in PG 8.3.3. (WinXP SP2) For compilation I use MinGW-5.1.4 (gcc 3.4.5),MSYS-1.0.10. The code looks like this (in reduced variant): #include postgres.h #include fmgr.h #include executor/executor.h #include utils/timestamp.h #include

Re: [GENERAL] 8.3.3 Complie issue

2008-07-15 Thread Craig Ringer
Harvey, Allan AC wrote: I think we've seen this before: do you have utf8_and_euc_jis_2004.c in that directory? There seem to be some broken versions of tar out there that can't deal with extracting such a long file name from the distribution tarball. Thanks Tom, The c on the end was missing.

Re: [GENERAL] Multithreaded queue in PgSQL

2008-07-15 Thread valgog
Whole point is to have multiple services accessing same table and dividing the work, so locking with waiting for lock to be released is out of question. We are doing the same (newsletter) and there is no problem to lock the whole table for a short time with an advisory lock as the java id

Re: [GENERAL] optimizer ignoring primary key and doing sequence scan

2008-07-15 Thread Ragnar
On þri, 2008-07-15 at 08:19 +0200, Edoardo Panfili wrote: Scott Marlowe ha scritto: On Mon, Jul 14, 2008 at 1:54 PM, Chris Hoy [EMAIL PROTECTED] wrote: select * from industries where industryid = 1; Seq Scan on industries (cost=0.00..1.02 rows=1 width=116) (actual time=0.011..0.013

Re: [GENERAL] Multithreaded queue in PgSQL

2008-07-15 Thread Jeff Peck
We are doing the same (newsletter) and there is no problem to lock the whole table for a short time with an advisory lock as the java id fetching worker is locking the table (that does not lock the table for reading or writing, it is only locking his java worker brothers that are using the

Re: [GENERAL] FAQ correction for Windows 2000/XP

2008-07-15 Thread justin
Alvaro Herrera wrote: Bruce Momjian escribió: Dan Dascalescu wrote: I'd like to submit a correction for question 2.1) How do I setup a datasource? in the FAQ. The existing text reads: For Windows, use the ODBC Administrator in Control Panel. Here you can add, modify, or delete data

[GENERAL] how to found a variable is in a aggregation or not?

2008-07-15 Thread Yi Zhao
I want to check a variable is in a aggregattion or not, so I create a function as below: create or replace function anytest(val text) returns boolean as $$ begin perform 1 where quote_literal(val) in ('hello', 'world', 'test'); if not found then return false;

Re: [GENERAL] how to found a variable is in a aggregation or not?

2008-07-15 Thread Pavel Stehule
Hello in this case you must not use quoting postgres=# create or replace function anytest(val text) returns boolean as $$ begin perform 1 where val in ('hello', 'world', 'test'); if not found then return false; else return true; end if;

[GENERAL] Referential integrity vulnerability in 8.3.3

2008-07-15 Thread Sergey Konoplev
Hello community There is an oddity (or a bug) in situation with returning null before delete trigger and referential integrity in PG 8.3.3. I tryed to find a solution in Google and PG documentation and have noticed nothing useful. Let's start from tables creation. CREATE TABLE table1 ( id

Re: [GENERAL] Referential integrity vulnerability in 8.3.3

2008-07-15 Thread Richard Huxton
Sergey Konoplev wrote: There is an oddity (or a bug) in situation with returning null before delete trigger and referential integrity in PG 8.3.3. I tryed to find a solution in Google and PG documentation and have noticed nothing useful. [snip] CREATE OR REPLACE FUNCTION tr_stop() RETURNS

Re: [GENERAL] Backing up and deleting a database.

2008-07-15 Thread Bill Moran
In response to Andrew Maclean [EMAIL PROTECTED]: We have a database that grows in size quite quickly. Of course we backup nightly and keep a weeks worth of data However we need to keep a few months data online, but the rest can be archived as it will be unlikley that it will be used again.

[GENERAL] Unicode database on non-unicode operating system

2008-07-15 Thread Morten Barklund
Hi, I have a PostgreSQL 8.0.3 running on an older debian server and have some problems with unicode databases and character conversions. First up, some backgrund info about my server and installation: test=# \set VERSION = 'PostgreSQL 8.0.3 on i386-pc-linux-gnu, compiled by GCC cc

Re: [GENERAL] Referential integrity vulnerability in 8.3.3

2008-07-15 Thread Sergey Konoplev
Yes it is. But it the way to break integrity cos rows from table2 still refer to deleted rows from table1. So it conflicts with ideology isn't it? On Tue, Jul 15, 2008 at 4:00 PM, Richard Huxton [EMAIL PROTECTED] wrote: Sergey Konoplev wrote: There is an oddity (or a bug) in situation with

Re: [GENERAL] Unicode database on non-unicode operating system

2008-07-15 Thread Peter Eisentraut
Am Dienstag, 15. Juli 2008 schrieb Morten Barklund: My problem is, that the lowercase versions of non-ascii characters are broken. Specifically I found, that when lower() is invoked on a text with non-ascii characters, the operating system's locale is used for converting each octet in the

Re: [GENERAL] Referential integrity vulnerability in 8.3.3

2008-07-15 Thread Richard Huxton
Sergey Konoplev wrote: Yes it is. But it the way to break integrity cos rows from table2 still refer to deleted rows from table1. So it conflicts with ideology isn't it? Yes, but I'm not sure you could have a sensible behaviour-modifying BEFORE trigger without this loophole. Don't forget,

Re: [GENERAL] how to found a variable is in a aggregation or not?

2008-07-15 Thread Yi Zhao
it's works, thanks a lot! regards, Yi On Tue, 2008-07-15 at 13:30 +0200, Pavel Stehule wrote: Hello in this case you must not use quoting postgres=# create or replace function anytest(val text) returns boolean as $$ begin perform 1 where val in ('hello', 'world', 'test');

Re: [GENERAL] Unicode database on non-unicode operating system

2008-07-15 Thread Morten Barklund
Hi Peter, Thanks for the hint. I can see that lc_collate (sorting) and lc_ctype (lower-upper conversion) is set to en_DK and I guess that default encoding for en_DK is iso88591 or maybe windows1252. Thus my server should have been initialized with en_DK.utf8 or? How do I find out what the

Re: [GENERAL] FAQ correction for Windows 2000/XP

2008-07-15 Thread Bruce Momjian
Alvaro Herrera wrote: Bruce Momjian escribi?: Dan Dascalescu wrote: I'd like to submit a correction for question 2.1) How do I setup a datasource? in the FAQ. The existing text reads: For Windows, use the ODBC Administrator in Control Panel. Here you can add, modify, or delete

Re: [GENERAL] 8.3.3 Complie issue

2008-07-15 Thread Alvaro Herrera
Harvey, Allan AC wrote: Fixed that, how about this echo '{ global:' exports.list gawk '/^[^#]/ {printf %s;\n,$1}' exports.txt exports.list echo ' local: *; };' exports.list gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-strict-aliasing -fpic -shared

Re: [GENERAL] how to found a variable is in a aggregation or not?

2008-07-15 Thread Pavel Stehule
so this code is little bit ugly you can write faster code create or replace function anytest(val text) returns boolean as $$ begin return val in ('hello', 'world','test'); end; $$ language plpgsql immutable strict; Pavel 2008/7/15 Yi Zhao [EMAIL PROTECTED]: I want to check a variable is in

Re: [GENERAL] Unicode database on non-unicode operating system

2008-07-15 Thread Peter Eisentraut
Am Dienstag, 15. Juli 2008 schrieb Morten Barklund: I can see that lc_collate (sorting) and lc_ctype (lower-upper conversion) is set to en_DK and I guess that default encoding for en_DK is iso88591 or maybe windows1252. It is ISO-8859-1. There is no support for Windows charmaps on Linux.

Re: [GENERAL] Referential integrity vulnerability in 8.3.3

2008-07-15 Thread Sergey Konoplev
Yes it is. But it the way to break integrity cos rows from table2 still refer to deleted rows from table1. So it conflicts with ideology isn't it? Yes, but I'm not sure you could have a sensible behaviour-modifying BEFORE trigger without this loophole. Don't forget, ordinary users can't

Re: [GENERAL] Psql crashes with Segmentation fault on copy from

2008-07-15 Thread Bruce Momjian
Tom Lane wrote: I wrote: Francisco Reyes [EMAIL PROTECTED] writes: On 3:09 pm 05/28/08 Gregory Stark [EMAIL PROTECTED] wrote: Does it really have a COPY command at the beginning? Are you really doing \i data/usb_t_60M.sql or were you trying to do a copy from this file? Argh..That's

Re: [GENERAL] [pgsql-advocacy] [pdxpug] Pg booth staffing at OSCON

2008-07-15 Thread Josh Berkus
Daniel, I'm starting a new job this week, but they said I can get the OSCON days off so I can fill in the booth for many of the empty spots. I don't want to do the booth during the keynotes (and what would be the point anyways no one will be in the exhibitor hall), and I'd kinda like to

Re: [GENERAL] FAQ correction for Windows 2000/XP

2008-07-15 Thread Dave Page
On Tue, Jul 15, 2008 at 2:34 PM, Bruce Momjian [EMAIL PROTECTED] wrote: Alvaro Herrera wrote: Bruce Momjian escribi?: Dan Dascalescu wrote: I'd like to submit a correction for question 2.1) How do I setup a datasource? in the FAQ. The existing text reads: For Windows, use the ODBC

Re: [GENERAL] Unicode database on non-unicode operating system

2008-07-15 Thread Morten Barklund
Hi Peter, Thank you once again. That cleared up a lot of confusion for me and my co-workers and the next server set up will be with unicode and en_DK.utf8 to ensure consistency. Regards, Morten Barklund -Original Message- From: Peter Eisentraut [mailto:[EMAIL PROTECTED] Sent:

Re: [GENERAL] C-procedure crashed in Postgres 8.3.3 when using 'text' variable (WinXP)

2008-07-15 Thread Tom Lane
el dorado [EMAIL PROTECTED] writes: I'd like to write C-function returning text for using in PG 8.3.3. (WinXP SP2) For compilation I use MinGW-5.1.4 (gcc 3.4.5),MSYS-1.0.10. Was the Postgres server you're using built the same way? I seem to recall some incompatibilities between MinGW and MSVC

Re: [GENERAL] [pgsql-advocacy] [pdxpug] Pg booth staffing at OSCON

2008-07-15 Thread Daniel Johnson
Well, you can obviously get into OSCAMP and FOSSCoach and the BOFs and the other free events. Not that I'd be promoting such a thing (as an OSCON committee member), but if there's *a* specific session you want to attend, you can probably persuade one of the several PostgreSQL speakers to loan

Re: [GENERAL] Inaccurate row count estimation

2008-07-15 Thread Vyacheslav Kalinin
Thanks for the reply, Tom. After tracing through this I see that the problem is that we don't have statistics for inheritance trees, and so you're getting a default estimate for the selectivity of the join condition. I might be wrong but I suspect that the inheritance is not the only reason

Re: [GENERAL] Installing PostgreSQL without using CygWin

2008-07-15 Thread Scott Marlowe
Better to go here: http://www.postgresql.org/ftp/binary/v8.3.3/win32/ and get the latest version On Mon, Jul 14, 2008 at 11:01 PM, Dann Corbit [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ken andrew Sent: Sunday, July 13, 2008 10:27 PM To:

Re: [GENERAL] Referential integrity vulnerability in 8.3.3

2008-07-15 Thread David Fetter
On Tue, Jul 15, 2008 at 06:02:27PM +0400, Sergey Konoplev wrote: Yes it is. But it the way to break integrity cos rows from table2 still refer to deleted rows from table1. So it conflicts with ideology isn't it? Yes, but I'm not sure you could have a sensible behaviour-modifying BEFORE

Re: [GENERAL] Referential integrity vulnerability in 8.3.3

2008-07-15 Thread Richard Huxton
Sergey Konoplev wrote: Yes it is. But it the way to break integrity cos rows from table2 still refer to deleted rows from table1. So it conflicts with ideology isn't it? Yes, but I'm not sure you could have a sensible behaviour-modifying BEFORE trigger without this loophole. Don't forget,

Re: [GENERAL] Out of memry with large result set

2008-07-15 Thread [EMAIL PROTECTED]
Try copy (query) to stdout. For me, psql sits at 4.9mb ram on a 3x10^16 row query. klint. Thanks Klint. Can I use a 'copy to' for a query ? I thought I can only do 'copy table to stdout' I will do some tests tomorrow and keep you inform. Olivier -- Sent via pgsql-general mailing list

Re: [GENERAL] vacuum taking an unusually long time

2008-07-15 Thread Mason Hale
None of these values have changed recently. The values are: vacuum_cost_delay = 10ms vacuum_cost_limit = 200 Are there any other values I should be looking at? The longest running vacuum has been running more than 6 days at this point. Thanks, Mason On Mon, Jul 14, 2008 at 4:39 PM, Scott

[GENERAL] pg_dump

2008-07-15 Thread Bob Pawley
Is there a GUI for pg_dump??? Bob -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] pg_dump

2008-07-15 Thread Raymond O'Donnell
On 15/07/2008 19:31, Bob Pawley wrote: Is there a GUI for pg_dump??? Yep - it's called PgAdmin!! :-) Ray. -- Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland [EMAIL PROTECTED] Galway Cathedral Recitals:

[GENERAL] pg_dump

2008-07-15 Thread Bob Pawley
Is there a GUI for pg_dump??? Bob -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] query optimization

2008-07-15 Thread Kevin Duffy
Hello: I need your kind assistance to debug an optimization issue. The following two select statements in my book are almost identical. One does a lookup for security type 'CFD' and the other does the same lookup except for security 'OP'. When run with 'CFD' the query never returns.

Re: [GENERAL] optimizer ignoring primary key and doing sequence scan

2008-07-15 Thread Scott Marlowe
On Tue, Jul 15, 2008 at 12:19 AM, Edoardo Panfili [EMAIL PROTECTED] wrote: Scott Marlowe ha scritto: On Mon, Jul 14, 2008 at 1:54 PM, Chris Hoy [EMAIL PROTECTED] wrote: Hi I have a number of tables in my database where the queries appear to ignoring the primary key and doing a seq scan

Re: [GENERAL] C-procedure crashed in Postgres 8.3.3 when using 'text' variable (WinXP)

2008-07-15 Thread Craig Ringer
Tom Lane wrote: el dorado [EMAIL PROTECTED] writes: I'd like to write C-function returning text for using in PG 8.3.3. (WinXP SP2) For compilation I use MinGW-5.1.4 (gcc 3.4.5),MSYS-1.0.10. Was the Postgres server you're using built the same way? I seem to recall some incompatibilities

Re: [GENERAL] 8.3.3 Complie issue

2008-07-15 Thread Harvey, Allan AC
Old Slackware? If you really want to compile there, I think it should work by just removing the -Wl,--version-script param from the link line. Thanks Alvaro, Worked through them. Regression tests show all is OK, save for the handling of Infinity. Don't think that will be a problem 'cause I

Re: [GENERAL] pg_dump

2008-07-15 Thread Adrian Klaver
-- Original message -- From: Bob Pawley [EMAIL PROTECTED] Is there a GUI for pg_dump??? Bob http://www.pgadmin.org/docs/1.8/backup.html -- Adrian Klaver [EMAIL PROTECTED] -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] [pgsql-advocacy] [pdxpug] Pg booth staffing at OSCON

2008-07-15 Thread Josh Berkus
Daniel, We help make the conference happen so please treat us with respect even if we can't afford to pay are way in. Huh? How was I disrespectful? Because I suggested discounts? As a committee members you are technically a volunteer with a free pass yourself! Well, I actually have a

[GENERAL] 8.3.3 regression test on SCO 5.0.7

2008-07-15 Thread Harvey, Allan AC
Hi All, I have been working through upgrades on legacy business systems on old Linux and SCO plateforms. With the help of this list the Linux problems are handled, thanks. The SCO build is not yet done. I have managed to compile 8.3.3 with the help of the archives. But there were lots of

Re: [GENERAL] [pgsql-advocacy] [pdxpug] Pg booth staffing at OSCON

2008-07-15 Thread Robert Treat
On Tuesday 15 July 2008 10:42:07 Daniel Johnson wrote: Well, you can obviously get into OSCAMP and FOSSCoach and the BOFs and the other free events. Not that I'd be promoting such a thing (as an OSCON committee member), but if there's *a* specific session you want to attend, you can

Re: [GENERAL] Out of memry with large result set

2008-07-15 Thread Scott Marlowe
On Mon, Jul 14, 2008 at 11:53 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Try copy (query) to stdout. For me, psql sits at 4.9mb ram on a 3x10^16 row query. klint. Thanks Klint. Can I use a 'copy to' for a query ? I thought I can only do 'copy table to stdout' I will do some tests

Re: [GENERAL] how to found a variable is in a aggregation or not?

2008-07-15 Thread Yi Zhao
yes It's better obviously, thanks:D Yi On Tue, 2008-07-15 at 15:46 +0200, Pavel Stehule wrote: so this code is little bit ugly you can write faster code create or replace function anytest(val text) returns boolean as $$ begin return val in ('hello', 'world','test'); end; $$

Re: [GENERAL] C-procedure crashed in Postgres 8.3.3 when using 'text' variable (WinXP)

2008-07-15 Thread Alvaro Herrera
Craig Ringer wrote: That said, PostgreSQL does appear to use its own allocator for memory passed across library boundaries, and if it doesn't pass any FILE pointers across library boundaries either then that's the worst two problems that arise with a C runtime mismatch taken care of. As

[GENERAL] How to create my own result set?

2008-07-15 Thread Ismael ....
Hi there, I'm making a really weird stored procedure which makes use of about 5 tables... and I need to create my own result set based on the computed result of various FOR loops. Does anyone knows how can I do that using PL/pgSQL? I think I need to declare a couple of variables that accept

Re: [GENERAL] C-procedure crashed in Postgres 8.3.3 when using 'text' variable (WinXP)

2008-07-15 Thread Craig Ringer
Alvaro Herrera wrote: Craig Ringer wrote: That said, PostgreSQL does appear to use its own allocator for memory passed across library boundaries, and if it doesn't pass any FILE pointers across library boundaries either then that's the worst two problems that arise with a C runtime

Re: [GENERAL] How to create my own result set?

2008-07-15 Thread Ismael ....
I'll try with what says in the FAQ, but should someone know of a way to declare a variable that allows appending please tell me http://wiki.postgresql.org/wiki/Return_more_than_one_row_of_data_from_PL/pgSQL_functions Hi there, I'm making a really

Re: [GENERAL] vacuum taking an unusually long time

2008-07-15 Thread Tom Lane
Mason Hale [EMAIL PROTECTED] writes: The longest running vacuum has been running more than 6 days at this point. Is it actually *doing* anything, or is it just blocked waiting for someone else? strace or local equivalent would be the most definitive way to check.

Re: [GENERAL] 8.3.3 regression test on SCO 5.0.7

2008-07-15 Thread Tom Lane
Harvey, Allan AC [EMAIL PROTECTED] writes: creating template1 database in /upgrades/postgres/postgresql-8.3.3/src/test/regre ss/./tmp_check/data/base/1 ... =: is not an identifier I'd guess you have an incompatible awk or possibly sed. Look at the postgres.bki file generated on this system

Re: [GENERAL] [pgsql-advocacy] [pdxpug] Pg booth staffing at OSCON

2008-07-15 Thread Daniel Johnson
I can't imagine how you could have taken Josh's post to be anything but courteous and respectful, but I do encourage you to join us at the BOF where we can settle it once and for all sumo suits anyone? http://www.maineventweb.com/page/page/2916926.htm I'm going to blame the stress of

Re: [GENERAL] [pgsql-advocacy] [pdxpug] Pg booth staffing at OSCON

2008-07-15 Thread Joshua D. Drake
Daniel Johnson wrote: I can't imagine how you could have taken Josh's post to be anything but courteous and respectful, but I do encourage you to join us at the BOF where we can settle it once and for all sumo suits anyone? http://www.maineventweb.com/page/page/2916926.htm I'm going to