Re: [GENERAL] Improving Full text performance

2009-08-23 Thread Oleg Bartunov
On Sat, 22 Aug 2009, xaviergxf wrote: If i strip all html tags and filter more stop words, will the search be more accurate? Actually my fulltext stats returns some like: font from font tags i guess, and other garbage. If i do that, will i improve the speed of my search? What do you mean

[GENERAL] Strange missing tables problem

2009-08-23 Thread Denis BUCHER
Hello, I have a strange problem since I moved some tables to a schema, some tables are missing from the list (with \d or \dt) but they are still present anyway ???! Example : $ psql mybase Bienvenue dans psql 8.1.17, l'interface interactive de PostgreSQL. Saisissez: mybase=# bw_rma=#

Re: [GENERAL] Strange missing tables problem

2009-08-23 Thread Denis BUCHER
Hello, Small correction to my previous email : I have a strange problem since I moved some tables to a schema, some tables are missing from the list (with \d or \dt) but they are still present anyway ???! Example : $ psql mybase Bienvenue dans psql 8.1.17, l'interface interactive de

Re: [GENERAL] Strange missing tables problem

2009-08-23 Thread Wojtek
hi, You may try checking: SELECT * FROM pg_catalog.pg_class WHERE relname = 'customers' SELECT * FROM pg_catalog.pg_tables WHERE tablename = 'customers' to what's the status of your table. Regards, foo Denis BUCHER wrote: Hello, Small correction to my previous email : I have a strange

Re: [GENERAL] Strange missing tables problem

2009-08-23 Thread Denis BUCHER
Hello, That's what I found, do you see something inside that looks interesting ? bw_rma=# SELECT * FROM pg_catalog.pg_class WHERE relname = 'customers'; relname | relnamespace | reltype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | reltoastrelid | reltoastidxid |

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Greg Stark wrote: On Sun, Aug 23, 2009 at 4:06 AM, Jeff Rossjr...@wykids.org wrote: Greg Stark wrote: Actually, I wonder if this isn't more likely to show the problem -- it would explain why *all* your tables are showing up with duplicates rather than just one. select

Re: [GENERAL] Strange missing tables problem

2009-08-23 Thread Denis BUCHER
Hello, It's even more strange : # \dt customers Liste des relations Schéma | Nom | Type | Propriétaire +-+---+-- rma| customers | table | postgres (1 ligne) # \dt import.customers Liste des relations Schéma |

Re: [GENERAL] Strange missing tables problem

