Re: [GENERAL] Would it be possible

2011-07-25 Thread Christian Ullrich
* Adarsh Sharma wrote: In the evening, by mistake I issued a *drop database globedatabase* command. Is it possible to get the data back till the state before drop database command. My pglog files is in the E:/data directory Binary log is also enabled. You do not mention that you have a

Re: [GENERAL] Implementing thick/fat databases

2011-07-25 Thread Sim Zacks
On 07/24/2011 06:58 PM, Chris Travers wrote: On Sat, Jul 23, 2011 at 11:44 PM, Sim Zackss...@compulab.co.il wrote: I gave a talk on using postgresql as an application server at PG East in March. Basically, we try to implement all business logic using functions, using plpythonu when

Re: [GENERAL] Would it be possible

2011-07-25 Thread Christian Ullrich
* Adarsh Sharma wrote: I have following files in my pg_xlog directory : 000100070091 [...] 000100070098 I think I issued the drop database command 1 month ago. From the manual, I understand that my segment files are recycled to newer ones : PostgreSQL always

Re: [GENERAL] Would it be possible

2011-07-25 Thread Albe Laurenz
Adarsh Sharma wrote: I am using Postgres-8.4.2 on Windows system. I have 2 databases in my postgres database ( globedatabase (21GB), urldatabase). I restore globedatabase from a .sql file on yesterday morning.I insert some new data in that database. In the evening, by mistake I issued a drop

Re: [GENERAL] Tracing in Postgres

2011-07-25 Thread Craig Ringer
Please reply to the list, not just to me. On 25/07/11 12:33, Harshitha S wrote: I want to retain all the error messages, error report that is used by Postgres. I don't intend to log any information extra other than what is provided by Postgres. But I just want to replace the implementation

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Fujii Masao
On Mon, Jul 25, 2011 at 10:56 AM, Yan Chunlu springri...@gmail.com wrote: I think the problem is still invalid record length and invalid magic number, it start showing right after I complete sync data and start slave.  If I stop slave later and restart, yes it could show xlog not found and can

Re: [GENERAL] Would it be possible

2011-07-25 Thread Craig Ringer
On 25/07/11 13:11, Adarsh Sharma wrote: I restore globedatabase from a .sql file on yesterday morning.I insert some new data in that database. In the evening, by mistake I issued a *drop database globedatabase* command. Did you make a copy of the database files as soon as you realized what

Re: [GENERAL] [WAS:ADMIN] [WAS:PERFORM] Restore database after drop command

2011-07-25 Thread Craig Ringer
[ADMIN] [PERFORM] First rule of mailing lists: DO NOT CROSS POST. Please stick to one mailing list. I've replied on pgsql-general where your post started out. Please do not reply to the posts on -admin or -perform. My reply follows below. On 25/07/11 15:11, Adarsh Sharma wrote: I go through

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Simon Riggs
On Mon, Jul 25, 2011 at 8:38 AM, Fujii Masao masao.fu...@gmail.com wrote: On Mon, Jul 25, 2011 at 10:56 AM, Yan Chunlu springri...@gmail.com wrote: I think the problem is still invalid record length and invalid magic number, it start showing right after I complete sync data and start slave.  

Re: [GENERAL] Implementing thick/fat databases

2011-07-25 Thread Frank Lanitz
Am 22.07.2011 21:15, schrieb Karl Nack: to move as much business/transactional logic as possible into the database, so that client applications become little more than moving data into and out of the database using a well-defined API, most commonly (but not necessarily) through the use of stored

Re: [GENERAL] Implementing thick/fat databases

2011-07-25 Thread Pavel Stehule
2011/7/25 Frank Lanitz fr...@frank.uvena.de: Am 22.07.2011 21:15, schrieb Karl Nack: to move as much business/transactional logic as possible into the database, so that client applications become little more than moving data into and out of the database using a well-defined API, most

[GENERAL] Query, usually running 300ms, sometimes hangs for hours

2011-07-25 Thread Markus Wollny
Hi! We're currently still on PostgreSQL 8.3.7 and are experiencing a strange problem since a couple of days. I have a suspicion on what is causing it (probably not PostgreSQL) and I'd like to hear your opinion before taking my findings to the Railo bugtracker. We're running queries like this

