Re: [GENERAL] how to do this select?

2009-02-18 Thread Yi Zhao
ok, thanks, I will create a new message when I post next time. about my question, I think distinct can't solve my problem, because I want to get more than one rows. if there is more than (or equal) 2 (eg: 2, 3, 4, 100 ...)rows have the same value of column 'b' , I want to get only 2 rows. if less

Re: [GENERAL] how to do this select?

2009-02-18 Thread A. Kretschmer
In response to Yi Zhao : > thanks Ringer. > my mean is that: > I want less than 2 rows which have the same value of column "b"! > > for example, there is 3 columns have the same value "A", > X | A > X | A > Y | A > I want my result have two of them. I think, you are searching for DISTINCT: te

Re: [GENERAL] how to do this select?

2009-02-18 Thread Craig Ringer
Yi Zhao wrote: thanks Ringer. my mean is that: I want less than 2 rows which have the same value of column "b"! for example, there is 3 columns have the same value "A", X | A X | A Y | A I want my result have two of them. Less than two? ie just one? That's easy: test=# SELECT DISTINCT ON (

Re: [GENERAL] postgres wish list

2009-02-18 Thread Craig Ringer
Sameer Mahajan wrote: I recently worked on rewriting a fairly complex Berkeley DB based system using Postgres DB. Following is a wish list and a brief explanation for each of those items for postgres. It is not necessarily a comparison of postgres functionality with that of Berkeley DB but some

Re: [GENERAL] how to do this select?

2009-02-18 Thread A. Kretschmer
In response to Craig Ringer : > I don't understand what you want based on your description and your > example results. What do you mean by "if the column `b' have the same > value" ? Additionally, don't hijack other threads by answer to an old message and changing the subject. Your eMails contai

Re: [GENERAL] how to do this select?

2009-02-18 Thread Yi Zhao
thanks Ringer. my mean is that: I want less than 2 rows which have the same value of column "b"! for example, there is 3 columns have the same value "A", X | A X | A Y | A I want my result have two of them. thanks. On Thu, 2009-02-19 at 15:49 +0900, Craig Ringer wrote: > Yi Zhao wrote: > > >

Re: [GENERAL] how to do this select?

2009-02-18 Thread Craig Ringer
Yi Zhao wrote: I want to get the only 2 rows(limit or random) if the column "b" have the same value. so, the result of the above is a | b ---+--- X | A X | A D | B H | B P | C how to do that, thanks all! I don't understand what you want based on your description and your example results.

Re: [GENERAL] Removing a corrupt database by hand

2009-02-18 Thread Mike Christensen
I get this: C:\Program Files\PostgreSQL\8.3\data>..\bin\postgres.exe -d 5 -D . 2009-02-19 06:44:30 GMT DEBUG: postgres: PostmasterMain: initial environ dump: 2009-02-19 06:44:30 GMT DEBUG: - 2009-02-19 06:44:30 GMT DEBUG: ALLUSERSPROFILE=C:\Doc

[GENERAL] postgres wish list

2009-02-18 Thread Sameer Mahajan
I recently worked on rewriting a fairly complex Berkeley DB based system using Postgres DB. Following is a wish list and a brief explanation for each of those items for postgres. It is not necessarily a comparison of postgres functionality with that of Berkeley DB but some required useful function

[GENERAL] how to do this select?

2009-02-18 Thread Yi Zhao
hi, all, I have a table in postgresql which have 2 columns like this: a|b -- X A X A Y A D B H B E B D B P C when I do select and order by, I got this: a | b ---+--- X | A X | A Y | A D | B H | B | B D | B P | C I want to get the only 2 rows(limit or random) if the column "b" have

Re: [GENERAL] Removing a corrupt database by hand

2009-02-18 Thread Joshua D. Drake
On Wed, 2009-02-18 at 19:58 -0800, Mike Christensen wrote: > I have two questions actually.. > > First off, is there a way to remove a database if the postgres.exe > service won't start? It seems if I just delete the data\base\x > directory, then postgres will crash. Is there a way to drop