2009-08-23 Thread Bill Bartlett
Possible xid rollover problem? (We saw behavior similar to this during a recent xid rollover fiasco, where tables didn't appear in the various catalogs and psql catalog commands, but the data was still there.) What version of PostgreSQL are you on? If you try a VACUUM on the pg_catalog.pg_class

Re: [GENERAL] Strange missing tables problem

2009-08-23 Thread Wojtek
Denis BUCHER wrote: Hello, It's even more strange : why, looks logical to me :) # \dt customers Liste des relations Schéma | Nom | Type | Propriétaire +-+---+-- rma| customers | table | postgres (1 ligne) you have 1 'customers'

Re: [GENERAL] Strange missing tables problem

2009-08-23 Thread Denis BUCHER
Hello, Wojtek a écrit : It's even more strange : why, looks logical to me :) # \dt customers Liste des relations Schéma | Nom | Type | Propriétaire +-+---+-- rma| customers | table | postgres (1 ligne) you have 1

Re: [GENERAL] Strange missing tables problem

2009-08-23 Thread Denis BUCHER
Hello, # VACUUM pg_catalog.pg_class; VACUUM # VACUUM pg_catalog.pg_tables; ATTENTION: ignore « pg_tables » --- could not execute VACUUM on indexes, views or system tables VACUUM Denis Bill Bartlett a écrit : Possible xid rollover problem? (We saw behavior similar to this during a

Re: [GENERAL] bytea corruption?

2009-08-23 Thread Colin Streicher
I'm probably a little late to this discussion, but I have had issues before with BYTEA in postgres before as well, this is what I found worked. use Digest::MD5; use DBI qw(:sql_types); use DBD::Pg qw(:pg_types); sub InsertBin($$$) { my ( $dbh, $md5sum, $filename ) = @_;

Re: [GENERAL] Strange missing tables problem

2009-08-23 Thread Tom Lane
Denis BUCHER dbuche...@hsolutions.ch writes: I really don't understand what's happening here ? \dt customers will show you the customers table that's visible according to your search_path setting. Apparently schema import is either not in your search path at all, or behind rma.

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 2:18 PM, Jeff Rossjr...@wykids.org wrote: I had to modify your query slightly to make it run--hope I got what you are after! select (h).* from (select heap_page_items(get_raw_page('pg_namespace',0)) as h) as x; http://www.openvistas.net/pageinspect.html

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Greg Stark wrote: On Sun, Aug 23, 2009 at 2:18 PM, Jeff Rossjr...@wykids.org wrote: I had to modify your query slightly to make it run--hope I got what you are after! select (h).* from (select heap_page_items(get_raw_page('pg_namespace',0)) as h) as x;

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Greg Stark wrote: On Sun, Aug 23, 2009 at 5:02 PM, Greg Starkgsst...@mit.edu wrote: On Sun, Aug 23, 2009 at 2:18 PM, Jeff Rossjr...@wykids.org wrote: Incidentally, may as well ask the usual questions: And just for reference, what does pg_controldata print?

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 5:37 PM, Jeff Rossjr...@wykids.org wrote: pg_clog is 32K.  I've put it at http://www.openvistas.net/pg_clog Sorry, I'm getting a 404 -- greg http://mit.edu/~gsstark/resume.pdf -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

[GENERAL] Figuring out relationships between tables.

2009-08-23 Thread Andrew Cooper
Greetings, This is a general database design question. I've got a database where I need to hold information on employees. Every employee has much of the same information so I've created an Employee table. Now, some employees are supervisors or managers. An employee can only have 1

Re: [GENERAL] Strange missing tables problem

2009-08-23 Thread Guillaume Lelarge
Le dimanche 23 août 2009 à 14:26:06, Denis BUCHER a écrit : Hello, I have a strange problem since I moved some tables to a schema, some tables are missing from the list (with \d or \dt) but they are still present anyway ???! Example : $ psql mybase Bienvenue dans psql 8.1.17,

Re: [GENERAL] Figuring out relationships between tables.

2009-08-23 Thread Christophe Pettus
On Aug 23, 2009, at 7:47 AM, Andrew Cooper wrote: An employee can only have 1 manager/supervisor but the hierarchy can be varying depths. Traditionally, that's done by having a supervisor field as part of the employee record, with either NULL or a special marker value to indicate no

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 6:23 PM, Greg Starkgsst...@mit.edu wrote: On Sun, Aug 23, 2009 at 5:37 PM, Jeff Rossjr...@wykids.org wrote: pg_clog is 32K.  I've put it at http://www.openvistas.net/pg_clog Sorry, I'm getting a 404 For what it's worth this is what the heap dump shows. I don't

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Tom Lane
Greg Stark gsst...@mit.edu writes: The last tuple is marked strangely I think. I don't think it's supposed to have XMAX_INVALID if xmax is 0 but I could be wrong. Also, I don't understand why it's marked as UPDATED if ctid and xmax aren't set. No, that all looks right to me. UPDATE sets

Re: [GENERAL] Figuring out relationships between tables.

2009-08-23 Thread David Fetter
On Sun, Aug 23, 2009 at 09:47:06AM -0500, Andrew Cooper wrote: Greetings, This is a general database design question. I've got a database where I need to hold information on employees. Every employee has much of the same information so I've created an Employee table. Now, some

Re: [GENERAL] bytea corruption?

2009-08-23 Thread Nathan Jahnke
thank you very much, all. i was able to insert my data and get it back out with a matching hash. my problems were caused by confusion going between plperlu - which has the bytea storage explicit custom encoding requirement - and regular perl using dbd::pg - which does not as long as the data type

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 7:00 PM, Tom Lanet...@sss.pgh.pa.us wrote: Greg Stark gsst...@mit.edu writes: The last tuple is marked strangely I think. I don't think it's supposed to have XMAX_INVALID if xmax is 0 but I could be wrong. Also, I don't understand why it's marked as UPDATED if ctid and

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Tom Lane
Greg Stark gsst...@mit.edu writes: On Sun, Aug 23, 2009 at 7:00 PM, Tom Lanet...@sss.pgh.pa.us wrote: But we don't use that while examining individual tuples, do we? We don't use the visibility map itself but we *do* use the page header's all visible bit. On a sequential scan we skip the

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 7:34 PM, Tom Lanet...@sss.pgh.pa.us wrote: Greg Stark gsst...@mit.edu writes: On Sun, Aug 23, 2009 at 7:00 PM, Tom Lanet...@sss.pgh.pa.us wrote: But we don't use that while examining individual tuples, do we? We don't use the visibility map itself but we *do* use the

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 5:02 PM, Greg Starkgsst...@mit.edu wrote: On Sun, Aug 23, 2009 at 2:18 PM, Jeff Rossjr...@wykids.org wrote: Incidentally, may as well ask the usual questions: And just for reference, what does pg_controldata print? -- greg http://mit.edu/~gsstark/resume.pdf -- Sent

[GENERAL] libpq performance

2009-08-23 Thread Juan Backson
Hi, I have a sql that only takes 0.3 ms to run when using psql with explain analyze. However, when I execute it using PQexec, it takes 12ms for PGexec. Does anyone know why it is that slow? My db server is in the internal network, so there should not be any latency issue. Any suggestion will

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Tom Lane
Greg Stark gsst...@mit.edu writes: On Sun, Aug 23, 2009 at 7:34 PM, Tom Lanet...@sss.pgh.pa.us wrote: Urgh. I bet that's where the problem is then. Some path is failing to clear that bit, or maybe there's a race condition that allows it to become set incorrectly (ie right after somebody else

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Greg Stark wrote: On Sun, Aug 23, 2009 at 5:37 PM, Jeff Rossjr...@wykids.org wrote: pg_clog is 32K. �I've put it at http://www.openvistas.net/pg_clog Sorry, I'm getting a 404 Oops--fixed now. Jeff -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

[GENERAL] What approach should I use instead of creating tables on the fly?

2009-08-23 Thread Sergey Samokhin
Hello! I'm looking for a way to store quite a bit large amount of data in an efficient manner. There is about 8GB per day to store and I feel that approach I'm using now isn't what I want to end up with. Let me describe how I've tried to solve this problem before I ask my question in more

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Tom Lane wrote: Greg Stark gsst...@mit.edu writes: On Sun, Aug 23, 2009 at 7:34 PM, Tom Lanet...@sss.pgh.pa.us wrote: Urgh. I bet that's where the problem is then. Some path is failing to clear that bit, or maybe there's a race condition that allows it to become set incorrectly (ie

Re: [GENERAL] Figuring out relationships between tables.

2009-08-23 Thread Andrew Cooper
Thanks, guys. This really helps out. Andrew -- 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] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 9:06 PM, Jeff Rossjr...@wykids.org wrote: pglogd=# select (h).* from (select  page_header(get_raw_page('pg_namespace',0)) pglogd(# as h) as x;   lsn    | tli | flags | lower | upper | special | pagesize | version | prune_xid

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Tom Lane
Jeff Ross jr...@wykids.org writes: Tom Lane wrote: heap_update is broken. Details left as an exercise for the reader Well, as the reader that started this all ;-) should I be worried? Should I do a pg_dump and reinstall? Roll back to 8.3.7? Or just relax, don't worry and have a sparkling

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Tom Lane wrote: Jeff Ross jr...@wykids.org writes: Tom Lane wrote: heap_update is broken. Details left as an exercise for the reader Well, as the reader that started this all ;-) should I be worried? Should I do a pg_dump and reinstall? Roll back to 8.3.7? Or just

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Tom Lane
Jeff Ross jr...@wykids.org writes: Tom Lane wrote: Well, it's a pretty bad bug but as far as I can see a simple VACUUM table command should fix it up --- would you confirm? Hah! It did indeed clear it up! [ thinks... ] Actually, that only proves that the PD_ALL_VISIBLE fixup logic in

