Re: [GENERAL] Functions returning setof record -- can I use a table type as my return type hint?

2011-08-12 Thread Merlin Moncure
On Fri, Aug 12, 2011 at 11:26 AM, George MacKerron g.j.macker...@lse.ac.uk wrote: Many thanks for the reply, Ray. Unfortunately, I don't think this addresses the problem, because I'd hoped not to have to hard-code the table name into the function. The point of the function is that you can

Re: [GENERAL] Functions returning setof record -- can I use a table type as my return type hint?

2011-08-12 Thread Merlin Moncure
On Fri, Aug 12, 2011 at 12:01 PM, George MacKerron g.j.macker...@lse.ac.uk wrote: On 12 Aug 2011, at 17:43, Merlin Moncure wrote: you can't have it both ways. at the time the function call is executed, the return type/fields must be known.  you can do this by either a. explicitly defining

Re: [GENERAL] PLPGSQL Generic query in trigger doubt

2011-08-10 Thread Merlin Moncure
On Wed, Aug 10, 2011 at 8:38 AM, Mauro mauro...@yahoo.com.br wrote: Hi, good morning list I'm writing a generic trigger in plpgsql to provide a system log to my system, but I'm stopped with the folow problem: Example: TABLE STRUCT: table1    fldA    VARCHAR    fldB    VARCHAR    fldC   

Re: [GENERAL] table / query as a prameter for PL/pgSQL function

2011-08-09 Thread Merlin Moncure
2011/8/8 Ondrej Ivanič ondrej.iva...@gmail.com: Hi, 2011/8/9 Merlin Moncure mmonc...@gmail.com: You have a few of different methods for passing sets between functions. I do not want to pass data between functions. The ideal solution should look like this: select * from my_map_func(select

Re: [GENERAL] JDBC driver throwing error while connecting to the slave server for partitioned table

2011-08-09 Thread Merlin Moncure
On Mon, Aug 8, 2011 at 8:14 AM, sameera vhora vhorasameera...@gmail.com wrote:  We are facing below issue after creating slony replication of partitioning table in edb server 8.3.  This issue persist only on slave one not the primary one.  Below logs we found in tomcats.  Error in

Re: [GENERAL] table / query as a prameter for PL/pgSQL function

2011-08-08 Thread Merlin Moncure
2011/8/7 Ondrej Ivanič ondrej.iva...@gmail.com: Hi, It is possible to pass query result (or cursor?) as function parameter? I need a function which emits zero or more rows per input row (map function from mapreduce paradigm). Function returns record (or array): (value1, value2, value3) I've

Re: [GENERAL] Is there a better way to unnest an entire row?

2011-08-05 Thread Merlin Moncure
On Thu, Aug 4, 2011 at 5:23 PM, David Johnston pol...@yahoo.com wrote: Currently I have a de-normalized table with two sets of “records” embedded (i.e.,  [id, item1_name, item1_amount, item2_name, item2_amount]).  My goal is to output two records (i.e., [id, item_name, item_amount]) into an

Re: [GENERAL] running out of oids

2011-08-03 Thread Merlin Moncure
On Wed, Aug 3, 2011 at 2:41 PM, Geoffrey Myers li...@serioustechnology.com wrote: Am I correct in assuming that the 'running out of oids' issue was resolved with a design change within Postgresql? not exactly -- for quite some time now the use of oids in user tables has been discouraged. The

Re: [GENERAL] Timeline Conflict

2011-08-02 Thread Merlin Moncure
On Tue, Aug 2, 2011 at 12:59 AM, senthilnathan senthilnatha...@gmail.com wrote: We have system(Cluster) with Master replicating to 2 stand by servers. i.e M   |--- S1      |--- S2 If master failed, we do a trigger file at S1 to take over as master. Now we need to re-point the

Re: [GENERAL] Timeline Conflict

2011-08-02 Thread Merlin Moncure
On Tue, Aug 2, 2011 at 2:17 PM, Pedro Sam pe...@rim.com wrote: I've been trying to use repmgr for just that purpose.  Looks like it simply creates/modifies a recovery.conf pointing primary_conninfo to the new master, and then restart.  It does not seem to have the ability to resolve any

Re: [GENERAL] Postgres 8.3 Function returning a row with different number of colums

2011-08-01 Thread Merlin Moncure
On Mon, Aug 1, 2011 at 1:51 PM, Gianpiero Venditti stra...@hotmail.it wrote: Hello, I need to write a function that sometimes return a row with only a column and sometimes return a row with two columns. Is it possible to do something like this with record type? If it's not what's the best

Re: [GENERAL] string comparison problem

2011-08-01 Thread Merlin Moncure
On Mon, Aug 1, 2011 at 2:47 PM, Johnny Edge edgewa...@visafirst.com wrote: Hi folks, I have a problem with identical versions of postgresql - 8.3.13 Config files are identical. HostA is a 32 bit CentOS 5.3 install and the hostB is x86_64 CentOS 6. Difference in architecture should not be a

Re: [GENERAL] eval function

2011-07-28 Thread Merlin Moncure
On Thu, Jul 28, 2011 at 6:18 AM, Sim Zacks s...@compulab.co.il wrote: I need an eval function that will evaluate a valid SQL expression and return the value. I've seen variations of  this asked before with no real answer. I wrote a function to handle it, but it looks like there should be a

Re: [GENERAL] eval function

2011-07-28 Thread Merlin Moncure
On Thu, Jul 28, 2011 at 10:08 AM, David Johnston pol...@yahoo.com wrote: Merlin Moncure mmonc...@gmail.com writes: Couple points: *) why a special case for boolean values? That seemed weird to me too ... *) this should be immutable What if the passed expression is volatile?  Better

