[GENERAL] Reset privileges to builtin defaults

2017-04-28 Thread Diego Augusto Molina
Hi, I've been charged with the administration of a couple of big databases in an old 8.1 cluster. The databases have many administrative issues, privileges being the most prominent for my job. All objects have privileges for specific personal end-user roles (dozens and dozens of privileges each obj

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-10-03 Thread Diego Augusto Molina
12 Jul 2011 00:45:01 +0000 2011/10/2, Diego Augusto Molina : > solved if we use no composite at all! Instead of a field with an array > of a composite of three instrinsics, use three fields, each of an > intrinsic type. See your proposal: Errata: "use three fields, each *one b

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-10-02 Thread Diego Augusto Molina
s. It is written in C, so I assume it runs much, much faster (specially needed for highly transactional DBs). But it's not proven to be binary safe (which I don't remember what that is). Bugs: nothing known. So, if you need to be able to restore your table as of any time, use tablelo

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-28 Thread Diego Augusto Molina
or the next version, which I hope that also checks some TODO's in the list. When I get home I'll send the current code attached and when I get some fresh air at work I'll make the changes and post the new version. Any other ideas for the new version? (get some previews in the

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-28 Thread Diego Augusto Molina
shortening each time with the growing system. The *real* system is very discreet with I/U/D operations: it's not usual to have more than one of those operations per second. For higher transactional systems I think this logging system would be more noticeable (right now things go smooth). As

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-27 Thread Diego Augusto Molina
2011/9/27, Diego Augusto Molina : > Honestly, I don't remember why I used triggers instead of rules in the > "audit" and "audet" tables. I remember now, that's because in my case, operations over tuples are done very lightly (one or two in the same sentenc

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-27 Thread Diego Augusto Molina
many long-long lines, except for those whoch are comments. Honestly, I don't remember why I used triggers instead of rules in the "audit" and "audet" tables. -- Diego Augusto Molina diegoaugustomol...@gmail.com ES: Por favor, evite adjuntar documentos de Microsoft Office. Se

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-27 Thread Diego Augusto Molina
/* Created by Diego Augusto Molina in 2011 for Tucuman Government, Argentina. */ /* -- Execute the following accordingly to your needs. CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'; CREATE TRUSTED PROCEDURAL LANGUAGE 'plperl'; */ CREATE ROLE auditor N

[GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-26 Thread Diego Augusto Molina
ote that upgrading is not always a choice). Will it worth pasting the little code in here or that'll be ignored? -- Diego Augusto Molina diegoaugustomol...@gmail.com ES: Por favor, evite adjuntar documentos de Microsoft Office. Serán desestimados. EN: Please, avoid attaching Microsoft Office docu

Re: [GENERAL] Grouping by timestamp, how to return 0 when there's no record

2011-09-19 Thread Diego Augusto Molina
Hi, this may be a start: -- This will make our day better :) with base_query (tstmp) as ( select DATE_TRUNC('hour',timestamp) as tstmp FROM record WHERE record.timestamp BETWEEN ( CURRENT_TIMESTAMP + INTERVAL '-7 day') and (CURRENT_TIMESTAMP) -- this I don't under

Re: [GENERAL] Clean way to insert records if they don't exist, update if they do

2011-09-19 Thread Diego Augusto Molina
de for quiet a long time with no drawbacks; it worked perfectly fine for me (tested it nice with a heavy load, in production things were more quiet). What's more, I find this approach very appropiate from the "programming" point of view. Correct me if I'm wrong. -- Diego Augusto Mo

Re: [GENERAL] How can I merge two tables?

2011-09-01 Thread Diego Augusto Molina
e PK. This is slow! specially with large data sets. Once you've got the data in one DB, you can use some replication system if you want to have that DB in all your machines. One of that systems is Slony-I, though I haven't tried it. -- Diego Augusto Molina diegoaugustomol...@gmail.com

[GENERAL] Dump database roles for full restoration

2011-08-19 Thread Diego Augusto Molina
so expect some comments and/or corrections. NOTICE: the privileged function was already successfully tested in a production environment between two 8.4 servers. -- Diego Augusto Molina diegoaugustomol...@gmail.com ES: Por favor, evite adjuntar documentos de Microsoft Office. Serán desestimados. EN: P

Re: [GENERAL] is max connections in a database table somewhere

2011-08-11 Thread Diego Augusto Molina
www.postgresql.org/docs/9.0/interactive/catalog-pg-database.html. But this would be the appropiate way of getting the value: > SELECT CAST(current_setting('max_connections') AS integer); You would rather use that form instead of messing up with the catalogs. -- Diego Augusto Molin

Re: [GENERAL] Indicating DEFAULT values in INSERT statement

2011-08-09 Thread Diego Augusto Molina
ithout `EXECUTE') but couldn't find it. Sorry. -- Diego Augusto Molina diegoaugustomol...@gmail.com ES: Por favor, evite adjuntar documentos de Microsoft Office. Serán desestimados. EN: Please, avoid attaching Microsoft Office documents. They shall be discarded. LINK: http://www.gnu.org/

Re: [GENERAL] Indicating DEFAULT values in INSERT statement

2011-08-09 Thread Diego Augusto Molina
expression | DEFAULT }" syntax you would have the "expression" syntax, which would include the case of having just "DEFAULT" as an expression. It's just a matter of understanding the syntax. Cheers! -- Diego Augusto Molina diegoaugustomol...@gmail.com ES: Por f