[GENERAL] Removing a corrupt database by hand

2009-02-18 Thread Mike Christensen
I have two questions actually.. First off, is there a way to remove a database if the postgres.exe service won't start? It seems if I just delete the data\base\x directory, then postgres will crash. Is there a way to drop a DB that prevents postgres.exe from starting? Second question,

[GENERAL] [ANN]VTD-XML 2.5

2009-02-18 Thread crackeur
VTD-XML 2.5 is now released. Please go to https://sourceforge.net/project/showfiles.php?group_id=110612&package_id... to download the latest version. Changes from Version 2.4 (2/2009) * Added separate VTD indexing generating and loading (see http://vtd-xml.sf.net/persistence.html for furth

Re: [GENERAL] Postgres service fails to start on Windows 2003

2009-02-18 Thread imaudi
Nope, the Postgres account is still in the "Users" group, I just changed the quota on that actual user account to have no limit.  Nothing else about the account has changed. >From what I can tell, the first time postgres attempts to start, it just hangs >and the postgres.exe process linger

Re: [GENERAL] Query palns and tug-of-war with enable_sort

2009-02-18 Thread Tom Lane
Glyn Astill writes: > Ah, retracing my steps forget that; there's no sort because it's not the same > query at all. OK, that explains why things didn't seem to add up. > Going back to my original point though, is there any way to get the planner > to choose a better plan for the original disti

Re: [GENERAL] Postgres service fails to start on Windows 2003

2009-02-18 Thread Tom Lane
Mike Christensen writes: > I'm having problems getting the PostgreSQL service to start. This > started happening after I changed a disk quota to allow for larger > database sizes, and no other configuration has changed. You moved the Postgres account to some other group, right? > 2009-02-18 1

Re: [GENERAL] Query palns and tug-of-war with enable_sort

2009-02-18 Thread Glyn Astill
> > No, those aren't the same plans. In particular > what's bothering me is > the lack of any sort in the first plan you showed (the one > with > HashAggregate at the top). That shouldn't be possible > because of the > ORDER BY --- a hash aggregate will deliver unsorted output > so there > shoul

Re: [GENERAL] Postgres service fails to start on Windows 2003

2009-02-18 Thread Mike Christensen
If it helps, I've tried running postgres.exe from the command prompt in debug mode and it just locks up after this: C:\Program Files\PostgreSQL\8.3\data>..\bin\postgres.exe -p 5432 -D . -d 5 2009-02-18 22:23:53 GMT DEBUG: postgres: PostmasterMain: initial environ dump: 2009-02-18 22:23:53 GMT

Re: [GENERAL] COPY questions

