Re: [GENERAL] Random Deadlock on DROP CONSTRAINT

2009-03-09 Thread Mark Mandel
Final words - If you use PostGres and Hibernate, * everything * has to be in a transaction, ALWAYS. That and remember to close your sessions. Thanks for listening to my rambling. Mark On Mon, Mar 9, 2009 at 10:31 AM, Mark Mandel mark.man...@gmail.com wrote: Well, there was an issue there, in

Re: [GENERAL] Date/time of last commit

2009-03-09 Thread Richard Huxton
Tom Spencer wrote: I need to compare the age of some data files against the age (i.e. time of last commit) of the database. If the data files are newer then the database needs to be rebuilt. I can kludge together a solution but by far the cleanest solution would be to just ask what time

[GENERAL] Matching dimensions in arrays

2009-03-09 Thread Scara Maccai
I've altready asked this some months ago, but I've never seen any answers: why do multidimensional arrays have to have matching extents for each dimension? Is there any way this limit can be removed, even using a custom datatype? __ Do You

[GENERAL] commit/rollback in postgre 8.2

2009-03-09 Thread IPS
Is it possible to use begin, commit and rollback commands within a transaction block in SQL function in postgre ver 8.2 with regards, I.P.S. Sethi

[GENERAL] Problem with encoding conversions

2009-03-09 Thread Kaloyan Iliev
Hi All, I try to migrate a database from WIN1251 to UTF8 but I have a problem dumping from WIN1251 to UTF8. pg_dump -C -E 'UTF8' a a_utf8.sql pg_dump: SQL command failed pg_dump: Error message from server: ERROR: could not load library /usr/local/lib/postgresql/utf8_and_cyrillic.so: dlopen

Re: [GENERAL] Problem with encoding conversions

2009-03-09 Thread Kaloyan Iliev
Sorry for the noise. The problem is solved with the restart of the postgresql server. Have a nice day. Kaloyan Iliev Kaloyan Iliev wrote: Hi All, I try to migrate a database from WIN1251 to UTF8 but I have a problem dumping from WIN1251 to UTF8. pg_dump -C -E 'UTF8' a a_utf8.sql pg_dump:

Re: [GENERAL] commit/rollback in postgre 8.2

2009-03-09 Thread Ashish Karalkar
IPS wrote: Is it possible to use begin, commit and rollback commands within a transaction block in SQL function in postgre ver 8.2 with regards, I.P.S. Sethi I guess you can use nested blocks in side a function(BEGIN,END) but not commit because a SQL function runs as a single

Re: [GENERAL] Performance of subselects

2009-03-09 Thread Grzegorz Jaśkiewicz
2009/3/9 Christian Schröder c...@deriva.de: I understand why this is advisable; however, something inside me hates the idea to put this kind of database specific stuff inside an application. How about portability? Why does the application developer have to know about database internals? He

Re: [GENERAL] commit/rollback in postgre 8.2

2009-03-09 Thread Raymond O'Donnell
On 09/03/2009 10:34, Ashish Karalkar wrote: IPS wrote: Is it possible to use begin, commit and rollback commands within a transaction block in SQL function in postgre ver 8.2 I guess you can use nested blocks in side a function(BEGIN,END) but not commit because a SQL function runs as a

Re: [GENERAL] commit/rollback in postgre 8.2