Re: [GENERAL] libpq performance

2009-08-23 Thread Craig Ringer
On Mon, 2009-08-24 at 00:08 +0800, Juan Backson wrote: I have a sql that only takes 0.3 ms to run when using psql with explain analyze. explain analyze reports server-side execution time. However, when I execute it using PQexec, it takes 12ms for PGexec. Does anyone know why it is that

Re: [GENERAL] What approach should I use instead of creating tables on the fly?

2009-08-23 Thread Craig Ringer
On Mon, 2009-08-24 at 00:31 +0400, Sergey Samokhin wrote: Unfortunatelly there is one disadvantage coming with this solution which I don't like: features aimed to control reference integrity (like REFERENCES constraint) are no longer my friends. Is there a way that mixes the advantages

Re: [GENERAL] Could not open relation XXX: No such file or directory

2009-08-23 Thread Alvaro Herrera
Alan Millington wrote: However, on looking at the matter again, I am now almost certain that I caused the problem myself. I have a Python function which (as a workaround to a problem which exists in Python 2.4, the version to which Postgres 8.1.4 is tied) executes a chdir. It appears that

Re: [GENERAL] Getting listed on Community Guide to PostgreSQL GUI Tools

2009-08-23 Thread Alvaro Herrera
Thomas Kellerer wrote: Hi, I was going through the list of application at http://wiki.postgresql.org/wiki/Community_Guide_to_PostgreSQL_GUI_Tools and was wondering whom I should contact to get my application listed there as well. It is a Java based SQL tool