Re: [GENERAL] Implementing thick/fat databases

2011-07-25 Thread Frank Lanitz
Am 25.07.2011 10:12, schrieb Pavel Stehule: 2011/7/25 Frank Lanitzfr...@frank.uvena.de: Am 22.07.2011 21:15, schrieb Karl Nack: to move as much business/transactional logic as possible into the database, so that client applications become little more than moving data into and out of the

Re: [GENERAL] Implementing thick/fat databases

2011-07-25 Thread Sim Zacks
On 07/25/2011 11:06 AM, Frank Lanitz wrote: Am 22.07.2011 21:15, schrieb Karl Nack: to move as much business/transactional logic as possible into the database, so that client applications become little more than moving data into and out of the database using a well-defined API, most commonly

Re: [GENERAL] Implementing thick/fat databases

2011-07-25 Thread Frank Lanitz
Am 25.07.2011 10:24, schrieb Sim Zacks: On 07/25/2011 11:06 AM, Frank Lanitz wrote: Am 22.07.2011 21:15, schrieb Karl Nack: to move as much business/transactional logic as possible into the database, so that client applications become little more than moving data into and out of the database

Re: [GENERAL] interesting finding on order by behaviour

2011-07-25 Thread Albe Laurenz
Samuel Hwang wrote: I ran the same tests in SQL Server 2008R2, Oracle10 and PostgreSQL 9.0.4 and found something interesting... set up = drop table t1 create table t1 (f1 varchar(100)) insert into t1 (f1) values ('AbC') insert into t1 (f1) values ('CdE') insert into t1 (f1) values

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Yan Chunlu
I am using debian ant apt-get to install postgresql, dpkg list shows they are the same? is there anyway to tell what's version it is compiled from? thanks! Master# dpkg -l |grep post ii postgresql-9.0 9.0.4-1+b1 object-relational SQL database, version 9.0 server ii

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Yan Chunlu
sorry for the typo, debian and apt-get On Mon, Jul 25, 2011 at 5:39 PM, Yan Chunlu springri...@gmail.com wrote: I am using debian and apt-get to install postgresql, dpkg list shows they are the same?  is there anyway to tell what's version it is compiled from? thanks! Master# dpkg -l |grep

Re: [GENERAL] weird table sizes

2011-07-25 Thread MirrorX
thank you all for your help. finally the big table had many more rows(2 billions) than the stats showed so there is no weird thing going on. -- View this message in context: http://postgresql.1045698.n5.nabble.com/weird-table-sizes-tp4626505p4630238.html Sent from the PostgreSQL - general

Re: [GENERAL] Disallow access from psql, or allow access only from specific client app

