Re: [GENERAL] Parallel DB architechture

2009-03-30 Thread Asko Oja
Hello We use plProxy (RUN ON ALL) to run queries in parallel. We split our database into 16 shards and distributed it over 4 servers. So now we are running queries on 16 cpu's in parallel :) regards, Asko On Mon, Mar 30, 2009 at 9:20 AM, aravind chandu avin_frie...@yahoo.comwrote: Hello,

Re: [GENERAL] Question about functions that return a set of records

2009-02-19 Thread Asko Oja
CREATE FUNCTION func( i_users text[], OUT username text, OUT update_time timestamp with time zone ) RETURNS SETOF record AS $_$ select f.username , f.update_time from tbl f where f.username = ANY ($1); $_$ LANGUAGE sql SECURITY DEFINER; On Fri, Feb 20,

Re: [GENERAL] database/table snapshot

2009-01-30 Thread Asko Oja
Hello We have script called cube_dispatcher in SkyTools that we we use for similar sounding purpose. We must provide daily snapshots of changes to online tables for Business Intelligence team. So we create trigger on every table that needs to be handled that writes changed records into queue and

Re: [GENERAL] possible pg_dump bug

2009-01-28 Thread Asko Oja
Hi For the record. Using search_path for schema name handling is most annoying feature of pg_dump for us. I have run into many cases where separating schema is inconvenient but don't seem to remember any upsides. regards Asko On Wed, Jan 28, 2009 at 7:39 PM, Tom Lane t...@sss.pgh.pa.us wrote:

Re: [GENERAL] dblink syntax question for remotely invoking void-returning procedures

2009-01-26 Thread Asko Oja
Take a stab at plproxy if you want to remotly call functions. Should be much better suited than dblink for that. Regards Asko On Mon, Jan 26, 2009 at 4:07 PM, Merlin Moncure mmonc...@gmail.com wrote: On 1/24/09, Ian Sollars ian.soll...@gmail.com wrote: Hello everyone, I've got some

Re: [GENERAL] Conditional commit inside functions

2008-12-25 Thread Asko Oja
On Thu, Dec 25, 2008 at 2:58 PM, Pavel Stehule pavel.steh...@gmail.comwrote: Hello, PostgreSQL has doesn't use rollback segment, so commit over 1 lines is not necessary, and it is bad. If you are having database in your laptop it might be true. In OLTP environments it's not feasible to

Re: [GENERAL] pl/proxy and sequence generation

2008-12-24 Thread Asko Oja
On Wed, Dec 24, 2008 at 5:44 PM, Jonah H. Harris jonah.har...@gmail.comwrote: On Wed, Dec 24, 2008 at 10:18 AM, Igor Katson descent...@gmail.com wrote: So, should I make a wrapper in e.g. PL/pgsql for every insert function writen in PL/Proxy to remove the sequence from the argument list and

Re: [GENERAL] Current log files when rotating?

2008-11-10 Thread Asko Oja
$ cat dbscripts/logtail.py #!/usr/bin/env python usage: logtail [-d pathname][-n] -d pathname Use pathname instead of /var/lib/postgresql/8.2/main/pg_log -nJust print the current log file name and exit -lList the log file names -p [files]Run the files

Re: [GENERAL] Logging in function with exception

2008-11-10 Thread Asko Oja
One of the simplest ways to do it is with plProxy call into same database in exception block. Get plproxy installed in your database and after that it is as simple as function call. test=# create table log ( msg text ); CREATE TABLE test=# create function add_logg ( i_msg text ) returns void as $$

Re: [GENERAL] options for launching sql script asynchronously from web app

2008-11-08 Thread Asko Oja
On Sat, Nov 8, 2008 at 12:40 PM, Ivan Sergio Borgonovo [EMAIL PROTECTED] wrote: On Sat, 8 Nov 2008 11:36:06 +0200 Asko Oja [EMAIL PROTECTED] wrote: Whenever asynchronous execution or batch processing is needed PgQ in SkyTools should be one option to be evaluated. It has PhP interfaces

Re: [GENERAL] options for launching sql script asynchronously from web app

2008-11-08 Thread Asko Oja
Whenever asynchronous execution or batch processing is needed PgQ in SkyTools should be one option to be evaluated. It has PhP interfaces as well as tens of useful Python scripts. On Sat, Nov 8, 2008 at 3:49 AM, Nikolas Everett [EMAIL PROTECTED] wrote: Authenticate in web app and drop a script

Re: [HACKERS] [GENERAL] Transactions within a function body

2008-10-03 Thread Asko Oja
On Thu, Oct 2, 2008 at 6:46 PM, Bob Henkel [EMAIL PROTECTED] wrote: Have you looked at creating a function in perl and creating a new connection? Or using a dblink query which can create a new connection? These two methods work. I have used them to insert to a log table regardless of the

Re: [GENERAL] Oracle and Postgresql

2008-09-25 Thread Asko Oja
On Wed, Sep 24, 2008 at 11:13 PM, Casey Allen Shobe [EMAIL PROTECTED]wrote: On Sep 15, 2008, at 6:58 AM, David Fetter wrote: Roles, We have 'em. We do NOT have secure application roles or anywhere near the level of configurability in security aspects as Oracle. We've got a great

Re: [GENERAL] Oracle and Postgresql