[GENERAL] how to return field based on field= NULL or not

2009-08-23 Thread Juan Backson
Hi, In my table, I have fieldA and fieldB. At any point in time, only one of these fields can have data in it. The other is NULL. Instead of select fieldA, fieldB from table, I want it to return either fieldA or fieldB depends on whether it is NULL or not. The reason is because I want to use

Re: [GENERAL] how to return field based on field= NULL or not

2009-08-23 Thread Adam Rich
Juan Backson wrote: Hi, In my table, I have fieldA and fieldB. At any point in time, only one of these fields can have data in it. The other is NULL. Instead of select fieldA, fieldB from table, I want it to return either fieldA or fieldB depends on whether it is NULL or not. The

Re: [GENERAL] how to return field based on field= NULL or not

2009-08-23 Thread Wojtek
Hi, I assume one field will always be NULL and one will always has data in it. select coalesce(fieldA, fieldB) from table Regards, foo Juan Backson wrote: Hi, In my table, I have fieldA and fieldB. At any point in time, only one of these fields can have data in it. The other is NULL.

[GENERAL] Install from Source On Windows - University of Sydney Research

2009-08-23 Thread Kushal Vaghani
Hello, I have downloaded and built the 8.2.4 postgreSQL from source. This was done by running the build.bat file under src\tools\msvc. I do get a few errors with some contrib projects, but I do not care about them. When i do install(install.pl), there is a destination directory created. Now my

Re: [GENERAL] how to return field based on field= NULL or not

2009-08-23 Thread Scott Marlowe
On Sun, Aug 23, 2009 at 11:43 PM, Juan Backsonjuanback...@gmail.com wrote: Hi, Thank you for your help. What I want to dos is as follows: SELECT COALESCE(fieldA::text,fieldB||fieldC||fieldD) from ring where group_id = 1 if fieldB is NULL, i will want it to return fieldC|| fieldD if