2011-07-25 Thread Mario Puntin
Thanks a lot to everybody for the replies. Kurt: by the term client I meant an application, like psql, from which users could connect to the database, as they have a user/password, and manipulate data. I want them to access from certain, specific application, but I don't want them to install

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Tomas Vondra
On 25 Červenec 2011, 11:39, Yan Chunlu wrote: I am using debian ant apt-get to install postgresql, dpkg list shows they are the same? is there anyway to tell what's version it is compiled from? thanks! AFAIK there's no way to find out which compiler was used to build PostgreSQL binaries (IIRC

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Yan Chunlu
gcc compiler on my machine is 4.6.1, but I didn't compile it myself. just installed the binary from apt-get. I will try to compile it by myself to see what will happen On Mon, Jul 25, 2011 at 8:18 PM, Tomas Vondra t...@fuzzy.cz wrote: On 25 Červenec 2011, 11:39, Yan Chunlu wrote: I am using

Re: [GENERAL] Disallow access from psql, or allow access only from specific client app

2011-07-25 Thread Sim Zacks
A lot of applications don't actually have a database role per user. There is an application user who logs into the database and the application handles application logins through a users table in the database. That way the only thing that the user has access to is the application and not the

[GENERAL] unable to find function to encrypt text using 3des algorithm with 3 independent keys

2011-07-25 Thread vijay bikas
dear ! I have a project in which we want to encrypt and decrypt data using 3des algorithm using 3 independent keys . I am unable to find the inbuilt function in postgres to encrypt and decrypt data using 3des with 3 independent keys. Pls guide me . Thanks ! Vijay Bikas Soft. Engineer. NSPL,

Re: [GENERAL] Disallow access from psql, or allow access only from specific client app

2011-07-25 Thread Achilleas Mantzios
Στις Monday 25 July 2011 16:08:53 ο/η Sim Zacks έγραψε: A lot of applications don't actually have a database role per user. There is an application user who logs into the database and the application handles application logins through a users table in the database. That way the only thing

Re: [GENERAL] Tracing in Postgres

2011-07-25 Thread Tom Lane
Craig Ringer cr...@postnewspapers.com.au writes: On 25/07/11 12:33, Harshitha S wrote: But I just want to replace the implementation of the logging/tracing in Postgres, so that the existing messages can be redirected to a file, a USB etc., OK. If you are running on Unix/Linux you can just

Re: [GENERAL] Query, usually running 300ms, sometimes hangs for hours

2011-07-25 Thread Tom Lane
Markus Wollny markus.wol...@computec.de writes: I know, ~3,000 elements in the IN clause are quite a lot, but we haven't seen any problems with this before and I don't think that this is actually causing it - this same type of query has been running unchanged for more than six months now. I

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Tom Lane
Tomas Vondra t...@fuzzy.cz writes: On 25 Červenec 2011, 11:39, Yan Chunlu wrote: I am using debian ant apt-get to install postgresql, dpkg list shows they are the same? is there anyway to tell what's version it is compiled from? thanks! AFAIK there's no way to find out which compiler was

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Yan Chunlu
seems the Master server is compiled using 4.6.0: version PostgreSQL 9.0.4 on x86_64-pc-linux-gnu, compiled by GCC

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Tom Lane
Yan Chunlu springri...@gmail.com writes: seems the Master server is compiled using 4.6.0: PostgreSQL 9.0.4 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.6.real (Debian 4.6.0-6) 4.6.1 20110428 (prerelease), 64-bit Hmm. Given the datestamp, that version of gcc almost certainly does have the

Re: [GENERAL] Implementing thick/fat databases

2011-07-25 Thread Chris Travers
On Sun, Jul 24, 2011 at 11:53 PM, Sim Zacks s...@compulab.co.il wrote: The goal is to make our system client agnostic, Most of our GUI is written in wxpython, we also have some web functions and even a barcode terminal function, written in C#. We would like to use an application server, so

Re: [GENERAL] Implementing thick/fat databases

2011-07-25 Thread Chris Travers
On Mon, Jul 25, 2011 at 1:24 AM, Sim Zacks s...@compulab.co.il wrote: If I understand you correctly, you are saying that to handle business logic processing, I may require X servers. Only a percentage of that traffic actually requires database processing. if I use a cluster of application

Re: [GENERAL] Why do I have reading from the swap partition?

2011-07-25 Thread Ioana Danes
Hi Scott, Thank you for your answer, this is exactly what happens in this situation. --- On Fri, 7/22/11, Scott Marlowe scott.marl...@gmail.com wrote: From: Scott Marlowe scott.marl...@gmail.com Subject: Re: [GENERAL] Why do I have reading from the swap partition? To: Ioana Danes

Re: [GENERAL] Disallow access from psql, or allow access only from specific client app

2011-07-25 Thread Chris Travers
On Mon, Jul 25, 2011 at 6:38 AM, Achilleas Mantzios ach...@matrix.gatewaynet.com wrote: Στις Monday 25 July 2011 16:08:53 ο/η Sim Zacks έγραψε: A lot of applications don't actually have a database role per user. There is an application user who logs into the database and the application

Re: [GENERAL] unable to find function to encrypt text using 3des algorithm with 3 independent keys

2011-07-25 Thread Chris Travers
On Mon, Jul 25, 2011 at 2:58 AM, vijay bikas vijay.bi...@gmail.com wrote: dear ! I have a project in which we want to encrypt and decrypt data using 3des algorithm using 3 independent keys . I am unable to find the inbuilt  function in postgres to encrypt and decrypt data using 3des with 3

Re: [GENERAL] Query, usually running 300ms, sometimes hangs for hours

2011-07-25 Thread Markus Wollny
Hi! Tom Lane wrote: Yes, that reading is correct: this stack trace shows it's blocked trying to send query results back to the client. So you need to figure out why the client is failing to accept data. Thanks; we saw one of those zombie queries again today, a simple restart of the

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Tom Lane
Yan Chunlu springri...@gmail.com writes: how about 4.3.2? Yes, pre-4.6 gcc should be fine. regards, tom lane -- 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] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Yan Chunlu
oh god...thanks a lot for the tip. I did actually lost some data, the master server has crashed two times. every time it comes back, the index were broken. I need to reindex it. I have already set fsync=on. just thought it was normal behavior about gcc version, only 4.6.0 effected?4.6.1

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Tom Lane
Yan Chunlu springri...@gmail.com writes: oh god...thanks a lot for the tip. I did actually lost some data, the master server has crashed two times. every time it comes back, the index were broken. I need to reindex it. I have already set fsync=on. just thought it was normal behavior Uh,

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Yan Chunlu
how about 4.3.2? I have gcc 4.3.2 compiled postgresql 9.0.4 as slave, is that okay that I turn the slave into master? so the switch will be a lot more smooth. On Tue, Jul 26, 2011 at 12:08 AM, Tom Lane t...@sss.pgh.pa.us wrote: Yan Chunlu springri...@gmail.com writes: oh god...thanks a lot