2008-09-25 Thread Asko Oja
On Thu, Sep 25, 2008 at 3:52 PM, Andrew Sullivan [EMAIL PROTECTED]wrote: On Thu, Sep 25, 2008 at 01:13:29PM +0300, Asko Oja wrote: but why would you put part of your business logic into some configuration tables while you could keep it in your own functions Because the parameters

Re: [GENERAL] Slony vs Longiste

2008-09-24 Thread Asko Oja
Hi SkyTools contains in addition to Londiste and PgQ also walmgr.py that we use quite often for inside colo switchovers. Between colocations we use londiste because of lower bandwith requirements. walmgr.py --help usage: WALShipping manager. walmgr INI COMMAND [-n] Master commands: setup

Re: [GENERAL] Largest PostgreSQL 8.x DB someone is running?

2008-09-22 Thread Asko Oja
On Mon, Sep 22, 2008 at 7:14 AM, Keaton Adams [EMAIL PROTECTED] wrote: What is the the largest PostgreSQL 8.x database that is running in a production environment that you are aware of? We top out at roughly 400 GB but have a need for a new project to go much, much larger (in the several TB

Re: [GENERAL] Efficient processing of staging data

2008-09-07 Thread Asko Oja
That sounds like something that is good to handle with PgQ that is part of SkyTools package. PgQ is very efficient event processing system for PostgreSQL. Each event queue may have several consumers. What may interest you is that PgQ takes care of processed events by keeping them in rotated tables

Re: [GENERAL] Oracle and Postgresql

2008-09-03 Thread Asko Oja
On Wed, Sep 3, 2008 at 5:56 AM, Robert Treat [EMAIL PROTECTED]wrote: On Tuesday 02 September 2008 17:21:12 Asko Oja wrote: On Tue, Sep 2, 2008 at 2:09 AM, Michael Nolan [EMAIL PROTECTED] wrote: Oracle handles connecting to multiple databases (even on multiple/remote computers) fairly

Re: [GENERAL] Oracle and Postgresql

2008-09-02 Thread Asko Oja
On Tue, Sep 2, 2008 at 2:09 AM, Michael Nolan [EMAIL PROTECTED] wrote: Oracle handles connecting to multiple databases (even on multiple/remote computers) fairly seamlessly, PG does not (yet.) Stuff we do with plProxy on PostgreSQL is in some respects more advanced than anything Oracle has to

Re: [GENERAL] Postgre connect on Postgre

2008-09-01 Thread Asko Oja
If you are using functions take a look at plProxy. We created it after finding out that dblink wasn't good enough for us in oltp environments. There are also some security issues related to dblink that should be given serious consideration. As for replication SkyTools and Londiste are

Re: [GENERAL] Clone a database to other machine

2008-07-29 Thread Asko Oja
Hi And you can use Londiste from Skytools. It's simpler and better suited for your task. http://pgfoundry.org/projects/skytools/ Asko On Mon, Jul 28, 2008 at 7:44 PM, Garg, Manjit [EMAIL PROTECTED] wrote: Hi All, I'm stuck to an issue while cloning the pgsql database, can you please help,

Re: [GENERAL] php + postgresql website ?

2008-07-04 Thread Asko Oja
http://www.skype.com/ On Tue, Jul 1, 2008 at 12:18 PM, Clemens Schwaighofer [EMAIL PROTECTED] wrote: --On Monday, June 30, 2008 08:06:25 PM +0800 paragasu [EMAIL PROTECTED] wrote: i can name a lot of website written in mysql and php. currently, i am planning to use postgresql database

Re: [GENERAL] replication

2008-06-25 Thread Asko Oja
Hi Take a look also on Londiste from SkyTools. It is easy to set up and manage. In addition SkyTools contains other useful scripts and tools. We use Londiste to replicate data ovwe WAN where walshipping would consume too much bandwidth. Asko On Tue, Jun 24, 2008 at 9:41 AM, Adrian Moisey [EMAIL

Re: [GENERAL] Event-driven programming?

2007-09-13 Thread Asko Oja
Hi PgQ might be the answer for you. Each transaction shouöd push event into queue and then you can write conusmers that notify each of the applications that need to react to this. Extract from documentation: PgQ is Postgres based event processing system. It is part of SkyTools package that

Re: [GENERAL] get a list of table modifications in a day?

2007-09-13 Thread Asko Oja
Hi PgQ can be used this purpose. Idea is to have triggers on table that push events into queue and then on that queue you can do whatever suits you best. As we don't want to keep these logs online PgQ is most conenient as it efficiently removes them as soon as they are handled. PgQ -

Re: [GENERAL] Sthange things happen: SkyTools pgbouncer is NOT a balancer

2007-09-12 Thread Asko Oja
Hi One of PgBouncer original design goals is to create small and robust connection pooler. If we start adding more and more fancy features like load balancing then we can easily end up in the same place from which we wanted to get away (pgPool). We do our load balancing on ip level when the

Re: [GENERAL] Scalability Design Questions

2007-09-12 Thread Asko Oja
Hello We plProxy to split our database into partitions. See Kristo's blog's about that at http://kaiv.wordpress.com/. For replication we use Londiste in SkyTools package. SkyTools contains several more scripts that are useful when buildin large and complex systems running on large number of

Re: [GENERAL] Auto-partitioning?

2007-08-22 Thread Asko Oja
Hi Just a hint. We do this auto-partitioning with PgQ. Instead of writing records into table we push them into queue and use consumer called table_dispatcher to creates tartitioned tables as needed and put records into them. We have multiple destination databases where to write data and target