Re: [GENERAL] eval function

2011-07-28 Thread Merlin Moncure
On Thu, Jul 28, 2011 at 10:36 AM, Chris Travers chris.trav...@gmail.com wrote: On Thu, Jul 28, 2011 at 8:23 AM, Merlin Moncure mmonc...@gmail.com wrote: This function is an absolute no-go if the string literal is coming from untrusted source, and any robust defenses would ruin the intended

Re: [GENERAL] How to implement autostart of postgres?

2011-07-28 Thread Merlin Moncure
On Thu, Jul 28, 2011 at 5:06 AM, Gavrina, Irina igavr...@mera.ru wrote: Thank you all for your answers. I’m using the Red Hat 5 OS. So I have no the ‘upstart’ utility at my disposal. Unfortunately. Yes, you are right, this is a question of database robustness. You know, If any of postgres

Re: [GENERAL] Implementing thick/fat databases

2011-07-27 Thread Merlin Moncure
On Wed, Jul 27, 2011 at 1:41 AM, Chris Travers chris.trav...@gmail.com wrote: On Tue, Jul 26, 2011 at 8:13 PM, Karl Nack karln...@futurityinc.com wrote: The current svn trunk (to be 1.3) does. So how far do you take this? I've been playing around with plpgsql a bit and am pretty encouraged by

Re: [GENERAL] WITH x AS (...) and visibility in UPDATE

2011-07-27 Thread Merlin Moncure
On Wed, Jul 27, 2011 at 3:18 PM, Peter V peterv861...@hotmail.com wrote: Hello all, I am trying out PostgreSQL 9.1 Beta 3. In particular, I am very interested in WITH x AS (...) construction. drop table if exists t; create table t (     identifier   serial,     title    text );

Re: [GENERAL] WITH x AS (...) and visibility in UPDATE

2011-07-27 Thread Merlin Moncure
On Wed, Jul 27, 2011 at 4:03 PM, Peter V peterv861...@hotmail.com wrote: On Wed, Jul 27, 2011 at 3:18 PM, Peter V peterv861...@hotmail.com wrote: Hello all, I am trying out PostgreSQL 9.1 Beta 3. In particular, I am very interested in WITH x AS (...) construction. drop table if

Re: [GENERAL] pgsql error

2011-07-26 Thread Merlin Moncure
On Tue, Jul 26, 2011 at 7:47 AM, Mcleod, John jo...@spicergroup.com wrote: Thank you for the reply. At command line, I ran... psql  --version and received.. psql  (PostgreSQL) 7.5devel The database is sitting on a Windows 2003 Server box. A mapping application, wrote in PHP, runs with

[GENERAL] 100 times faster than mysql

2011-07-26 Thread Merlin Moncure
http://codesynthesis.com/~boris/blog/2011/07/26/odb-1-5-0-released/ merlin -- 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] Implementing thick/fat databases

2011-07-26 Thread Merlin Moncure
On Mon, Jul 25, 2011 at 5:21 PM, Chris Travers chris.trav...@gmail.com wrote: 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

Re: [GENERAL] select all rows where any column is NULL

2011-07-26 Thread Merlin Moncure
On Tue, Jul 26, 2011 at 2:08 PM, Nathan Boley npbo...@gmail.com wrote: Does anyone have a concise way of doing $SUBJECT? select * from foo where (row((foo).*) = row((foo).*)) is null; merlin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

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] 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] Alarm function in PL/pgSQL

2011-07-18 Thread Merlin Moncure
On Mon, Jul 18, 2011 at 4:38 PM, Jon Smark jon.sm...@yahoo.com wrote: Hi, Is it possible to set an alarm within a PL/pgSQL function?  By alarm I mean a function which is invoked some defined time in the future, even after the original function has terminated and returned a value to the

Re: [GENERAL] How to sum monetary variables

2011-07-18 Thread Merlin Moncure
2011/7/18 Martín Marqués martin.marq...@gmail.com: I'm building a table (which is a report that has to be printed) with a bunch of items (up to 300 in some cases) that have unitary price (stored in a numeric(9,2) field), how many there are, and the total price for each item. At the end of the