2009-02-18 Thread Adrian Klaver
On Wednesday 18 February 2009 2:00:19 pm Tony Caduto wrote: > Bill Todd wrote: > > Thanks for the suggestion but pgloader appears to be a Linux only > > solution and my environment is Windows. The other problem is that > > there is no documentation that I could find (other than a PDF made > > from

Re: [GENERAL] Appending \o output instead of overwriting the output file

2009-02-18 Thread Brent Wood
I'd be happy with either... >> is UNIX-ese for append, which is OK, & if anyone uses command line MSDOS/ >> command prompt, it does the same there. But if we are to follow this logic, >> the \o > file should overwrite/create, etc... which is perhaps a bit >> excessive. I think that having \o w

[GENERAL] Postgres service fails to start on Windows 2003

2009-02-18 Thread Mike Christensen
Hi All - I'm having problems getting the PostgreSQL service to start. This started happening after I changed a disk quota to allow for larger database sizes, and no other configuration has changed. Here's what is in the event log. I've tried rebooting several times, and deleting postmaster

[GENERAL] Service not starting during install

2009-02-18 Thread Frank Featherlight
Hey guys, (I am totally new to this kind of thing and have no idea how this works, please correct me if I do something wrong or stupid) I recently installed HoldEm Manager on two PC's, this program uses PostgreSQL and it worked fine on one computer, but on the other one it fails to start the servi

Re: [GENERAL] COPY questions

2009-02-18 Thread Tony Caduto
Bill Todd wrote: Thanks for the suggestion but pgloader appears to be a Linux only solution and my environment is Windows. The other problem is that there is no documentation that I could find (other than a PDF made from slides). Bill Bill, pgloader is a Python app, It should work on win32

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Mike Christensen
I just changed the account manually and did not set a disk quota.. However, now I have bigger problems since the service will not start up anymore. I tried re-booting twice. First I get: 2009-02-18 21:24:25 GMT FATAL: lock file "postmaster.pid" already exists 2009-02-18 21:24:25 GMT HINT:

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread John R Pierce
Mike Christensen wrote: Ooo good call, the account is part of the "Users" group which has a quota: The users will have the following disk quota: Disk space limited to 1024 MB Warning sent at 900 MB Which is the exact size of the database.. However, anyone have a clue on how to change t

Re: [GENERAL] Appending \o output instead of overwriting the output file

2009-02-18 Thread Tom Lane
John R Pierce writes: > Tom Lane wrote: >> "Brent Wood" writes: >>> Perhaps \o+ as a future fix for this? >> I'd prefer "\o >>file" but maybe I'm too steeped in unix-isms. > \o+ is reasonably consistent with the other \ command usages... Not really; none of the other commands interpret + as me

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
Aurimas Černius wrote on Wed, Feb 18, 2009 at 05:01:14PM +0200: > Did you use *exactly* the same command line to compile both versions? > What is that command line(s)? Yes, I used the same compilation command line for both versions: gcc -o pq_test -I"C:\Program Files\PostgreSQL\8.3\include" -L"

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Mike Christensen
Ooo good call, the account is part of the "Users" group which has a quota: The users will have the following disk quota: Disk space limited to 1024 MB Warning sent at 900 MB Which is the exact size of the database.. However, anyone have a clue on how to change this? This is Windows Serv

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Sam Mason
On Wed, Feb 18, 2009 at 12:39:50PM -0800, Mike Christensen wrote: > I'm doing some perf testing and need huge amounts of data. So I have a > program that is adding data to a few tables ranging from 500,000 to 15M > rows. I assume you're repeatedly inserting data and then deleting it? If so, PG

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Bill Moran
In response to Mike Christensen : > I have well over 50 gigs free on that drive.. I doubt it. I'm not aware of that error having false-positives associated with it. Common confusion on this point could result from having quotas enabled, or possibly you're running out of space, then when you che

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Scott Marlowe
On Wed, Feb 18, 2009 at 1:55 PM, Mike Christensen wrote: > I have well over 50 gigs free on that drive.. I doubt it. Quotas? Something's making the OS think the drive is full. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://ww

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Mark Roberts
On Wed, 2009-02-18 at 12:55 -0800, Mike Christensen wrote: > I have well over 50 gigs free on that drive.. I doubt it. Are you sure the pg data directory is on the drive you think it is? Are you doing alot of deletes or are you merely inserting? Are you doing any sorting and therefore running

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Alan Hodgson
On Wednesday 18 February 2009, Mike Christensen wrote: > > ERROR: could not extend relation 1663/41130/41177: No space left on > device HINT: Check free disk space. > It seems to me there's some sort of "max table size" before you have to > allocate more space on the disk, however I can't seem

Re: [GENERAL] Appending \o output instead of overwriting the output file

2009-02-18 Thread John R Pierce
Tom Lane wrote: "Brent Wood" writes: Perhaps \o+ as a future fix for this? I'd prefer "\o >>file" but maybe I'm too steeped in unix-isms. \o+ is reasonably consistent with the other \ command usages... -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To ma

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Tom Lane
Mike Christensen writes: > I'm doing some perf testing and need huge amounts of data. So I have a > program that is adding data to a few tables ranging from 500,000 to 15M > rows. The program is just a simply C# program that blasts data into the > DB, but after about 3M rows or so I get an er

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Mike Christensen
I have well over 50 gigs free on that drive.. I doubt it. Scott Marlowe wrote: On Wed, Feb 18, 2009 at 1:39 PM, Mike Christensen wrote: Hi all - ERROR: could not extend relation 1663/41130/41177: No space left on device HINT: Check free disk space. You're running out of disk space

Re: [GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Scott Marlowe
On Wed, Feb 18, 2009 at 1:39 PM, Mike Christensen wrote: > Hi all - > ERROR: could not extend relation 1663/41130/41177: No space left on device > HINT: Check free disk space. You're running out of disk space. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chang

Re: [GENERAL] COPY questions

2009-02-18 Thread Bill Todd
Adrian Klaver wrote: On Wednesday 18 February 2009 10:56:45 am Bill Todd wrote: If the COPY command fails does it identify the offending row? After reading the manual and the wiki I assume that there is no way to tell copy to start with the Nth record in the input file. Is that correct? It s

[GENERAL] When adding millions of rows at once, getting out of disk space errors

2009-02-18 Thread Mike Christensen
Hi all - I'm doing some perf testing and need huge amounts of data. So I have a program that is adding data to a few tables ranging from 500,000 to 15M rows. The program is just a simply C# program that blasts data into the DB, but after about 3M rows or so I get an errror: ERROR: could n

Re: [GENERAL] Appending \o output instead of overwriting the output file

2009-02-18 Thread Tom Lane
"Brent Wood" writes: > Perhaps \o+ as a future fix for this? I'd prefer "\o >>file" but maybe I'm too steeped in unix-isms. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresq

Re: [GENERAL] Debugging custom type libraries

2009-02-18 Thread Tom Lane
Martijn van Oosterhout writes: > First step, you must connect with psql and then attach gdb to the > running process (there's a function to get the pid of your backend). > Next, you can use "LOAD foo" in psql to trigger the loading of your > module, gdb should then be able to see it (assuming you

Re: [GENERAL] COPY questions

2009-02-18 Thread Adrian Klaver
On Wednesday 18 February 2009 10:56:45 am Bill Todd wrote: > If the COPY command fails does it identify the offending row? > > After reading the manual and the wiki I assume that there is no way to > tell copy to start with the Nth record in the input file. Is that > correct? It seems like such an

Re: [GENERAL] Appending \o output instead of overwriting the output file

2009-02-18 Thread Brent Wood
Thanks Tom, That will do trick. Perhaps \o+ as a future fix for this? Brent Brent Wood DBA/GIS consultant NIWA, Wellington New Zealand >>> Tom Lane 02/18/09 7:46 PM >>> "Brent Wood" writes: > Using \o to redirect output to a file from the psql command line, is there > any way to have the ou

Re: [GENERAL] COPY questions

2009-02-18 Thread Jeff Davis
On Wed, 2009-02-18 at 11:56 -0700, Bill Todd wrote: > If the COPY command fails does it identify the offending row? Yes, it tries to identify the failing row in the error message. > After reading the manual and the wiki I assume that there is no way to > tell copy to start with the Nth record in

Re: [GENERAL] Debugging custom type libraries

2009-02-18 Thread Martijn van Oosterhout
On Wed, Feb 18, 2009 at 06:05:43PM +, Will Harrower wrote: > I'm writing a custom type, with the associated functions (type_in, > type_out, etc) written in C, in an external shared library that Postgres > loads at runtime. I was wondering what the best way of debugging these > functions is..

[GENERAL] COPY questions

2009-02-18 Thread Bill Todd
If the COPY command fails does it identify the offending row? After reading the manual and the wiki I assume that there is no way to tell copy to start with the Nth record in the input file. Is that correct? It seems like such an obvious feature I was surprised not to find it. Thanks. Bill

[GENERAL] Debugging custom type libraries

2009-02-18 Thread Will Harrower
Hi, I'm writing a custom type, with the associated functions (type_in, type_out, etc) written in C, in an external shared library that Postgres loads at runtime. I was wondering what the best way of debugging these functions is... I can start postgres through gdb, but can't figure out how to

Re: [GENERAL] leak in libpq, getpwuid

2009-02-18 Thread Grzegorz Jaśkiewicz
On Wed, Feb 18, 2009 at 5:47 PM, Tom Lane wrote: > =?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= writes: >> same thing on debian, well - almost: > >> ==8261==at 0x4023D6E: malloc (vg_replace_malloc.c:207) >> ==8261==by 0x43B1930: (within /lib/i686/cmov/libc-2.7.so) >> ==8261==by 0x43B222B: __n

Re: [GENERAL] Query palns and tug-of-war with enable_sort

2009-02-18 Thread Tom Lane
Glyn Astill writes: > I've slapped together a quick test case that gives the same results > with explain even when I have no data in the tables and haven't > analyzed them. No, those aren't the same plans. In particular what's bothering me is the lack of any sort in the first plan you showed (th

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
> How do you run the program, in console or by double clicking on > executable. Try the second. Does the console window apear on the screen? Aha! This tip has led to the solution. I had been running the program from an emacs shell buffer. If I run it from the Windows console or by double-clickin

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Mikko Partio
On Wed, Feb 18, 2009 at 4:47 PM, Joey Morris wrote: > This is my first attempt at using libpq, and I'm running across a strange > problem. Here is my bare-bones program: > > #include > #include "libpq-fe.h" > > int main(int argc, char **argv) { > PGconn *conn; > fprintf(stderr, "connecting\n")

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Sam Mason
On Wed, Feb 18, 2009 at 06:08:07PM +0200, Aurimas Cernius wrote: > Joey Morris wrote: > > gcc -o pq_test -I"C:\Program Files\PostgreSQL\8.3\include" -L"C:\Program > > Files\PostgreSQL\8.3\lib" -lpq pq_test.c gcc won't give many warnings unless you give it a -Wall flag; it may be doing strange thi

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
David Wilson wrote on Wed, Feb 18, 2009 at 11:36:44AM -0500: > Try adding "fflush(stderr);" after your fprintf() call. If the > connection is hanging and output hasn't been flushed, you wouldn't see > much. No, this doesn't help, either. Thanks for the suggestion. -- Sent via pgsql-general mai

Re: [GENERAL] leak in libpq, getpwuid

2009-02-18 Thread Tom Lane
=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= writes: > same thing on debian, well - almost: > ==8261==at 0x4023D6E: malloc (vg_replace_malloc.c:207) > ==8261==by 0x43B1930: (within /lib/i686/cmov/libc-2.7.so) > ==8261==by 0x43B222B: __nss_database_lookup (in > /lib/i686/cmov/libc-2.7.so) > =

Re: [GENERAL] Query palns and tug-of-war with enable_sort

2009-02-18 Thread Glyn Astill
> > Group (cost=0.00..11149194.48 rows=1 width=9) > > That's just bizarre. Can you put together a > self-contained test case > for this? Also, what version is it exactly? > ("8.3" is the wrong > answer.) > Thanks Tom, It's 8.3.5, and I get the same results on all my servers (3 replicated

Re: [GENERAL] Two-phase commmit, plpgsql and plproxy

2009-02-18 Thread Mark Roberts
On Thu, 2009-02-12 at 02:17 +0300, Igor Katson wrote: > > Thanks, Jeff. Googling smth like "postgresql transaction manager" > does > not give any nice result. It seems, that the one just does not exist. > Hope, plproxy developers will answer smth. considering this problem. I wrote my own "tran

Re: [GENERAL] Mammoth replicator

2009-02-18 Thread Joshua D. Drake
On Wed, 2009-02-18 at 13:55 -0200, Martín Marqués wrote: > I was working on a replication system (open source) for a DB we are > using and I was going to go for Slony-I for replication and pg_pool2 > for load balancing. > > Just yeasterday I found out the Mammoth replicator was released as > Open

Re: [GENERAL] [Plproxy-users] Two-phase commmit, plpgsql and plproxy

2009-02-18 Thread Marko Kreen
On 2/11/09, Igor Katson wrote: > I would like to call several plproxy functions one after another (which > will call plpgsql functions in different target partitions), and in case > one of them fails, i want to roll back changes in every one. > > That is exactly how two-phase-commit (2PC) shoul

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread David Wilson
On Wed, Feb 18, 2009 at 9:47 AM, Joey Morris wrote: > I expected this program to print "connecting", but in fact I get no output > whatsoever. If I comment out the PQconnectdb and PQfinish lines, I see > "connecting" as expected. What could be going on here? Try adding "fflush(stderr);" after yo

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Aurimas Černius
Hi, Aurimas Černius wrote on Wed, Feb 18, 2009 at 06:08:07PM +0200: Libraries should be places after the source file, that is (not sure about -L, but for -l surely): gcc -o pq_test -I"C:\Program Files\PostgreSQL\8.3\include" pq_test.c -L"C:\Program Files\PostgreSQL\8.3\lib" -lpq I don't if

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
Aurimas Černius wrote on Wed, Feb 18, 2009 at 06:08:07PM +0200: > Libraries should be places after the source file, that is (not sure > about -L, but for -l surely): > > gcc -o pq_test -I"C:\Program Files\PostgreSQL\8.3\include" pq_test.c > -L"C:\Program Files\PostgreSQL\8.3\lib" -lpq > > I d

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Aurimas Černius
Hi, Looks like you accidently wrote to me personnally, not to mailing list. On Wed, Feb 18, 2009 at 10:01 AM, Aurimas Černius wrote: Did you use *exactly* the same command line to compile both versions? What is that command line(s)? Yes, I used the same compilation command line for both ver

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
Lennin Caro wrote on Wed, Feb 18, 2009 at 06:53:32AM -0800: > try > fprintf(stdout,"Connection \n"); > printf("Connection \n"); Thanks, but both produce the same behavior as fprintf(stderr, "Connection \n"): It prints when the PQconnectdb and PQfinish lines are commented out but not when they a

Re: [GENERAL] Mammoth replicator

2009-02-18 Thread Andrei Kovalevski
Hello Martin, You can use this mailing list https://lists.commandprompt.com/mailman/listinfo/replicator-general to ask replicator-related questions. And there is the wiki for Mammoth Replicator - https://projects.commandprompt.com/public/replicator. Martín Marqués wrote: I was working on a

Re: [GENERAL] Large object loading stalls

2009-02-18 Thread Michael Akinde
Hej, I killed the test about an hour ago to eliminate the free space stuff as an issue. I've started the process up again, so if (when) the test hangs again, I'll try to get the stack trace. Regards, Michael Akinde Tom Lane wrote: Michael Akinde writes: We have been running into a stra

[GENERAL] Mammoth replicator

2009-02-18 Thread Martín Marqués
I was working on a replication system (open source) for a DB we are using and I was going to go for Slony-I for replication and pg_pool2 for load balancing. Just yeasterday I found out the Mammoth replicator was released as Open Source, and AFAICS it looks more suitable for our needs then Slony-I

Re: [GENERAL] Large object loading stalls

2009-02-18 Thread Tom Lane
Michael Akinde writes: > We have been running into a strange problem on our production servers of > a system we are about to roll out with the loading of large objects. Hmm, can you attach to the stuck backend and the vacuum worker process with gdb and get stack traces from them? The pg_locks v

[GENERAL] Mammoth replicator

2009-02-18 Thread Martín Marqués
I was working on a replication system (open source) for a DB we are using and I was going to go for Slony-I for replication and pg_pool2 for load balancing. Just yeasterday I found out the Mammoth replicator was released as Open Source, and AFAICS it looks more suitable for our needs then Slony-I

Re: [GENERAL] Query palns and tug-of-war with enable_sort

2009-02-18 Thread Tom Lane
Glyn Astill writes: > With enable_sort on this is the plan it chooses: > HashAggregate (cost=14.72..14.73 rows=1 width=9) >-> Nested Loop (cost=0.00..14.72 rows=1 width=9) > -> Index Scan using credit_index02 on credit (cost=0.00..7.04 > rows=1 width=9) >Index

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Aurimas Černius
Hi, This is my first attempt at using libpq, and I'm running across a strange problem. Here is my bare-bones program: #include #include "libpq-fe.h" int main(int argc, char **argv) { PGconn *conn; fprintf(stderr, "connecting\n"); conn = PQconnectdb("dbname=postgres"); PQfinish(con

Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Lennin Caro
> This is my first attempt at using libpq, and I'm running > across a strange > problem. Here is my bare-bones program: > > #include > #include "libpq-fe.h" > > int main(int argc, char **argv) { > PGconn *conn; > fprintf(stderr, "connecting\n"); > conn = PQconnectdb("dbname=postgres"); >

[GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
This is my first attempt at using libpq, and I'm running across a strange problem. Here is my bare-bones program: #include #include "libpq-fe.h" int main(int argc, char **argv) { PGconn *conn; fprintf(stderr, "connecting\n"); conn = PQconnectdb("dbname=postgres"); PQfinish(conn); retur

Re: [GENERAL] leak in libpq, getpwuid

2009-02-18 Thread Grzegorz Jaśkiewicz
On Tue, Feb 17, 2009 at 4:03 PM, Tom Lane wrote: > =?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= writes: >> oh, and note that I kind of rulled out linux libc/distro problem, same >> happens on both centos 4.7 and fedora 9. > > That hardly constitutes a wide sample of linux distros ... > same thing on deb

[GENERAL] Query palns and tug-of-war with enable_sort

2009-02-18 Thread Glyn Astill
Hi Chaps, We have a legacy application that used to have it's own sequential database backend, and to fetch data out of it's tables commands such as "find gt table by index" would be used. What we have now is a driver in the middle that constructs sql to access the data on pg8.3, typically of

[GENERAL] Large object loading stalls

2009-02-18 Thread Michael Akinde
Hi, We have been running into a strange problem on our production servers of a system we are about to roll out with the loading of large objects. At various times (usually separated by a few days), the loading process against the server will suddenly either take an extremely long time (going

Re: [GENERAL] transfering tables into other schema

2009-02-18 Thread Sam Mason
On Wed, Feb 18, 2009 at 10:44:27AM +0100, Ivan Sergio Borgonovo wrote: > It looks like I may put myself in a situation where I may get > trapped by insidious bugs related to the order in which the schema > path is read. > > I think I prefer to spend some time qualifying the schema in the > functio

Re: [GENERAL] Download link for 'Bristlecone'

2009-02-18 Thread Gerd König
Hello Abdul, I also think you could start Bristlecone under Windows since it is Java based (but never tested it). On the page I sent to you, there's a link for downloading bristlecone. Just scroll down and you'll find a section "downloads", or use this one: https://forge.continuent.org/frs/?group_

Re: [GENERAL] Download link for 'Bristlecone'

2009-02-18 Thread Richard Huxton
Abdul Rahman wrote: > Thanks Huxton & Gerd; > > I think pgbench is not suitable for those who want to test > application on desired tables. pgbench is highly hard coded and tests > only self generated tables. That is true. > I used Mercury LoadRunner but it is not > freeware. The link http://br

Re: [GENERAL] Download link for 'Bristlecone'

2009-02-18 Thread Abdul Rahman
Thanks Huxton & Gerd; I think pgbench is not suitable for those who want to test application on desired tables. pgbench is highly hard coded and tests only self generated tables. I used Mercury LoadRunner but it is not freeware. The link http://bristlecone.continuent.org/HomePage only has detai

Re: [GENERAL] Strange Grant behavior in postgres 8.3

2009-02-18 Thread Schwaighofer Clemens
On Wed, Feb 18, 2009 at 17:42, Scott Marlowe wrote: > On Tue, Feb 17, 2009 at 9:20 PM, Clemens Schwaighofer > wrote: > >> But yesterday I run in some issues with table ownership and thought if I >> just give the user all rights for the DB, he should have all rights to >> the tables too. > > Try g

Re: [GENERAL] could not write block

2009-02-18 Thread Richard Huxton
Kopljan Michael wrote: > OS : Windows Server 2003 > PostgreSQL : 8.2.4 The current release of 8.2 is 8.2.12 - you are missing 12 separate sets of bug-fixes! You might want to read the release notes for 8.2.12 back to 8.2.5 http://www.postgresql.org/docs/8.2/static/release-8-2-12.html Normally yo

Re: [GENERAL] transfering tables into other schema

2009-02-18 Thread Ivan Sergio Borgonovo
On Tue, 17 Feb 2009 22:11:03 -0700 Scott Marlowe wrote: > This is incorrect. As long as both tables are in your search path > it will work just fine. But you do have to re-connect to flush > your cached plans for the functions. That was the missing part. It seems the trick is going to be the s

Re: [GENERAL] could not write block

2009-02-18 Thread Kopljan Michael
remember to check your backups first!). -- Richard Huxton Archonet Ltd __ Information from ESET Smart Security, version of virus signature database 3863 (20090218) __ The message was checked by ESET Smart Security. http://www.eset.com __ Information from ESET Smart Security, vers

Re: [GENERAL] could not write block

2009-02-18 Thread Richard Huxton
Kopljan Michael wrote: > recently appears to me the following error : *ALWAYS* with this sort of thing you need to supply the following information: 1. Operating system 2. Version of PostgreSQL 3. How you installed it (compiled from source, windows installer, ubuntu package etc). Oh - and if you

Re: [GENERAL] Download link for 'Bristlecone'

2009-02-18 Thread Gerd König
Hello, Bristlecone is a tool from continuent and can be downloaded here: http://bristlecone.continuent.org/HomePage regards--GERD-- Abdul Rahman schrieb: > Dear All, > > I searched a lot but failed to find any download link for Bristlecone. Kindly > help me. Or let me know about any open sourc

Re: [GENERAL] Download link for 'Bristlecone'

2009-02-18 Thread Richard Huxton
Abdul Rahman wrote: > Dear All, > > I searched a lot but failed to find any download link for Bristlecone. Kindly > help me. Or let me know about any open source Load Tester for PostgreSQL > based application. > Ashish, according to my search Bristlecone is open source. Thanks in advance. Sorr

Re: [GENERAL] Strange Grant behavior in postgres 8.3

2009-02-18 Thread Scott Marlowe
On Tue, Feb 17, 2009 at 9:20 PM, Clemens Schwaighofer wrote: > But yesterday I run in some issues with table ownership and thought if I > just give the user all rights for the DB, he should have all rights to > the tables too. Try granting select on a database and you will get this: grant selec

Re: [GENERAL] Strange Grant behavior in postgres 8.3

2009-02-18 Thread Albe Laurenz
John R Pierce wrote: > that is correct. DATABASE privileges relate to connecting to the > database, permissions to create objects and so forth. To be precise, there are 3 privileges: - create temporary tables - connect to the database - create schemata To be allowed to create a table, you need