[GENERAL] TRUNCATE pg_largeobject

2011-07-25 Thread Tamas Vincze
Is it safe? This table is around 500GB and because of performance reasons I slowly moved all large objects to regular files on a NetApp share. Now it shows 0 records: # select count(*) from pg_largeobject; count --- 0 (1 row) but disk space and RAM by the free space map is still

[GENERAL] 9.0 Streaming Replication Problem to two slaves

2011-07-25 Thread Michael Best
I have a master server and two slave servers, one in the same rack and one in another data center that has a normal latency of about 15ms. Both master and slaves are running CentOS 5.6 x86_64 with: postgresql90-server-9.0.4-1PGDG.rhel5.x86_64 from http://yum.pgrpms.org The master server is

Re: [GENERAL] streaming replication does not work across datacenter with 20ms latency?

2011-07-25 Thread Michael Nolan
On Mon, Jul 25, 2011 at 7:18 AM, Tomas Vondra t...@fuzzy.cz wrote: On 25 Červenec 2011, 11:39, Yan Chunlu wrote: I am using debian ant apt-get to install postgresql, dpkg list shows they are the same? is there anyway to tell what's version it is compiled from? thanks! AFAIK there's no

Re: [GENERAL] Database Restore Fail - No liblwgeom.so

2011-07-25 Thread Jeff Davis
On Tue, 2011-07-19 at 14:16 +0100, Rebecca Clarke wrote: Hi there I'm transferring a database from 8.2 to 8.4 and I have some triggers that reference liblwgeom.so within the database. It sounds like you have some triggers that were compiled against one version of PostGIS, and you need to

Re: [GENERAL] Implementing thick/fat databases

2011-07-25 Thread Merlin Moncure
On Sun, Jul 24, 2011 at 12:51 AM, Chris Travers chris.trav...@gmail.com wrote: I was thinking similar thoughts, but you not only beat me to it, you made some good points I had not thought of! The only thing I can think of adding: is that it would be good to lock down the database so that only

Re: [GENERAL] interesting finding on order by behaviour

2011-07-25 Thread Shianmiin
Thanks for the info. That clarify things :) -- View this message in context: http://postgresql.1045698.n5.nabble.com/interesting-finding-on-order-by-behaviour-tp4623884p4632301.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list

[GENERAL] pgsql error

2011-07-25 Thread Mcleod, John
Hello all, I'm new to pgsql and I'm taking over for a project manager that left the company. I'm receiving the following error... CONTEXT: writing block 614 of relation 394198/412175 WARNING: could not write block 614 of 394198/412175 DETAIL: Multiple failures --- write error may be permanent.

Re: [GENERAL] pgsql error

2011-07-25 Thread Cédric Villemain
2011/7/25 Mcleod, John jo...@spicergroup.com: Hello all, I'm new to pgsql and I'm taking over for a project manager that left the company. I'm receiving the following error… CONTEXT: writing block 614 of relation 394198/412175 WARNING: could not write block 614 of 394198/412175

