Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Massa, Harald Armin
Dave, please also check out the licence and costs terms in detail. Especially: is it given that the planned usage willl continue to be within the allowed bounds for MySQL-GPL? Are otherwise the costs for MySQL-commercial budgeted or a reserve founded? PostgreSQL has here a GIANT advantage with a

Re: [GENERAL] Training and open source

2009-12-17 Thread Picavet Vincent
Hi, Would one day the Talend people understand that Astroturfing is definitly not a good marketing strategy ? Please stop your lame posting once and for all, we are all tired of reading your useless babbling. Vincent -Message d'origine- De : pgsql-general-ow...@postgresql.org

[GENERAL] flagging first row inserted for each group of key

2009-12-17 Thread Ivan Sergio Borgonovo
I've a web application. I'm logging data related to the landing page and subsequent selected hits. create table track_hit ( hitid serial not null, /* pk? I don't mind if serial wrap around pk could be (hitid, tracking_time) */ esid varchar(32), -- related to session tracking_time

Re: [GENERAL] flagging first row inserted for each group of key

2009-12-17 Thread A. Kretschmer
In response to Ivan Sergio Borgonovo : I've a web application. I'm logging data related to the landing page and subsequent selected hits. create table track_hit ( hitid serial not null, /* pk? I don't mind if serial wrap around pk could be (hitid, tracking_time) */ esid

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Erik Jones
On Dec 16, 2009, at 10:30 PM, Craig Ringer wrote: - If you don't care about your data, MySQL used with MyISAM is *crazy* fast for lots of small simple queries. This one causes me no end of grief as too often it's simply touted as MyISAM is fast(er) while leaving of the bit about for lots of

Re: [GENERAL] flagging first row inserted for each group of key

2009-12-17 Thread Ivan Sergio Borgonovo
On Thu, 17 Dec 2009 10:38:32 +0100 A. Kretschmer andreas.kretsch...@schollglas.com wrote: In response to Ivan Sergio Borgonovo : I've a web application. I'm logging data related to the landing page and subsequent selected hits. create table track_hit ( hitid serial not null,

[GENERAL] FW: postgres 8.2.4 cores on SUN

2009-12-17 Thread Abraham, Danny
Hi, postgres cores on SUN 2.9. Disk is in 100% IO. (dbx) where [1] 0x65eacdd4(0x7fffa36c, 0x400, 0x10032d4e8, 0x1, 0x48, 0xd6), at 0x65eacdd4 [2] XLogFileInit(0x48, 0xd6, 0x7fffa85d, 0x1, 0x488000, 0x0), at 0x10007955c [3] XLogWrite(0x48, 0x6, 0x1,

[GENERAL] postgres 8.2.4 cores on SUN

2009-12-17 Thread Abraham, Danny
Hi, postgres cores on SUN 2.9. Disk is in 100% IO. (dbx) where [1] 0x65eacdd4(0x7fffa36c, 0x400, 0x10032d4e8, 0x1, 0x48, 0xd6), at 0x65eacdd4 [2] XLogFileInit(0x48, 0xd6, 0x7fffa85d, 0x1, 0x488000, 0x0), at 0x10007955c [3] XLogWrite(0x48, 0x6, 0x1,

Re: [GENERAL] Slow select

2009-12-17 Thread Sam Mason
On Wed, Dec 16, 2009 at 05:18:12PM -0800, yuliada wrote: Sam Mason wrote: How about combining all 1000 selects into one? I can't combine these selects into one, I need to run them one after another. Hum, difficult. What other information is in the row that you need back? Can you turn the

[GENERAL] Table Partitioning Advice Request

2009-12-17 Thread Vincenzo Romano
Hi all. I'm planning to implement table partitioning as suggested (among other sources) in the official documentation. I'm using v8.4.2 at the moment. My case is far from the general one as: 1. I'll never UPDATE or DELETE rows from partitioned tables (only INSERTs) 2. Rows will be inserted

Re: [GENERAL] Table Partitioning Advice Request

2009-12-17 Thread Sam Jas
Rule is not advisable, Trigger is the best solution. --- Thanks Sam Jas --- On Thu, 17/12/09, Vincenzo Romano vincenzo.rom...@notorand.it wrote: From: Vincenzo Romano vincenzo.rom...@notorand.it Subject: [GENERAL] Table Partitioning Advice Request To: pgsql-general@postgresql.org Date:

Re: [GENERAL] Table Partitioning Advice Request

2009-12-17 Thread Vincenzo Romano
Why? If you have to choose among a couple hundred partition tables, the trigger function body is far from trivial! You really think that calling and running a trigger function for every line is the best solution? 2009/12/17 Sam Jas samja...@yahoo.com Rule is not advisable, Trigger is the best

Re: [GENERAL] How to get text for a plpgsql variable from a file.

2009-12-17 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 NotDashEscaped: You need GnuPG to verify this message I need a long text form from a file in my plpgsql variable. Can anyone think

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 - MySQL is horizontally scalable via clustering and multi-master replication (though you must beware of numerous gotchas). PostgreSQL can be

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Merlin Moncure
On Wed, Dec 16, 2009 at 4:02 PM, Gauthier, Dave dave.gauth...@intel.com wrote: Hi Everyone: Tomorrow, I will need to present to a group of managers (who know nothing about DBs) why I chose to use PG over MySQL in a project, MySQL being the more popular DB choice with other engineers, and

Re: [GENERAL] Table Partitioning Advice Request

2009-12-17 Thread David Fetter
On Thu, Dec 17, 2009 at 02:41:40PM +0100, Vincenzo Romano wrote: 2009/12/17 Sam Jas samja...@yahoo.com Rule is not advisable, Trigger is the best solution. If you have to choose among a couple hundred partition tables, the trigger function body is far from trivial! It's possible to

Re: [GENERAL] Table Partitioning Advice Request

2009-12-17 Thread Vincenzo Romano
2009/12/17 David Fetter da...@fetter.org: You really think that calling and running a trigger function for every line is the best solution? Yes.  The trigger function is choosing from a small subset of the tables, or you know which tables exactly the rows are going into and insert them

Re: [GENERAL] Automatic truncation of character values casting to the type of a column type

2009-12-17 Thread Justin Bailey
On Wed, Dec 16, 2009 at 7:20 PM, Tom Lane t...@sss.pgh.pa.us wrote: Really?  Works for me, in everything back to 7.3. I must be missing something, because this function fails: CREATE OR REPLACE FUNCTION insertShort() RETURNS VOID AS $BODY$ DECLARE s Short.shortCol%TYPE; BEGIN

Re: [GENERAL] Automatic truncation of character values casting to the type of a column type

2009-12-17 Thread Tom Lane
Justin Bailey jgbai...@gmail.com writes: On Wed, Dec 16, 2009 at 7:20 PM, Tom Lane t...@sss.pgh.pa.us wrote: Really?  Works for me, in everything back to 7.3. If s was automatically truncated, the insert would succeed, but it fails with a value too long error. Oh, I thought the failure was

Re: [GENERAL] Table Partitioning Advice Request

2009-12-17 Thread Vincenzo Romano
2009/12/17 Sam Jas samja...@yahoo.com Rule is not advisable, Trigger is the best solution. Does the trigger solution need the TABLE CHECK constraint? It looks to me it won't. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Table Partitioning Advice Request

2009-12-17 Thread Dimitri Fontaine
Vincenzo Romano vincenzo.rom...@notorand.it writes: Is there any performance study for the trigger-based implementation? Consider that if you use RULE to partition, when you DROP a partition the INSERTs are locked out because the query depends on the table being droped. That alone could lead

Re: [GENERAL] Automatic truncation of character values casting to the type of a column type

2009-12-17 Thread Sam Mason
On Thu, Dec 17, 2009 at 10:24:28AM -0500, Tom Lane wrote: Justin Bailey jgbai...@gmail.com writes: If s was automatically truncated, the insert would succeed, but it fails with a value too long error. Oh, I thought the failure was the behavior you wanted. There's no automatic truncation

Re: [GENERAL] Automatic truncation of character values casting to the type of a column type

2009-12-17 Thread Adrian Klaver
On Wednesday 16 December 2009 5:05:19 pm Justin Bailey wrote: Greetings! I am trying to avoid the old problem of inserting a 40 character string into a 20 character field. However, I'd like to avoid hard-coding the acceptable length (20). Is there a way to say cast to the same type as a given

Re: [GENERAL] Table Partitioning Advice Request

2009-12-17 Thread Vincenzo Romano
2009/12/17 Dimitri Fontaine dfonta...@hi-media.com: Vincenzo Romano vincenzo.rom...@notorand.it writes: Is there any performance study for the trigger-based implementation? Consider that if you use RULE to partition, when you DROP a partition the INSERTs are locked out because the query

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Gauthier, Dave
They just called the meeting, or at least that part of it. There seems to be a battle brewing, some MySQL advocates are angry, concerned, fearful, ... I dont know why for sure. My managers, who advocate my position and PG are preparing, but the decision will be made by higher-ups who really

[GENERAL] Extended Query using the Frontend/Backend Protocol 3.0

2009-12-17 Thread Raimon Fernandez
Hello again, I'm trying to integrate the extended query protocol with my libraries. I'm sending a simple SELECT to validate the method, but I'm getting an Invalid Message Format. 50 = P 00 00 00 29 = length 6D7973746174656D656E74 00 = mystatement + null

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Grzegorz Jaśkiewicz
On Thu, Dec 17, 2009 at 3:55 PM, Gauthier, Dave dave.gauth...@intel.com wrote: They just called the meeting, or at least that part of it.  There seems to be a battle brewing, some MySQL advocates are angry, concerned, fearful, ... I dont know why for sure. in places like that it is

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Gauthier, Dave
Actually, the DB I'm working on is rather small but has a somewhat complex system of constraints and triggers that maintain the data. Queries will outnumber writes (20x at least). And the DB has to be mirrorred at a sister site a couple thousand miles away, so I'm looking for a robust DB

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Gauthier, Dave
How difficult is it to switch the master's hat from one DB instance to another? Let's say the master in a master-slave scenario goes down but the slave is fine. Can I designate the slave as being the new master, use it for read/write, and then just call the broken master the new slave once it

Re: [GENERAL] How to get text for a plpgsql variable from a file.

2009-12-17 Thread Erik Jones
On Dec 16, 2009, at 11:19 AM, Erwin Brandstetter wrote: Hello, I need a long text form from a file in my plpgsql variable. Can anyone think of a more straightforward way to read the file than the following: CREATE FUNCTION test() RETURNS void AS $BODY$ DECLARE mytxt

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Richard Broersma
On Thu, Dec 17, 2009 at 8:23 AM, Gauthier, Dave dave.gauth...@intel.com wrote: How difficult is it to switch the master's hat from one DB instance to another?  Let's say the master in a master-slave scenario goes down but the slave is fine.  Can I designate the slave as being the new master,

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 How difficult is it to switch the master's hat from one DB instance to another? Let's say the master in a master-slave scenario goes down

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Dimitri Fontaine
Gauthier, Dave dave.gauth...@intel.com writes: I am more concerned with getting a robust DB replication system up and running. Bucardo looks pretty good, but I've just started looking at the options. Any suggestions? Master Slave replication? Meaning no writes on the sister site. If yes,

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Kevin Kempter
On Thursday 17 December 2009 09:51:19 Richard Broersma wrote: On Thu, Dec 17, 2009 at 8:23 AM, Gauthier, Dave dave.gauth...@intel.com wrote: How difficult is it to switch the master's hat from one DB instance to another? Let's say the master in a master-slave scenario goes down but the

Re: [GENERAL] pg_dump and ON DELETE CASCADE problem

2009-12-17 Thread CG
--- On Tue, 12/15/09, Adrian Klaver akla...@comcast.net wrote: From: Adrian Klaver akla...@comcast.net Subject: Re: [GENERAL] pg_dump and ON DELETE CASCADE problem To: cgg...@yahoo.com Cc: postgresql listserv pgsql-general@postgresql.org, Craig Ringer cr...@postnewspapers.com.au, Scott

[GENERAL] Trigger function language

2009-12-17 Thread Vincenzo Romano
Hi all. Is there any performance difference in writing trigger function in SQL rather than PL/PgSQL? In my case the body would actually be 1 line. -- Vincenzo Romano NON QVIETIS MARIBVS NAVTA PERITVS -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread John R Pierce
Gauthier, Dave wrote: Hi Everyone: Tomorrow, I will need to present to a group of managers (who know nothing about DBs) why I chose to use PG over MySQL in a project, MySQL being the more popular DB choice with other engineers, and managers fearing things that are “different” (risk). I have

Re: [GENERAL] Trigger function language

2009-12-17 Thread Tom Lane
Vincenzo Romano vincenzo.rom...@notorand.it writes: Is there any performance difference in writing trigger function in SQL rather than PL/PgSQL? SQL functions don't support being called as triggers, so performance questions are a bit beside the point ... regards, tom

Re: [GENERAL] postgres 8.2.4 cores on SUN

2009-12-17 Thread John R Pierce
Abraham, Danny wrote: “postgres” cores on SUN 2.9. Disk is in 100% IO. (dbx) where [1] 0x65eacdd4(0x7fffa36c, 0x400, 0x10032d4e8, 0x1, 0x48, 0xd6), at 0x65eacdd4 [2] XLogFileInit(0x48, 0xd6, 0x7fffa85d, 0x1, 0x488000, 0x0), at 0x10007955c ... Any idea?

Re: [GENERAL] How to remove non-UTF values from a table?

2009-12-17 Thread Bruce Momjian
Tom Lane wrote: Raymond O'Donnell r...@iol.ie writes: On 16/12/2009 15:01, Richard Broersma wrote: It looks like the future 8.5 release will be able to preform an in-place upgrade on 8.4. Really? That would be *wonderful*. I know it's impossible to be definitive, but how likely would

Re: [GENERAL] How to remove non-UTF values from a table?

2009-12-17 Thread Bruce Momjian
Tom Lane wrote: Raymond O'Donnell r...@iol.ie writes: On 16/12/2009 15:01, Richard Broersma wrote: It looks like the future 8.5 release will be able to preform an in-place upgrade on 8.4. Really? That would be *wonderful*. I know it's impossible to be definitive, but how likely would

Re: [GENERAL] How to remove non-UTF values from a table?

2009-12-17 Thread Bruce Momjian
Bruce Momjian wrote: pg_migrator (not pg_upgrade) has been used by many people to migrate from 8.3 to 8.4. I just helped someone yesterday with a migration. pg_migrator threw an error because they had reindexed pg_largeobject, and pg_migrator was not prepared to handle that. They also had

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Madison Kelly
Gauthier, Dave wrote: Hi Everyone: Tomorrow, I will need to present to a group of managers (who know nothing about DBs) why I chose to use PG over MySQL in a project, MySQL being the more popular DB choice with other engineers, and managers fearing things that are “different” (risk). I

Re: [GENERAL] Server Requirements

2009-12-17 Thread Madison Kelly
Christine Penner wrote: Hi, If we have clients that are going to buy new computers or upgrade current ones, what we can recommend to them for optimal system performance to run Postgres. These can be servers or desktop PCs. We can have from 1-10 users in at a time. At this point all of our

[GENERAL] alter table performance

2009-12-17 Thread Antonio Goméz Soto
Hi, I am regularly altering tables, adding columns setting default values etc. This very often takes a very long time and is very disk intensive, and this gets pretty annoying. Things are hampered by the fact that some of our servers run PG 7.3 Suppose I have a table and I want to add a non

[GENERAL] feature request: create table with unique constraint

2009-12-17 Thread wumpus
begin ; create table a ( id serial primary key , info text not null -- not interested here ) ; create table b ( id serial primary key , a_id int not null references a , info text not null -- not interested here , actual bool not null ) ; create unique index b_actual on b ( a_id ,

Re: [GENERAL] alter table performance

2009-12-17 Thread Alan Hodgson
On Thursday 17 December 2009, Antonio Goméz Soto antonio.gomez.s...@gmail.com wrote: Hi, I am regularly altering tables, adding columns setting default values etc. This very often takes a very long time and is very disk intensive, and this gets pretty annoying. Things are hampered by the

Re: [GENERAL] alter table performance

2009-12-17 Thread Thomas Kellerer
Antonio Goméz Soto wrote on 17.12.2009 22:26: Hi, I am regularly altering tables, adding columns setting default values etc. This very often takes a very long time and is very disk intensive, and this gets pretty annoying. Things are hampered by the fact that some of our servers run PG 7.3

Re: [GENERAL] pg_dump and ON DELETE CASCADE problem

2009-12-17 Thread Adrian Klaver
- CG cgg...@yahoo.com wrote: --- On Tue, 12/15/09, Adrian Klaver akla...@comcast.net wrote: From: Adrian Klaver akla...@comcast.net Subject: Re: [GENERAL] pg_dump and ON DELETE CASCADE problem To: cgg...@yahoo.com Cc: postgresql listserv pgsql-general@postgresql.org, Craig

Re: [GENERAL] feature request: create table with unique constraint

2009-12-17 Thread Tom Lane
wum...@z1p.biz writes: , unique ( a_id , ( case when actual then 0 else id end ) ) Why can i not define the unique constraint in the create table? The syntax for a unique constraint in CREATE TABLE is defined by the SQL standard, and it doesn't include expressions. More than the syntax, a

Re: [GENERAL] alter table performance

2009-12-17 Thread Tom Lane
Thomas Kellerer spam_ea...@gmx.net writes: What's wrong with: alter table person add column address varchar(64) not null default ''; This: regression=# alter table person add column address varchar(64) not null default ''; ERROR: Adding columns with defaults is not implemented. Add

Re: [GENERAL] Installing PL/pgSQL by default

2009-12-17 Thread Bruce Momjian
Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian br...@momjian.us writes: I installed PL/pgSQL by default via initdb with the attached patch. The only problem is that pg_dump still dumps out the language creation: CREATE PROCEDURAL LANGUAGE plpgsql; ALTER PROCEDURAL LANGUAGE

Re: [GENERAL] Table Partitioning Advice Request

2009-12-17 Thread Scott Marlowe
On Thu, Dec 17, 2009 at 8:29 AM, Vincenzo Romano vincenzo.rom...@notorand.it wrote: 2009/12/17 Sam Jas samja...@yahoo.com Rule is not advisable, Trigger is the best solution. Does the trigger solution need the TABLE CHECK constraint? It looks to me it won't. The table check constraint is

Re: [GENERAL] alter table performance

2009-12-17 Thread Antonio Goméz Soto
Op 17-12-09 23:46, Tom Lane schreef: This is just one of many many things that could be improved by getting off of 7.3. In general, complaining about performance (or features) of a seven-year-old, long since EOL'd release is not a productive use of anybody's time. I'm sorry, didn't mean

Re: [GENERAL] Extended Query using the Frontend/Backend Protocol 3.0

2009-12-17 Thread John DeSoi
On Dec 17, 2009, at 11:13 AM, Raimon Fernandez wrote: I'm trying to integrate the extended query protocol with my libraries. I'm sending a simple SELECT to validate the method, but I'm getting an Invalid Message Format. I did not add up your byte count, but maybe this will help:

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Scott Marlowe
On Thu, Dec 17, 2009 at 12:35 PM, Madison Kelly li...@alteeve.com wrote: Gauthier, Dave wrote: Hi Everyone: Tomorrow, I will need to present to a group of managers (who know nothing about DBs) why I chose to use PG over MySQL in a project, MySQL being the more popular DB choice with other

Re: [GENERAL] Server Requirements

2009-12-17 Thread Scott Marlowe
On Wed, Dec 16, 2009 at 4:21 PM, Christine Penner christ...@ingenioussoftware.com wrote: Hi, If we have clients that are going to buy new computers or upgrade current ones, what we can recommend to them for optimal system performance to run Postgres. These can be servers or desktop PCs. We

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Gauthier, Dave
One concern I have about these trigger based replication systems is that I fear it may ping the slave for each and every DML statement separately in time and in a transaction. My slave will literally be 1400 miles away and all replication communications will be over the net. If I have a

Re: [GENERAL] pg_dump and ON DELETE CASCADE problem

2009-12-17 Thread CG
--- On Thu, 12/17/09, Adrian Klaver akla...@comcast.net wrote: Would it be possible to see the table schemas and indices ? Sure (you asked for it!!) : CREATE TABLE packet ( id integer NOT NULL DEFAULT nextval('packet_id_seq'::regclass), packet_uuid uniqueidentifier NOT NULL

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Scott Marlowe
I would recommend using a traffic shaping router (like the one built into the linux kernel and controlled by tc / iptables) to simulate a long distance connection and testing this yourself to see which replication engine will work best for you. On Thu, Dec 17, 2009 at 7:35 PM, Gauthier, Dave

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 One concern I have about these trigger based replication systems is that I fear it may ping the slave for each and every DML statement separately in time and in a transaction. My slave will literally

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread David Boreham
Scott Marlowe wrote: I would recommend using a traffic shaping router (like the one built into the linux kernel and controlled by tc / iptables) to simulate a long distance connection and testing this yourself to see which replication engine will work best for you. Netem :

Re: [GENERAL] Justifying a PG over MySQL approach to a project

2009-12-17 Thread Scott Marlowe
On Thu, Dec 17, 2009 at 7:51 PM, David Boreham david_l...@boreham.org wrote: Scott Marlowe wrote: I would recommend using a traffic shaping router (like the one built into the linux kernel and controlled by tc / iptables) to simulate a long distance connection and testing this yourself to see

[GENERAL] order of trigger firing relative to column/table constraints

2009-12-17 Thread Daniel Popowich
I am designing a DB where column/table constraints are not sufficient for data integrity (e.g., guaranteeing non-recursive tree graphs) so I'm writing my first complicated triggers and I have been searching docs and archives of this list for detailed information on when triggers are fired

Re: [GENERAL] Table Partitioning Advice Request

2009-12-17 Thread Vincenzo Romano
2009/12/18 Scott Marlowe scott.marl...@gmail.com: The main reason to avoid rules is that they're much less efficient than triggers.  We use partitioning at work for our stats db, and partition by day, and we have about 2 years worth of stats data, so our insert trigger has about 700 if /

Re: [GENERAL] order of trigger firing relative to column/table constraints

2009-12-17 Thread Craig Ringer
On 18/12/2009 1:18 PM, Daniel Popowich wrote: For example, it was at first surprising to discover in my before-row trigger that foreign key constraints had not yet been checked (which I assumed I could take for granted in my trigger since I had defined the column constraint). Nope. CHECK