Re: [GENERAL] plpgsql function confusing behaviour

2011-07-13 Thread Merlin Moncure
On Tue, Jul 12, 2011 at 12:10 PM, Shianmiin shianm...@gmail.com wrote: Merlin Moncure-2 wrote: One proposed solution is to cache plpgsql plans around the search path. I like the proposed solution, since search_path plays a part when generating plpgsql plan, it make sense to be part

Re: [GENERAL] plpgsql function confusing behaviour

2011-07-12 Thread Merlin Moncure
On Mon, Jul 11, 2011 at 3:23 PM, Shianmiin shianm...@gmail.com wrote: We have recently gone thru an unexpected behavior of PostgreSQL function written in plpgsql. I wonder if anyone can help explain the ideas behind the design. Test scenario: 1. create two identical schemas, let's call them

Re: [GENERAL] Interesting article, Facebook woes using MySQL

2011-07-11 Thread Merlin Moncure
On Mon, Jul 11, 2011 at 2:50 PM, Gauthier, Dave dave.gauth...@intel.com wrote: http://gigaom.com/cloud/facebook-trapped-in-mysql-fate-worse-than-death/ Well, Stonebraker is pitching (for the Nth time) a revolutionary platform, VoltDB, which naturally brings up concerns about bias. For example,

Re: [GENERAL] rationale behind quotes for camel case?

2011-06-28 Thread Merlin Moncure
On Tue, Jun 28, 2011 at 4:12 AM, fluca1...@infinito.it wrote: Hi all, first of all I'm not expressing any critique against the use of quotes for identifier expressed using camel case. However a lot of new postgresql users seems to be unhappy with the use of quotes for camel case identifiers,

Re: [GENERAL] Custom types as parameter in stored function

2011-06-27 Thread Merlin Moncure
On Mon, Jun 27, 2011 at 4:33 AM, mephysto genna...@email.it wrote: Hello to everyone, I am trying to pass custom types as parameters in stored functions, and I tried this syntax successfully: create type myType as (id bigint, name character varying); create or replace myfunc(obj myType)

Re: [GENERAL] Custom types as parameter in stored function

2011-06-27 Thread Merlin Moncure
On Mon, Jun 27, 2011 at 2:22 PM, mephysto genna...@email.it wrote: Thank you Merlin. Now, Can I pass the select as an argument of my function? sure: select myfunc(populate_record(null::t, 'b=9, a=2')); merlin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] declare variable in postgresql

2011-06-24 Thread Merlin Moncure
On Fri, Jun 24, 2011 at 3:41 AM, Jignesh Ramavat ramavat.jign...@gmail.com wrote: Hello, need help, Declare @TypeTransactionID As int; Select @TypeTransactionID=ID from TypeTransaction Where TypeTransactionCode = 'TxnBackupInc' ; these is in sqlserver. If i want to do same in postgresql

[GENERAL] Documented conversion from PostgreSQL-MongoDB...then right back to PostgreSQL :-)

2011-06-23 Thread Merlin Moncure
For you reading pleasure :-). http://schmichael.com/files/schmongodb/Scaling%20with%20MongoDB%20(with%20notes).pdf merlin -- 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] CRUD plpgsql generator

2011-06-22 Thread Merlin Moncure
On Wed, Jun 22, 2011 at 5:40 AM, Wim Bertels wim.bert...@khleuven.be wrote: Hallo, does anyone have know of a free CRUD generator for generating plpgsql functions for doing CRUD operations on all the tables of a database or schema or just one table or.. cf

Re: [GENERAL] CRUD plpgsql generator

2011-06-22 Thread Merlin Moncure
On Wed, Jun 22, 2011 at 9:59 AM, Rob Sargent robjsarg...@gmail.com wrote: On 06/22/2011 08:02 AM, Merlin Moncure wrote: On Wed, Jun 22, 2011 at 5:40 AM, Wim Bertels wim.bert...@khleuven.be wrote: Hallo, does anyone have know of a free CRUD generator for generating plpgsql functions for doing

Re: [GENERAL] data compression in protocol?

2011-06-22 Thread Merlin Moncure
2011/6/22 Grzegorz Jaśkiewicz gryz...@gmail.com: The answer is: SSL. SSL will compress things, before encrypting (depends on setup obviously). As far as I know, postgresql it self doesn't compress any data over the wire. Could you elaborate a bit on using SSL for that purpose? How do you set

Re: [GENERAL] unique across two tables

2011-06-22 Thread Merlin Moncure
On Wed, Jun 22, 2011 at 8:34 AM, David Johnston pol...@yahoo.com wrote: Your statement is utterly false simply by virtue of the documentation. Inserts never propagate to other tables in a hierarchy Indexes/Constraints only apply to individual tables Since inserts do not propagate the

Re: [GENERAL] unique across two tables