Re: [GENERAL] pgsql error

2011-07-25 Thread Merlin Moncure
On Mon, Jul 25, 2011 at 3:05 PM, Mcleod, John jo...@spicergroup.com wrote: Hello all, I'm new to pgsql and I'm taking over for a project manager that left the company. I'm receiving the following error… CONTEXT: writing block 614 of relation 394198/412175 WARNING: could not write block

Re: [GENERAL] TRUNCATE pg_largeobject

2011-07-25 Thread Dmitriy Igrishin
Hey Tamas, 2011/7/25 Tamas Vincze vin...@neb.com Is it safe? This table is around 500GB and because of performance reasons I slowly moved all large objects to regular files on a NetApp share. Now it shows 0 records: # select count(*) from pg_largeobject; count --- 0 (1 row)

Re: [GENERAL] TRUNCATE pg_largeobject

2011-07-25 Thread Tamas Vincze
Hi Dmitriy, pg_largeobject is already empty, I have lo_unlink()'ed everything from it, but it still takes up the same disk space and memory for the free page maps. I'm looking at the best way to reclaim the disk/memory from this otherwise empty table. Normal VACUUM didn't help and I'd like some

Re: [GENERAL] Implementing thick/fat databases

2011-07-25 Thread Chris Travers
On Mon, Jul 25, 2011 at 12:33 PM, Merlin Moncure mmonc...@gmail.com wrote: exactly. procedural middlewares written in languages like java tend to be bug factories: *) over-(mis-)use of threads *) performance wins moving logic outside the database to scale it are balanced out by the extra

Re: [GENERAL] Tracing in Postgres

2011-07-25 Thread Craig Ringer
On 25/07/2011 9:54 PM, Tom Lane wrote: Or just redirect postmaster's stderr to the target file, and don't even bother with syslog ... True. I was working on the assumption that the OP wanted to change the output destination at runtime, but if that is not the case then a simple redirect is a

[GENERAL] create table as select... with auto increment id ?

2011-07-25 Thread David Salisbury
We all know i can create table freaky as select abunchofstuff. I work with rails developers and they are fussy about having an auto incrementing id field. Is there a way I can eak that out of the above type statement, or am I stuck with creating the table and no short cuts? create table

Re: [GENERAL] create table as select... with auto increment id ?

2011-07-25 Thread Peter Geoghegan
On 26 July 2011 01:17, David Salisbury salisb...@globe.gov wrote: I work with rails developers and they are fussy about having an auto incrementing id field.  Is there a way I can eak that out of the above type statement, or am I stuck with creating the table and no short cuts? create table

Re: [GENERAL] create table as select... with auto increment id ?

2011-07-25 Thread Joe Conway
On 07/25/2011 05:17 PM, David Salisbury wrote: We all know i can create table freaky as select abunchofstuff. I work with rails developers and they are fussy about having an auto incrementing id field. Is there a way I can eak that out of the above type statement, or am I stuck with

Re: [GENERAL] [HACKERS] Error calling PG_RETURN_NULL()

2011-07-25 Thread Jeff Davis
[ Moved to pgsql-general. pgsql-hackers is for development of PostgreSQL itself. ] On Mon, 2011-07-25 at 20:06 -0300, Alexandre Savaris wrote: ** Error ** ERRO: input function 49344 returned NULL SQL state: XX000 Character: 45 It seems like the call to PG_RETURN_NULL() on

Re: [GENERAL] pgsql error

2011-07-25 Thread Tom Lane
Merlin Moncure mmonc...@gmail.com writes: On Mon, Jul 25, 2011 at 3:05 PM, Mcleod, John jo...@spicergroup.com wrote: I'm receiving the following error CONTEXT: writing block 614 of relation 394198/412175 WARNING: could not write block 614 of 394198/412175 DETAIL: Multiple failures --- write

[GENERAL] practical Fail-over methods (was: streaming replication trigger file)

2011-07-25 Thread Toby Corkindale
On 16/06/11 18:44, John R Pierce wrote: On 06/16/11 1:31 AM, AI Rumman wrote: When I manually create the C:\\pg\\stopreplication\\standby.txt' file, then it is working. That is, B is becoming the master. So, my question is, how this trigger file should be created so that B will become master