2009-03-09 Thread Grzegorz Jaśkiewicz
On Mon, Mar 9, 2009 at 8:25 AM, IPS se...@nic.in wrote:  Is it possible to use begin, commit and rollback commands within a transaction block in  SQL function in postgre ver 8.2 if you want to break plpgsql function, use exceptions. That will cause transaction (which in it self is the whole

Re: [GENERAL] Performance of subselects

2009-03-09 Thread Christian Schröder
Scott Marlowe wrote: you can run out of memory if too many connections try to use too much of it at the same time, that's why it is advisable to set work_mem per connection/query, should the connection/query require more. Definitely. I understand why this is advisable; however,

Re: [GENERAL] Performance of subselects

2009-03-09 Thread Scott Marlowe
2009/3/9 Christian Schröder c...@deriva.de: Scott Marlowe wrote: you can run out of memory if too many connections try to use too much of it at the same time, that's why it is advisable to set work_mem per connection/query, should the connection/query require more. Definitely. I

Re: [GENERAL] Performance of subselects

2009-03-09 Thread Thom Brown
2009/3/6 Christian Schröder c...@deriva.de Hi list, if I want to find all records from a table that don't have a matching record in another table there are at least two ways to do it: Using a left outer join or using a subselect. I always thought that the planner would create identical plans

[GENERAL] recovering databases in tablespace (lost main database)

2009-03-09 Thread Joe Steeve
Hello all, Accidentally, I deleted the main-database. However, the tablespace that contains the actual data is fine. All the databases that I need are in the table-space. Is there any way to recover these databases? Thanking you, Joe -- Joe Steeve HiPro IT Solutions Pvt. Ltd.

Re: [GENERAL] Performance of subselects

2009-03-09 Thread David Fetter
On Mon, Mar 09, 2009 at 11:45:38AM +0100, Christian Schröder wrote: Scott Marlowe wrote: you can run out of memory if too many connections try to use too much of it at the same time, that's why it is advisable to set work_mem per connection/query, should the connection/query require more.

Re: [GENERAL] mdf

2009-03-09 Thread Ary Pezo Silvano
hi, thank you for your comments. my problem is that the mdf file has been sent to me by email in a zip file. i extracted the file and it is 8 GB. i don't know how i should import or open it with postgres. best, ary Från: John R Pierce

Re: [GENERAL] mdf

2009-03-09 Thread justin
There are a couple of tools that will open an MDF file buy you have to pay for them http://www.sqldatabaserepair.com/ http://www.mssqldatabaserecovery.com/ Another option is you need to learn how the MSSQL server is setup, and what version. Get your hands on that Version of SQL install it

[GENERAL] Sequences change in a rolled-back transactions

2009-03-09 Thread Erwin Moller
Hi group, I just noticed getting the next number of a sequence doesn't respect a transaction. Here is an example: === erwin=# SELECT nextval('tblofferlabel_offerlabelid_seq'::regclass) as nextofferlabelid; nextofferlabelid

Re: [GENERAL] Sequences change in a rolled-back transactions

2009-03-09 Thread Alvaro Herrera
Erwin Moller wrote: I thought a transaction that is rolled back, rolls back *everything* done in that transaction. Appearantly sequences are not included. Yes. This is actually a desirable property, because it allows sequences to work fine in concurrent scenarios (which are, after all, the

Re: [GENERAL] Sequences change in a rolled-back transactions

2009-03-09 Thread Erwin Moller
Alvaro Herrera schreef: Erwin Moller wrote: I thought a transaction that is rolled back, rolls back *everything* done in that transaction. Appearantly sequences are not included. Hi Alvaro, Thanks for your reply. Yes. This is actually a desirable property, because it allows

Re: [GENERAL] open up firewall from anywhere to postgres ports?

2009-03-09 Thread Lew
Adrian Klaver wrote: but if you don't allow access to ports 5432 and 5433 in the firewall the packets will never get to the point that the rules in pg_hba.conf apply. Willy-Bas Loos wrote: Adrian, i [sic] was talking about opening up the firewall for the world to my postgres ports, instead

Re: [GENERAL] Sequences change in a rolled-back transactions

2009-03-09 Thread Craig Ringer
Alvaro Herrera wrote: Erwin Moller wrote: I thought a transaction that is rolled back, rolls back *everything* done in that transaction. Appearantly sequences are not included. Yes. This is actually a desirable property, because it allows sequences to work fine in concurrent scenarios

[GENERAL] Get IP addresses from tsvectors

2009-03-09 Thread Justin Funk
Greetings, I have a table with a column with type tsvector. It contains the result of to_tsvector() of varchar field in the table. What I'd like to do is be able to search through the table and find all of the distinct IP addresses. Any idea how to turn: SELECT message_index_col FROM

[GENERAL] C++ User-defined functions

2009-03-09 Thread George Oakman
Dear all, I am trying to write a user-defined function in C++. Most examples are give in plain C. I would be very grafeful for a sample program/code-snippet in C++. Thank you very much, George. _ View your Twitter

Re: [GENERAL] C++ User-defined functions

2009-03-09 Thread Craig Ringer
George Oakman wrote: I am trying to write a user-defined function in C++. Most examples are give in plain C. I would be very grafeful for a sample program/code-snippet in C++. It's just like any other C/C++ code mixing. You must make sure that any C-only headers are included within an `extern

[GENERAL] PostgreSQL Memory Management

2009-03-09 Thread Umar Farooq
Hi All, I have a few general question about PGSQL's internals of memory management and I think this list is appropriate for that. I am interested to find out: (1) how does PostgreSQL internally use physical memory allocated to it? (2) what are different type of allocation units? (3) what is a

[GENERAL] in role, ownership and permissions was: grant everything on everything and then revoke

2009-03-09 Thread Ivan Sergio Borgonovo
On Tue, 03 Mar 2009 09:29:17 -0800 John R Pierce pie...@hogranch.com wrote: Ivan Sergio Borgonovo wrote: I'd like to have different users mainly to have a different search schema path. Things may evolve so this is not going to be the only reason to have more than one user. But I'm

Re: [GENERAL] C++ User-defined functions

2009-03-09 Thread Tom Lane
Craig Ringer cr...@postnewspapers.com.au writes: There's lots more information about this on the Internet. Just look for generic resources on calling C from C++ and vice versa. (I don't *think* there are any issues with libstdc++, though you'd probably have to make sure that no other program

Re: [GENERAL] C++ User-defined functions

2009-03-09 Thread George Oakman
Thanks Craig, I'm trying to compile a very simple test with Visual Studio (2008), but I get the following errors: c:\program files\postgresql\8.3\include\server\pg_config_os.h(188) : error C2011: 'timezone' : 'struct' type redefinition c:\program

Re: [GENERAL] C++ User-defined functions

2009-03-09 Thread Magnus Hagander
George Oakman wrote: Thanks Craig, I'm trying to compile a very simple test with Visual Studio (2008), but I get the following errors: The PostgreSQL backend and header files are not compatible with Visual Studio 2008. At least they're not tested wit hit. You need to try Visual Studio

[GENERAL] 8.4 – Where, when, what...

2009-03-09 Thread dobomode
Hello all, Our team is looking forward to some of the new features in 8.4 and would like to get access to the current beta for development / testing purposes. Where: What is the best way to get a copy of the 8.4 beta? I've searched around, but couldn't find a reliable direction on this subject.

[GENERAL] Error Connection refused (0x0000274D/10061)

2009-03-09 Thread Dante Ariel C.
hola he estado tratando de solucionar este problema: Luego de tratar de testear la base de datos con este comando: C:\PostgreSQL\8.3\binpsql -d testdb -U postgres Me sale este error psql: no se pudo conectar con el servidor: Connection refused (0x274D/10061) ¿Está el servidor en

Re: [GENERAL] Error Connection refused (0x0000274D/10061)

2009-03-09 Thread Adrian Klaver
On Monday 09 March 2009 12:37:10 pm Dante Ariel C. wrote: hola he estado tratando de solucionar este problema: Luego de tratar de testear la base de datos con este comando: C:\PostgreSQL\8.3\binpsql -d testdb -U postgres Me sale este error psql: no se pudo conectar con el servidor:

[GENERAL] intermittant performance problem

2009-03-09 Thread Mike Charnoky
Hello, I'm looking for some insight on an intermittent PostgreSQL performance problem that has been very troublesome. Using PG 8.3.5 on a server running CentOS 5 2.6.18-8.el5 (Dual Xeon 2.00 GHz, 4 GB RAM, RAID-10 SCSI 600GB array). The problem in a nutshell is this: on some days, a nightly

[GENERAL] Bundling PostgreSQL with an application

2009-03-09 Thread Paul Vercellotti
Hi there, I hope this hasn't been covered in FAQ's; I couldn't find it specifically mentioned. So we'd like to build a single-user application that uses PostgreSQL as a database back end because of so many of the unique things that it offers: customizable index formats (GIST - it's going

Re: [GENERAL] Bundling PostgreSQL with an application

2009-03-09 Thread Scott Marlowe
On Mon, Mar 9, 2009 at 2:55 PM, Paul Vercellotti pverce...@yahoo.com wrote: Hi there, I hope this hasn't been covered in FAQ's; I couldn't find it specifically mentioned.   So we'd like to build a single-user application that uses PostgreSQL as a database back end because of so many of the

Re: [GENERAL] Bundling PostgreSQL with an application

2009-03-09 Thread Grant Allen
Scott Marlowe wrote: On Mon, Mar 9, 2009 at 2:55 PM, Paul Vercellotti pverce...@yahoo.com wrote: Hi there, I hope this hasn't been covered in FAQ's; I couldn't find it specifically mentioned. So we'd like to build a single-user application that uses PostgreSQL as a database back end because

[GENERAL] postgresql and LDAP

2009-03-09 Thread JP Fletcher
Hi, I've just compiled 8.3.6 with ldap support yet I get 'FATAL: missing or erroneous pg_hba.conf file' when I try to connect. There weren't any errors during the compile, and ldd shows LDAP: postg...@schema-mgmt:/opt/pgdata/log/pgsql83$ ldd /opt/dbs/pgsql83/bin/postmaster | grep ldap

Re: [GENERAL] intermittant performance problem

2009-03-09 Thread Scott Marlowe
On Mon, Mar 9, 2009 at 1:55 PM, Mike Charnoky n...@nextbus.com wrote: Hello, I'm looking for some insight on an intermittent PostgreSQL performance problem that has been very troublesome.  Using PG 8.3.5 on a server running CentOS 5 2.6.18-8.el5 (Dual Xeon 2.00 GHz, 4 GB RAM, RAID-10 SCSI

[GENERAL] Connection Refused Error

2009-03-09 Thread JohnD
Hi, I have two identical servers running CentOS 5.2 with PostgreSQL 8.3.5 installed on both. Prior to a reboot this morning, I was able to connect, remotely, to both of them and doing telnet serve-rname 5432 brought up a prompt for them as well. However, I am now in the unfortunate

Re: [GENERAL] Connection Refused Error

2009-03-09 Thread Tom Lane
JohnD li...@johndubchak.com writes: I can ssh into the server and do a psql db-name from the /var/lib/pgsql command prompt, as user postgres. But, when I try to use a different user (psql -U user -p db-name), from the same prompt, I get: psql: could not connect to server: No such file or

Re: [GENERAL] Connection Refused Error

2009-03-09 Thread Adrian Klaver
On Monday 09 March 2009 4:11:49 pm JohnD wrote: Hi, I have two identical servers running CentOS 5.2 with PostgreSQL 8.3.5 installed on both. Prior to a reboot this morning, I was able to connect, remotely, to both of them and doing telnet serve-rname 5432 brought up a prompt for them as

Re: [GENERAL] postgresql and LDAP

2009-03-09 Thread Tom Lane
JP Fletcher jpfle...@ca.afilias.info writes: I've just compiled 8.3.6 with ldap support yet I get 'FATAL: missing or erroneous pg_hba.conf file' when I try to connect. Can't help you much when you don't show us the pg_hba.conf file ;-) However, a tip that might help is that there should be

Re: [GENERAL] Connection Refused Error

2009-03-09 Thread Joshua D. Drake
On Mon, 2009-03-09 at 18:11 -0500, JohnD wrote: Hi, Any idea why I am no longer able to connect? What does your listen_addresses say on the affected server? Also just to be safe do a /sbin/iptables -L and make sure you aren't blocking. Joshua D. Drake Thanks for any and all help. John

Re: [GENERAL] intermittant performance problem

2009-03-09 Thread Tom Lane
Mike Charnoky n...@nextbus.com writes: The sampling query which runs really slow on some days looks something like this: INSERT INTO sampled_data (item_name, timestmp, ... ) SELECT item_name, timestmp, ... ) FROM raw_data WHERE timestmp = ? and timestmp ? AND item_name=?

Re: [GENERAL] Connection Refused Error

2009-03-09 Thread JohnD
Joshua D. Drake wrote: What does your listen_addresses say on the affected server? Also just to be safe do a /sbin/iptables -L and make sure you aren't blocking. Joshua, Thank you so much - that was it. My postgresql.conf listen_addresses was commented out which defaulted to 'localhost'.

Re: [GENERAL] Connection Refused Error

2009-03-09 Thread Joshua D. Drake
On Mon, 2009-03-09 at 19:09 -0500, JohnD wrote: Joshua D. Drake wrote: What does your listen_addresses say on the affected server? Also just to be safe do a /sbin/iptables -L and make sure you aren't blocking. Joshua, Thank you so much - that was it. My postgresql.conf

Re: [GENERAL] intermittant performance problem

2009-03-09 Thread Mike Charnoky
Yeah, I wish I didn't have to resort to using ORDER BY RANDOM(). I really wanted to use something like TABLESAMPLE, but that is not implemented in PostgreSQL. Unfortunately, I cannot use use the random sampling technique you mentioned, since I need to select samples across various strata of

Re: [GENERAL] intermittant performance problem

2009-03-09 Thread Mike Charnoky
The random sampling query is normally pretty snappy. It usually takes on the order of 1 second to sample a few thousand rows of data out of a few million. The sampling is consistently quick, too. However, on some days, the sampling starts off quick, then when the process starts sampling

Re: [GENERAL] C++ User-defined functions

2009-03-09 Thread Craig Ringer
Tom Lane wrote: One thing you've got to be really wary of is C++ exceptions, which tend not to interoperate nicely with PG's longjmp-based error handling. Hmm, that does sound problematic. You can always build with -fno-exceptions (gcc; I think other compilers offer related options) and adopt

Re: [GENERAL] C++ User-defined functions

2009-03-09 Thread Craig Ringer
Magnus Hagander wrote: George Oakman wrote: Thanks Craig, I'm trying to compile a very simple test with Visual Studio (2008), but I get the following errors: The PostgreSQL backend and header files are not compatible with Visual Studio 2008. At least they're not tested wit hit. You

Re: [GENERAL] C++ User-defined functions

2009-03-09 Thread Tom Lane
Craig Ringer cr...@postnewspapers.com.au writes: Tom Lane wrote: One thing you've got to be really wary of is C++ exceptions, which tend not to interoperate nicely with PG's longjmp-based error handling. Hmm, that does sound problematic. You can always build with -fno-exceptions (gcc; I

Re: [GENERAL] intermittant performance problem

2009-03-09 Thread Scott Marlowe
On Mon, Mar 9, 2009 at 8:21 PM, Mike Charnoky n...@nextbus.com wrote: The random sampling query is normally pretty snappy.  It usually takes on the order of 1 second to sample a few thousand rows of data out of a few million.  The sampling is consistently quick, too.  However, on some days,

[GENERAL] 8.3.6 build error on Debian Lenny

2009-03-09 Thread Josh Trutwin
Hi - I'm trying to build 8.3.6 on a box recently upgraded from Sarge to Lenny and I get the following error during compile: make[4]: Entering directory `/backup/source/db/postgresql-8.3.6/src/backend/utils/adt' gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline

Re: [GENERAL] 8.3.6 build error on Debian Lenny

2009-03-09 Thread Tom Lane
Josh Trutwin j...@trutwins.homeip.net writes: Hi - I'm trying to build 8.3.6 on a box recently upgraded from Sarge to Lenny and I get the following error during compile: make[4]: Entering directory `/backup/source/db/postgresql-8.3.6/src/backend/utils/adt' gcc -O2 -Wall -Wmissing-prototypes

Re: [GENERAL] 8.3.6 build error on Debian Lenny

2009-03-09 Thread Leonel Nunez
Josh Trutwin j...@trutwins.homeip.net writes: Hi - I'm trying to build 8.3.6 on a box recently upgraded from Sarge to Lenny and I get the following error during compile: make[4]: Entering directory `/backup/source/db/postgresql-8.3.6/src/backend/utils/adt' gcc -O2 -Wall -Wmissing-prototypes

Re: [GENERAL] 8.3.6 build error on Debian Lenny

2009-03-09 Thread Josh Trutwin
On Tue, 10 Mar 2009 00:49:32 -0400 Tom Lane t...@sss.pgh.pa.us wrote: Josh Trutwin j...@trutwins.homeip.net writes: snip geo_ops.c /usr/lib/gcc/i486-linux-gnu/4.3.2/cc1: symbol lookup error: /usr/lib/libmpfr.so.1: undefined symbol: __gmp_get_memory_functions [ blink... ] There's no

Re: [GENERAL] 8.3.6 build error on Debian Lenny

2009-03-09 Thread Josh Trutwin
On Mon, 9 Mar 2009 22:01:38 -0700 (MST) Leonel Nunez lis...@enelserver.com wrote: Lenny has 8.3.6 why don't just apt-get install postgresql ??? http://packages.debian.org/lenny/postgresql If I were doing a complete reinstall I would definitely go that route. I came from a slackware

[GENERAL] Re: [GENERAL] 8.4 – Where, when, what...

2009-03-09 Thread Joey K.
Where: What is the best way to get a copy of the 8.4 beta? I've searched around, but couldn't find a reliable direction on this subject. http://yum.pgsqlrpms.org/news-8.4devel-ready-for-testing.php Note these are development RPMs. When: Is there any official word on when 8.4 will be

[GENERAL] postgres deployment

2009-03-09 Thread Nagalingam, Karthikeyan
Hi, Can I know the effective solution to do the backup and recovery for Postgres in storage environment. Please share Any existing deployment and solution for backup and recovery for Postgres in storage Any suggestion and recommendation are welcome. Regards Karthikeyan.N