2011-06-22 Thread Merlin Moncure
On Wed, Jun 22, 2011 at 11:30 AM, David Johnston pol...@yahoo.com wrote: yeah -- postgresql table inheritance [...] underpins the table inheritance feature [...] Thank you Master of the Obvious  ;) I do think you meant to say it underpins the Table Partitioning Feature which, through the

Re: [GENERAL] LISTEN filtering

2011-06-21 Thread Merlin Moncure
On Tue, Jun 21, 2011 at 10:58 AM, Greg Sabino Mullane g...@turnstep.com wrote: Quick idea to toss out there: allowing an option to LISTEN to only 'hear' from superusers (or self). I've got an app that uses a lot of listen/notify to talk to other subprocesses. However, it would be nice if

Re: [GENERAL] Encryption For Specific Column- Where to store the key

2011-06-16 Thread Merlin Moncure
On Thu, Jun 16, 2011 at 3:35 AM, Manuel Gysin manuel.gy...@quantum-bytes.com wrote: I can trust the dba. But while someone gain access, he can control everything and could easily extend his rights to dba. An other way with client side encryption/decryption should be possible with deployed

Re: [GENERAL] PostgreSQL 9.0 or 9.1 ?

2011-06-16 Thread Merlin Moncure
On Thu, Jun 16, 2011 at 2:47 AM, Achilleas Mantzios mantzios.ach...@yahoo.com wrote: Hello, we have been running our infrastructure on 8.3 for quite some years now, and i am thinking it is now time to upgrade all major parts of our system (java, jboss, postgresql). I would tend to be a little

Re: [GENERAL] Cursors

2011-06-15 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 11:54 PM, Andy Chambers achamb...@mcna.net wrote: Hi, What happens to cursors when new data is added to a table after you start iterating over its rows? For example, given the following loop... for rule in select tc.sid, tc.s, td.rule, td.returns                  

Re: [GENERAL] Encryption For Specific Column- Where to store the key

2011-06-15 Thread Merlin Moncure
On Wed, Jun 15, 2011 at 1:07 AM, Manuel Gysin manuel.gy...@quantum-bytes.com wrote: Hello I'm currently designing a database layout where some columns are encrypted. Some tables contains sensitive user data which needs a special protection. I used

Re: [GENERAL] You could be a PostgreSQL Patch Reviewer!

2011-06-15 Thread Merlin Moncure
On Wed, Jun 15, 2011 at 3:49 PM, Josh Berkus j...@agliodbs.com wrote: PostgreSQL community members: Do you love the PostgreSQL project?  Do you want to contribute to it? Do you want to help produce the next version of PostgreSQL? (9.2) Well, you *can*.  You can be a patch reviewer -- one of

Re: [GENERAL] Tweaking bytea / large object block sizes?

2011-06-14 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 6:48 AM, Hanno Schlichting ha...@hannosch.eu wrote: On Mon, Jun 13, 2011 at 3:27 AM, Merlin Moncure mmonc...@gmail.com wrote: I would not even consider tweaking the internal block sizes until you've determined there is a problem you expect you might solve by doing so

Re: [GENERAL] duplicate key violate error

2011-06-14 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 3:30 AM, AI Rumman rumman...@gmail.com wrote: Hi, I got duplicate key violate error in the db log for the following query: INSERT INTO tab1 ( SELECT '1611576', '1187865' WHERE NOT EXISTS ( SELECT 1 FROM tab1         WHERE id='1611576' AND id2='1187865'    )    ) The

Re: [GENERAL] thoughts on interactive query

2011-06-14 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 2:39 AM, Sim Zacks s...@compulab.co.il wrote: I am playing around with making interactive queries and was wondering if anyone had any comments. If your comment is That is a stupid idea, please try to qualify that with something constructive as well. The idea is that

Re: [GENERAL] system command in dblink?

2011-06-14 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 1:17 AM, AI Rumman rumman...@gmail.com wrote: Is it possible to execute system commands in dblink connections? I need to execute \i /tmp/test.sh in a remote connection from my psql client prompt. I connected with the remote db using dblink_connect. select

Re: [GENERAL] random backend crashes - how to debug ( Is crash dump handler released ? )

2011-06-14 Thread Merlin Moncure
On Tue, Jun 14, 2011 at 9:26 AM, BangarRaju Vadapalli bangarraju.vadapa...@infor.com wrote: Hi Everybody,   We are using PostGRE 8.4 version and experiencing random backend crashes. We have enabled logging and are able to see some logging happening in pg_log directory but not of much

Re: [GENERAL] Tweaking bytea / large object block sizes?

