Re: [GENERAL] How to simulate crashes of PostgreSQL?

2009-08-23 Thread Scott Marlowe
On Mon, Aug 24, 2009 at 12:49 AM, Craig Ringer wrote: > You should also test your client's response to the Pg server remaining > up but becoming non-responsive (eg: failed disk array causes Pg backends > to remain in uninterruptable disk I/O system calls in the kernel). A > possibly good way to do

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

2009-08-23 Thread Craig Ringer
On Mon, 2009-08-24 at 16:48 +1000, Kushal Vaghani wrote: > okay guys I will get 8.2.13, so would running the install.pl would be > different. > > I will try and see if I can compile and run as mentioned from the > docs. But would there be any script after install.pl to run the > postmaster, init

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

2009-08-23 Thread Scott Marlowe
On Mon, Aug 24, 2009 at 12:48 AM, Kushal Vaghani wrote: > okay guys I will get 8.2.13, so would running the install.pl would be > different. > > I will try and see if I can compile and run as mentioned from the docs. But > would there be any script after install.pl to run the postmaster, initDB On

Re: [GENERAL] How to simulate crashes of PostgreSQL?

2009-08-23 Thread Craig Ringer
On Sat, 2009-08-22 at 13:03 -0700, Sergey Samokhin wrote: > Hello! > > To make my client application tolerant of PostgreSQL failures I first > need to be able to simulate them in a safe manner (hard reset isn't a > solution I'm looking for :) > > Is there a way to disconnect all the clients as if

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

2009-08-23 Thread Scott Marlowe
On Mon, Aug 24, 2009 at 12:40 AM, Scott Marlowe wrote: > On Mon, Aug 24, 2009 at 12:22 AM, Kushal Vaghani > wrote: >> Hey Craig >> >> I am doing a research project on a particular branch of postgreSQL and we >> have already had some code written on top of 8.2.4 base release few years >> back. I am

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

2009-08-23 Thread Scott Marlowe
On Mon, Aug 24, 2009 at 12:22 AM, Kushal Vaghani wrote: > Hey Craig > > I am doing a research project on a particular branch of postgreSQL and we > have already had some code written on top of 8.2.4 base release few years > back. I am doing some extensions to it. So thats the reason of not using th

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

2009-08-23 Thread Kushal Vaghani
Hey Craig I am doing a research project on a particular branch of postgreSQL and we have already had some code written on top of 8.2.4 base release few years back. I am doing some extensions to it. So thats the reason of not using the latest releases. There would be lot of extra patching etc. I m

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

2009-08-23 Thread Scott Marlowe
On Mon, Aug 24, 2009 at 12:07 AM, Craig Ringer wrote: > On Mon, 2009-08-24 at 15:25 +1000, Kushal Vaghani wrote: >> 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 cont

Re: [GENERAL] How to simulate crashes of PostgreSQL?

2009-08-23 Thread Scott Marlowe
On Sat, Aug 22, 2009 at 4:55 PM, Greg Sabino Mullane wrote: > A server crash is a pretty rare event in the Postgres world, so I > would not spend too many cycles on this... I've been running pg in production since 7.0 came out. zero server crashes. -- Sent via pgsql-general mailing list (pgsql-

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

2009-08-23 Thread Craig Ringer
On Mon, 2009-08-24 at 15:25 +1000, Kushal Vaghani wrote: > 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. Why such an an

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 Backson 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 fieldB and fiel

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

2009-08-23 Thread Juan Backson
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 fieldB and fieldC is null, I want it to return fieldD. Basically, fieldD is always goi

[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 qu

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. I

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 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] 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 (http://www.sql-wor

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] 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] 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 t

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Tom Lane
Jeff Ross 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 vacuumlazy.c d

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Tom Lane wrote: Jeff Ross 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 an

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Tom Lane
Jeff Ross 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 adult beve

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 9:06 PM, Jeff Ross 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] 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 Jeff Ross
Tom Lane wrote: Greg Stark writes: On Sun, Aug 23, 2009 at 7:34 PM, Tom Lane 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 adds a tu

[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 detail.

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Greg Stark wrote: On Sun, Aug 23, 2009 at 5:37 PM, Jeff Ross 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 changes to your su

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Tom Lane
Greg Stark writes: > On Sun, Aug 23, 2009 at 7:34 PM, Tom Lane 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 adds a tuple). > Well it

[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 Greg Stark
On Sun, Aug 23, 2009 at 5:02 PM, Greg Stark wrote: > On Sun, Aug 23, 2009 at 2:18 PM, Jeff Ross 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 via pgsql-general mailing list

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 7:34 PM, Tom Lane wrote: > Greg Stark writes: >> On Sun, Aug 23, 2009 at 7:00 PM, Tom Lane 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 seque

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Tom Lane
Greg Stark writes: > On Sun, Aug 23, 2009 at 7:00 PM, Tom Lane 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 visibility > check for tuples on

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 7:00 PM, Tom Lane wrote: > Greg Stark 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,

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 i

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 empl

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Tom Lane
Greg Stark 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 HEAP_UPDATED on

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 6:23 PM, Greg Stark wrote: > On Sun, Aug 23, 2009 at 5:37 PM, Jeff Ross 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 understand why you're seeing the

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 su

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.

[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 manager

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 5:37 PM, Jeff Ross 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 your subscriptio

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Greg Stark wrote: On Sun, Aug 23, 2009 at 5:02 PM, Greg Stark wrote: On Sun, Aug 23, 2009 at 2:18 PM, Jeff Ross wrote: Incidentally, may as well ask the usual questions: And just for reference, what does pg_controldata print? _postgre...@heinlein:/var/postgresql $ pg_controldata

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Greg Stark wrote: On Sun, Aug 23, 2009 at 2:18 PM, Jeff Ross 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 Inci

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 2:18 PM, Jeff Ross 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 Incidentally, may as w

Re: [GENERAL] Strange "missing tables" problem

2009-08-23 Thread Tom Lane
Denis BUCHER 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". regards,

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 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 duri

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) >> > yo

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' tabl

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 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 | Nom

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Jeff Ross
Greg Stark wrote: On Sun, Aug 23, 2009 at 4:06 AM, Jeff Ross 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 xmin,xmax,ctid,oid,* from pg

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 | relh

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 pr

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 interac

[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] 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 tags i guess, and other garbage. If i do that, will i improve the speed of my search? What do you mean 'accurat