2011-06-13 Thread Merlin Moncure
On Mon, Jun 13, 2011 at 1:58 AM, Craig Ringer cr...@postnewspapers.com.au wrote: On 13/06/11 09:27, Merlin Moncure wrote: want to use the binary protocol mode (especially for postgres versions that don't support hex mode) Allowing myself to get a wee bit sidetracked: I've been wondering

Re: [GENERAL] Re: Can't drop temp table in subfunction during cursor loop (being used by active queries)

2011-06-13 Thread Merlin Moncure
On Mon, Jun 13, 2011 at 8:35 AM, jonathansfl jonathanbrink...@yahoo.com wrote: How would I create a dynamic table name, using the loop increment as a parameter? DROP TABLE IF EXISTS tt_PERSONSTODEACTIVATE || v_iteration CASCADE; that doesn't work. don't think i can use a dynamic variable as

Re: [GENERAL] Tweaking bytea / large object block sizes?

2011-06-12 Thread Merlin Moncure
On Sun, Jun 12, 2011 at 11:00 AM, Hanno Schlichting ha...@hannosch.eu wrote: Hi. I'm a new Postgres user. If I happen to ask stupid questions please feel free to point me to any documentation I should read or guidelines for asking questions. I'm looking into storing binary data in Postgres

Re: [GENERAL] waiting for notfications on the server

2011-06-10 Thread Merlin Moncure
On Fri, Jun 10, 2011 at 2:10 PM, Marc Munro m...@bloodnok.com wrote: I'd like to be able to wait for notify events using a user-defined C function.  All of the examples and code I can find use libpq. Is there some way I can synchronously wait for notify events using SPI? Is there some reason

Re: [GENERAL] plpgsql function with update and seeing changed data from outside during run

2011-06-09 Thread Merlin Moncure
On Thu, Jun 9, 2011 at 4:46 AM, Craig Ringer cr...@postnewspapers.com.au wrote: On 9/06/2011 2:41 PM, Clemens Schwaighofer wrote: Hi, I have a plpgsql function where I read data from a table in a loop and update data in a different table. Is it possible to see the updated data from a

Re: [bulk] Re: [GENERAL] Non returning Transactions/Many Locks in Postgres 9.0.4 and 9.0.1

2011-06-08 Thread Merlin Moncure
On Wed, Jun 8, 2011 at 9:32 AM, Tarabas tara...@tarabas.de wrote: Hello, the problem just resurfaced and the Wiki page dows not really help very much. When i look into the pg_stat_activity, i only see that the connections all state IDLE in transaction. Is there any way to find out what

Re: [GENERAL]

2011-06-07 Thread Merlin Moncure
On Tue, Jun 7, 2011 at 7:46 AM, Юрий EGO mail_...@list.ru wrote: Hello! I have a code (libpq): char textbuffer[120]; res = PQexec(conn, COPY table_name(\serial_column,\int_column,\bytea_column\) FROM STDIN); if(PQresultStatus(res) == PGRES_COPY_IN) { for(int n=0; n 10; n++) {

Re: [GENERAL] Need suggestion

2011-06-07 Thread Merlin Moncure
On Fri, Jun 3, 2011 at 5:09 PM, Esmin Gracic esmin.gra...@gmail.com wrote: another option is using sqlite for storing images. All data is in single file. (or files if you organize it that way) easier backup etc... you have some db benefits and retaining solid speed vs file system. Haven't used

Re: [GENERAL] Non returning Transactions/Many Locks in Postgres 9.0.4 and 9.0.1

2011-06-06 Thread Merlin Moncure
On Mon, Jun 6, 2011 at 11:20 AM, Tarabas tara...@tarabas.de wrote: Hello! I am currently having a recurring Locking problem on my Postgres 9.0.4 Database. I had the same Problem on 9.0.1 and updated to 9.0.4 then. It worked fine for a while and just resurfaced. Suddenly it seems as though

Re: [GENERAL] Postgres 8.3.5 - ECPG and the use of descriptors and cursors in multi-threaded programs

2011-06-02 Thread Merlin Moncure
On Tue, May 31, 2011 at 7:35 PM, Bosco Rama postg...@boscorama.com wrote: Unfortunately, like you, I am just a user of this wonderful DB.  Since we are not seeing any other input here on the 'general' list it may be time to move this thread to the pgsql-interfaces list.  Are you subscribed to

Re: [GENERAL] currval = currval+1

2011-06-01 Thread Merlin Moncure
On Wed, Jun 1, 2011 at 9:27 AM, salah jubeh s_ju...@yahoo.com wrote: I have the following SQL statements BEGIN; -- account_id is a sequence INSERT INTO account (name) VALUES ('test customer'||random()::text); -- account_id is a foreign key INSERT INTO account_detail (account_id,..) 

Re: [GENERAL] currval = currval+1

2011-06-01 Thread Merlin Moncure
On Wed, Jun 1, 2011 at 10:22 AM, salah jubeh s_ju...@yahoo.com wrote: I have some rules on the table and I have dropped them and everything went fine. the rule is as follow CREATE OR REPLACE RULE status_change_ins AS     ON INSERT TO account  DO  INSERT INTO account_status_change_log

Re: [GENERAL] Table with active and historical data

2011-06-01 Thread Merlin Moncure
On Wed, Jun 1, 2011 at 7:30 PM, Robert James srobertja...@gmail.com wrote: I have a table with a little active data and a lot of historical data.  I'd like to be able to access the active data very quickly - quicker than an index.  Here are the details: 1. Table has about 1 million records

Re: [GENERAL] Function Column Expansion Causes Inserts To Fail

2011-05-31 Thread Merlin Moncure
On Tue, May 31, 2011 at 9:24 AM, David Johnston pol...@yahoo.com wrote: From syntax works fine for literals but how would you then get table.column values into the function call - where you want to evaluate multiple rows from the source table?  In order to feed rows to a function you need the

Re: [GENERAL] Function Column Expansion Causes Inserts To Fail

2011-05-31 Thread Merlin Moncure
On Tue, May 31, 2011 at 11:57 AM, David Johnston pol...@yahoo.com wrote: See my thoughts below.  Other user's opinions (or a pointer to where this topic has been previously discussed) are greatly welcomed. Thank you for the technical detail on how  ().* gets expanded by the engine. I still

Re: [GENERAL] Function Column Expansion Causes Inserts To Fail

2011-05-31 Thread Merlin Moncure
On Tue, May 31, 2011 at 3:28 PM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com writes: There have been multiple complaints about this in the archives.  In the old days, you would have to rewrite your query to use the 'select * from func()' form (which isn't always so

Re: [GENERAL] Function Column Expansion Causes Inserts To Fail

2011-05-31 Thread Merlin Moncure
On Tue, May 31, 2011 at 5:01 PM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com writes: I've never taken the time to really get my head around 'lateral' enough to say for sure if it provides clean workarounds for all the cases that get people into hot water.  The case

Re: [GENERAL] copy record?

2011-05-27 Thread Merlin Moncure
On Thu, May 26, 2011 at 3:23 PM, Gauthier, Dave dave.gauth...@intel.com wrote: Hi: From within a perl/DBI script, I want to be able to make a copy of a record in a table, changing only the value of the primary key.  I don't know in advance what all the columns are, just the table name.

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-27 Thread Merlin Moncure
On Fri, May 27, 2011 at 11:12 AM, Per-Olov Esgard per-olov.esg...@micronic-mydata.com wrote: Thank you very much for your fast answers (both Tom and Merlin), I really appreciate it. Do I have to send a proper bug report for this? We have this problem in our product now, so I volunteer to test

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 7:26 AM, Per-Olov Esgard per-olov.esg...@micronic-mydata.com wrote: In my environment  which is linux on the server side and both windows and linux on the client side I have noticed that the introduction of pg_notify (with payload) makes the size of the postgres

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 9:01 AM, Tomas Vondra t...@fuzzy.cz wrote: Dne 26.5.2011 11:41, Alexander Farber napsal(a): Thank you, I'll try your suggestions. I'm just slow in doing so, because it's just a (sometimes pretty time consuming) hobby-project. I'm missing knowledge on how to monitor

Re: [GENERAL] When is commited data available

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 9:33 AM, Fredric Fredricson fredric.fredric...@bonetmail.com wrote: Hi, I wonder when the committed data is available to other connections, or more specifically if there is a delay after COMMIT return successfully and the data will appear in SELECTs made by other

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 11:17 AM, Per-Olov Esgard per-olov.esg...@micronic-mydata.com wrote: This is a silly and simple example but it works. The size of the payload is approximately the same as the one in my real system. It is easy to see the difference when using/not using the notify by just

Re: [GENERAL] Miidpoint between two long/lat points? (earthdistance?)

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 3:39 PM, Brent Wood b.w...@niwa.co.nz wrote: Why not install PostGIS with full ellipsoidal projection support use the azimuth distance functions available in SQL? installing postgis is a bit much if all you need to do are simple distance calculations etc. merlin --

Re: [GENERAL] temp files getting me down

2011-05-25 Thread Merlin Moncure
On Wed, May 25, 2011 at 2:14 PM, Ben Chobot be...@silentmedia.com wrote: On May 25, 2011, at 9:31 AM, Ben Chobot wrote: I'm running 9.0.3, and recently started getting temp files being created. This is a problem because it's making a bunch of dirty buffers that have to be flushed to disk

Re: [GENERAL] General Postgres performance tips when using ARRAY

2011-05-25 Thread Merlin Moncure
On Wed, May 25, 2011 at 9:17 PM, bubba postgres bubba.postg...@gmail.com wrote: So, what are the gotcha's around manipulating Arrays in stored procs? It seems reasonable that an array_cat /etc would cause the creation of a new array, but does mutating an existing array also create a copy?

Re: [GENERAL] temp files getting me down

2011-05-25 Thread Merlin Moncure
On Wed, May 25, 2011 at 6:44 PM, Ben Chobot be...@silentmedia.com wrote: On May 25, 2011, at 2:57 PM, Merlin Moncure wrote: On Wed, May 25, 2011 at 2:14 PM, Ben Chobot be...@silentmedia.com wrote: On May 25, 2011, at 9:31 AM, Ben Chobot wrote: I'm running 9.0.3, and recently started getting

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-25 Thread Merlin Moncure
On Wed, May 25, 2011 at 2:40 PM, Thom Brown t...@linux.com wrote: On 25 May 2011 18:58, Alexander Farber alexander.far...@gmail.com wrote: Hello fellow PostgreSQL-users, I run a Drupal 7 (+Facebook app) website with a multiplayer flash game and use postgresql-server-8.4.8-1PGDG.rhel5 +

Re: [GENERAL] max_connections proposal

2011-05-25 Thread Merlin Moncure
On Wed, May 25, 2011 at 10:58 PM, Craig Ringer cr...@postnewspapers.com.au wrote: There might be a very cheap and simple way to help reduce the number of people running into problems because they set massive max_connections values that their server cannot cope with instead of using pooling.

Re: [GENERAL] Miidpoint between two long/lat points? (earthdistance?)

2011-05-25 Thread Merlin Moncure
On Wed, May 25, 2011 at 12:47 PM, Carlo Stonebanks stonec.regis...@sympatico.ca wrote: I need to calculate the long/lat values between a line demarcated by two long/lat points. The points will be very close, but there is the 180 degree problem to consider, so a simple average won’t work.

Re: [GENERAL] What is the average salary for Postgresql DBA

2011-05-19 Thread Merlin Moncure
On Thu, May 19, 2011 at 10:32 AM, Vick Khera vi...@khera.org wrote: On Thu, May 19, 2011 at 3:42 AM, John R Pierce pie...@hogranch.com wrote: I suspect H1B ssalaries tend to be somewhat below these levels. Wouldn't it be unlawful to pay less than you would a permanent resident/citizen?  Ie,

Re: [GENERAL] Unique Session ID in PGSQL?

2011-05-19 Thread Merlin Moncure
On Thu, May 19, 2011 at 4:21 AM, Albe Laurenz laurenz.a...@wien.gv.at wrote: Pavel Stehule wrote: Is there any function in PGSQL that returns an unique Session identifier of the actual session? For example a Bigint, or GUID, or etc? Can I get the living Session identifiers from PG? try

Re: [GENERAL] ordering of join using ON expression = any (array)

2011-05-17 Thread Merlin Moncure
On Tue, May 17, 2011 at 3:06 AM, Gerhard Hintermayer gerhard.hinterma...@gmail.com wrote: Hi, is there a way to sort the joined tuples in the way they are in a the joined array ? BTW I'm using 8.4 (_I_ know I should upgrade, but management thinks we shouldn't :-( ) I'd like to join 2 tables

Re: [GENERAL] simple update query too long

2011-05-13 Thread Merlin Moncure
On Fri, May 13, 2011 at 2:07 AM, F T ouk...@gmail.com wrote: Thanks for your ideas. I have rerun my tests and I agree with Merlin, PostgreSQL is not adapted at all to handle wide updates. Summary : The table contains 2 millions rows. Test 1 : UPDATE grille SET inter=0; - It tooks 10

Re: [GENERAL] stunnel with just postgresql client part

2011-05-10 Thread Merlin Moncure
On Tue, May 10, 2011 at 6:09 AM, zhong ming wu mr.z.m...@gmail.com wrote: On Mon, May 9, 2011 at 10:50 PM, Merlin Moncure mmonc...@gmail.com wrote: Now manybe *I'm* a little confused.  Are you connecting to the write port (stunnel's secure port)? As I understand it, the stunnel pgsql protocol

Re: [GENERAL] stunnel with just postgresql client part

2011-05-09 Thread Merlin Moncure
On Mon, May 9, 2011 at 9:35 AM, zhong ming wu mr.z.m...@gmail.com wrote: Hi My postgresql client (ejabberd postgresql lib) does not seem to be capable of ssl connection to postgresql server (with hostssl in pg_hba) So I tried to use run stunnel on the client box (ejabberd).  It appears not

Re: [GENERAL] simple update query too long

2011-05-09 Thread Merlin Moncure
On Mon, May 9, 2011 at 10:29 AM, t...@fuzzy.cz wrote: On 05/09/2011 04:39 PM, F T wrote: Hi list I use PostgreSQL 8.4.4. (with Postgis 1.4) I have a simple update query that takes hours to run. The table is rather big (2 millions records) but it takes more than 5 hours to run !! The

Re: [GENERAL] stunnel with just postgresql client part

2011-05-09 Thread Merlin Moncure
On Mon, May 9, 2011 at 3:24 PM, zhong ming wu mr.z.m...@gmail.com wrote: On Mon, May 9, 2011 at 2:01 PM, Merlin Moncure mmonc...@gmail.com wrote: . . .  It seems to be shame that I have to run stunnel on the pg box as well. My question is that client only stunnel to pg server requiring ssl

Re: [GENERAL] stunnel with just postgresql client part

2011-05-09 Thread Merlin Moncure
On Mon, May 9, 2011 at 5:03 PM, zhong ming wu mr.z.m...@gmail.com wrote: On Mon, May 9, 2011 at 4:37 PM, Merlin Moncure mmonc...@gmail.com wrote: I was not setting protocol.  But since I got your message, I tried 'protocol = pgsql' in stunnel.conf see: http

Re: [GENERAL] stunnel with just postgresql client part

2011-05-09 Thread Merlin Moncure
On Mon, May 9, 2011 at 7:17 PM, zhong ming wu mr.z.m...@gmail.com wrote: On Mon, May 9, 2011 at 6:42 PM, Merlin Moncure mmonc...@gmail.com wrote: Thanks.  Yes, when I installed the latest stunnel-4.36 it works. One strange thing I notice.  When I do ssl connect with psql I am supposed to get

Re: [GENERAL] Generating fields in views with search/replace?

2011-05-05 Thread Merlin Moncure
On Thu, May 5, 2011 at 9:09 AM, Asfand Qazi (Sanger Institute) aq2.san...@gmail.com wrote: Hi, Say I have a table with fields 'template' and 'original_letter', and 'new_selected_letter'.  'template' could be 'abcdefg0abcdefg', original_letter could be 'A' and new_selected_letter could be 'B'.

Re: [GENERAL] dblink() from GridSQL

2011-05-05 Thread Merlin Moncure
On Thu, May 5, 2011 at 12:13 PM, Sam Nelson s...@consistentstate.com wrote: Hi List, We have a customer who is trying to migrate a few PostgresPlus instances to GridSQL clusters.  They have a process that pulls data from another server using dblink every night, and we're trying to replicate

Re: [GENERAL] multiple sequence number for one column

2011-05-05 Thread Merlin Moncure
On Thu, May 5, 2011 at 1:54 PM, mirthcyy mirth...@gmail.com wrote: hi group, we need help on one postgresql locking issue: Originally we have a table like below; id bigint not null nextval('xxx)', customer_id int not null, insert_record_date timestamp not null ... so this id column is

Re: [GENERAL] pervasiveness of surrogate (also called synthetic) keys

2011-05-04 Thread Merlin Moncure
On Wed, May 4, 2011 at 7:14 AM, Misa Simic misa.si...@gmail.com wrote: 2011/4/28 Merlin Moncure mmonc...@gmail.com On Thu, Apr 28, 2011 at 12:29 PM, Jim Irrer ir...@umich.edu wrote: *) most tables don't have unique natural keys (let's see em) etc i.e for an Invoice, we have at least 2

Re: [GENERAL] pervasiveness of surrogate (also called synthetic) keys

2011-05-04 Thread Merlin Moncure
On Wed, May 4, 2011 at 7:50 AM, Misa Simic misa.si...@gmail.com wrote: 2011/5/4 Merlin Moncure mmonc...@gmail.com Most of the old school accounting systems maintained an invoice line number. Invoice Line     -Invoice Number     -LineNo     -ItemID     -qty     -Price The line

Re: [GENERAL] pervasiveness of surrogate (also called synthetic) keys

2011-05-04 Thread Merlin Moncure
On Wed, May 4, 2011 at 2:25 AM, Greg Smith g...@2ndquadrant.com wrote: David Johnston wrote: Is there any rules-of-thumb on the performance of a PK as a function of key length?  I like using varchar based identifiers since I tend to query tables directly and writing where clauses is much

Re: [GENERAL] ZEOS or PGDAC - How to lock a resource?

2011-05-04 Thread Merlin Moncure
2011/5/4 durumdara durumd...@gmail.com: Hi! We will porting an application to PGSQL from some table based app (BDE like). The older application used a special technic of the driver: if a record edited, some exclusive (over transaction), forever living lock put on it. On exit, cancel, or

Re: [GENERAL] pervasiveness of surrogate (also called synthetic) keys

2011-05-03 Thread Merlin Moncure
On Mon, May 2, 2011 at 11:53 PM, Craig Ringer cr...@postnewspapers.com.au wrote: On 03/05/11 11:07, Greg Smith wrote: That doesn't mean you can't use them as a sort of foreign key indexing the data; it just means you can't make them the sole unique identifier for a particular entity, where

Re: [GENERAL] [ADMIN] Can we Flush the Postgres Shared Memory ?

2011-05-03 Thread Merlin Moncure
On Tue, May 3, 2011 at 8:30 AM, raghu ram raghuchenn...@gmail.com wrote: On Tue, May 3, 2011 at 6:01 PM, Raghavendra raghavendra@enterprisedb.com wrote: On Tue, May 3, 2011 at 5:37 PM, Simon Riggs si...@2ndquadrant.com wrote: On Tue, May 3, 2011 at 11:54 AM, raghu ram

<    5   6   7   8   9   10   11   12   13   14   >