Re: [GENERAL] How to make a non-removable row in a table?

2011-12-19 Thread Thomas Markus
Hi, simple violate a contraint. my test: drop table if exists x; create temp table x ( id int not null primary key, name text ); -- check against not null create rule test_rule as on delete to x where old.id=1 do instead update x set id=null; insert into x values( 1,'a'),(2,'b'); select *

[GENERAL] Re: [pgeu-general] REMINDER: FOSDEM 2012 - PostgreSQL Devroom: Call for Speakers

2011-12-19 Thread Emanuel Calvo
Please keep in mind, that the Call for Speakers is open until December 20th. Only a few days left. Now it's a good time to submit your proposal ;-) Did someone applied? -- --               Emanuel Calvo               Helpame.com -- Sent via pgsql-general mailing list

Re: [GENERAL] indexes and tables

2011-12-19 Thread Misa Simic
Hi Amit, Have you maybe tested what David J has suggested? In other words it is: • Create 10 tables with their columns and indexes on each t1(a1,a2,a3) t2(b1,b2,b3) . . . t10(n1,n2,n3) •Create VIEW with union all 10 tables SELECT a1 AS f1, a2 as f2, a3 as f3 from t1 Union SELECT b1 as f1, b2 as

Re: [GENERAL] segfault with plproxy

2011-12-19 Thread Marko Kreen
On Sat, Dec 17, 2011 at 10:25:40PM +0100, Filip Rembiałkowski wrote: Following scrip causes segmentation fault. Any ideas why / how to diagnose? create table part0.users( check(id%2=0) ) inherits (public.users); create table part1.users( check(id%2=1) ) inherits (public.users); create or

Re: [GENERAL] Logical Aggregate Functions (eg ANY())

2011-12-19 Thread Marti Raudsepp
On Mon, Dec 19, 2011 at 06:32, Merlin Moncure mmonc...@gmail.com wrote: that would require that the planner have very special understanding of the internal workings of aggregate functions.  There are a couple of cases where the planner *does* have that function, for example it can convert

[GENERAL] Escaping input from COPY

2011-12-19 Thread Roger Leigh
Hi folks, In a Perl application I would like to frequently bulk load several hundred thousand rows of data into a temporary table before merging the contents into the database proper. I'm currently doing individual INSERTs into the temporary table, which has obviously got a significant

Re: [GENERAL] segfault with plproxy

2011-12-19 Thread Filip Rembiałkowski
W dniu 19 grudnia 2011 10:39 użytkownik Marko Kreen mark...@gmail.com napisał: On Sat, Dec 17, 2011 at 10:25:40PM +0100, Filip Rembiałkowski wrote: Following scrip causes segmentation fault. Any ideas why / how to diagnose? create table part0.users( check(id%2=0) ) inherits (public.users);

Re: [GENERAL] segfault with plproxy

2011-12-19 Thread Filip Rembiałkowski
W dniu 19 grudnia 2011 10:39 użytkownik Marko Kreen mark...@gmail.com napisał: It seems you are making plproxy call public.list_users() recursively. Postgres probably OOM-s somewhere then. I have log_statement='all' and the function is called only once: 2011-12-19 13:15:11 CET 20416 [local]

[GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread MURAT KOÇ
Hi List, When I try to change my db password like below SQL statement from psql or pgAdmin tool, it outputs to server logs as like this: *postgres=# alter user mkoc password 'dummy'; ALTER ROLE postgres=# alter user mkoc with password 'dummy'; ALTER ROLE * ### Server Logs ### 2011-12-19

Re: [GENERAL] Logical Aggregate Functions (eg ANY())

2011-12-19 Thread Merlin Moncure
On Mon, Dec 19, 2011 at 3:42 AM, Marti Raudsepp ma...@juffo.org wrote: In fact, there's no reason why bool_or/bool_and couldn't do the same thing. bool_or() is like the max() for boolean values, and bool_and() is min(). CREATE AGGREGATE my_bool_or(bool) (sfunc=boolor_statefunc, stype=bool,

[GENERAL] consecutive analyze calls with different column lists.

2011-12-19 Thread Marc Mamin
Hello, If I call analyze 2 times, e.g. analyze mytable (column_a, column_b); analyze mytable (column_a, column_c); then I will loose statisics on column_b. correct ? many thanks, Marc Mamin

Re: [GENERAL] ignore duplicate key while using COPY?

2011-12-19 Thread Adrian Klaver
On Sunday, December 18, 2011 10:54:21 pm Yan Chunlu wrote: I am using COPY public.table_name FROM STDIN to import data. it is very efficient, but if there's any duplicate key exists, the whole procedure has been stopped. is there anyway to around this? why does not postgresql just give a

Fwd: [GENERAL] consecutive analyze calls with different column lists.

2011-12-19 Thread David Johnston
Forgot to reply-all Begin forwarded message: From: David Johnston pol...@yahoo.com Date: December 19, 2011 8:09:36 EST To: Marc Mamin m.ma...@intershop.de Subject: Re: [GENERAL] consecutive analyze calls with different column lists. On Dec 19, 2011, at 8:04, Marc Mamin

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Guillaume Lelarge
On Mon, 2011-12-19 at 15:01 +0200, MURAT KOÇ wrote: Hi List, When I try to change my db password like below SQL statement from psql or pgAdmin tool, it outputs to server logs as like this: *postgres=# alter user mkoc password 'dummy'; ALTER ROLE postgres=# alter user mkoc with password

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Adrian Klaver
On Monday, December 19, 2011 5:01:28 am MURAT KOÇ wrote: Hi List, When I try to change my db password like below SQL statement from psql or pgAdmin tool, it outputs to server logs as like this: *postgres=# alter user mkoc password 'dummy'; ALTER ROLE postgres=# alter user mkoc with

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread MURAT KOÇ
Thanks for reply. But it's not suitable to trust the people who have access to the logs. Think, I changed my DB password and other DBA colleague who has access to the PostgreSQL logs has seen my DB password. He started to use my DB password instead of his password. He executed all DDL and DML

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread MURAT KOÇ
Hi Adrian, I wrote a desktop application on Windows by using Npgsql.dll. So, I send SQL statement to database from this application code. I can't use psql command line (I know \password command changes password encrypted text). Because of this, I have to use ALTER USER statement from application

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Alban Hertroys
On 19 December 2011 16:26, MURAT KOÇ m.ko...@gmail.com wrote: Hi Adrian, I wrote a desktop application on Windows by using Npgsql.dll. So, I send SQL statement to database from this application code. I can't use psql command line (I know \password command changes password encrypted text).

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Guillaume Lelarge
On Mon, 2011-12-19 at 17:19 +0200, MURAT KOÇ wrote: Thanks for reply. But it's not suitable to trust the people who have access to the logs. Think, I changed my DB password and other DBA colleague who has access to the PostgreSQL logs has seen my DB password. He started to use my DB

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Adrian Klaver
On Monday, December 19, 2011 7:26:33 am MURAT KOÇ wrote: Hi Adrian, I wrote a desktop application on Windows by using Npgsql.dll. So, I send SQL statement to database from this application code. I can't use psql command line (I know \password command changes password encrypted text).

[GENERAL] fsync on ext4 does not work

2011-12-19 Thread Havasvölgyi Ottó
Hi all, Somewhy fsync does not work for me. PgSql 9.1.2 Debian, 2.6.32 kernel WAL filesystem: ext4 with defaults config: fsync=on sync_commit=on wal_sync_method=fsync Even though the TPS in pgbench about 700 with 1 client. I have tried other sync methods (fdatasync, open_sync), but all are

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread MURAT KOÇ
Hi, My answers are written under your comments. Best Regards Murat KOC 2011/12/19 Alban Hertroys haram...@gmail.com On 19 December 2011 16:26, MURAT KOÇ m.ko...@gmail.com wrote: Hi Adrian, I wrote a desktop application on Windows by using Npgsql.dll. So, I send SQL statement to

Re: [GENERAL] fsync on ext4 does not work

2011-12-19 Thread Tomas Vondra
On 19 Prosinec 2011, 16:52, Havasvölgyi Ottó wrote: config: fsync=on sync_commit=on wal_sync_method=fsync I don't think you need to set wal_sync_method, comment it out. Even though the TPS in pgbench about 700 with 1 client. I have tried other sync methods (fdatasync, open_sync), but all

[GENERAL] Feature Request: Better handling of foreign keys in DELETE statements

2011-12-19 Thread Daniel Migowski
Hi, I face the following problem: I have a large table with 12 million addresses, referenced by 20 other tables (some containing about one million entries). There are indexes on the foreign keys. Now I wanted to delete about 10 million addresses (that are not referenced anymore from

Re: [GENERAL] fsync on ext4 does not work

2011-12-19 Thread Florian Weimer
* Havasvölgyi Ottó: Even though the TPS in pgbench about 700 with 1 client. I have tried other sync methods (fdatasync, open_sync), but all are similar. Should I disable write cache on HDD to make it work? Did you mount your ext4 file system with the nobarrier option? By default, ext4 is

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Alban Hertroys
Of course, we could create login credentials, login configuration options for every DBA colleagues. But, as I said previous that big problem is PostgreSQL logs include changing passwords on clear-text not encrypted No, the big problem is that you don't consider your fellow DBA's reliable.

Re: [GENERAL] Feature Request: Better handling of foreign keys in DELETE statements

2011-12-19 Thread Chris Angelico
On Tue, Dec 20, 2011 at 3:01 AM, Daniel Migowski dmigow...@ikoffice.de wrote: DELETE FROM address WHERE id NOT IN (SELECT address_id FROM bank where address_id IS NOT NULL)    AND id NOT IN (SELECT poboxaddress_id FROM bank where poboxaddress_id IS NOT NULL)    AND id NOT IN (SELECT

Re: [GENERAL] Feature Request: Better handling of foreign keys in DELETE statements

2011-12-19 Thread Pavel Stehule
Hello 2011/12/19 Daniel Migowski dmigow...@ikoffice.de: Hi, I face the following problem: I have a large table with 12 million addresses, referenced by 20 other tables (some containing about one million entries). There are indexes on the foreign keys. Now I wanted to delete about 10

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Magnus Hagander
On Mon, Dec 19, 2011 at 15:31, Guillaume Lelarge guilla...@lelarge.info wrote: On Mon, 2011-12-19 at 15:01 +0200, MURAT KOÇ wrote: Is it possible to see changing passwords as encrypted? Nope.  How should I change password or what is the correct sql statement to change user password?

Re: [GENERAL] New User: PostgreSQL Setup - The Program 'postgress' is needed by initdb but was not found in the same directory...

2011-12-19 Thread Patrick Kevin McCaffrey
Hello, I'm new to PostgreSQL, but am trying to set up a server on my machine. The PostgreSQL server is to run inside of a LXC container - I'm not sure if this is contributing to my problem or not, but it's worth mentioning. The main OS (host) of my machine is Ubuntu 11.10 (mostly,

Re: [GENERAL] Feature Request: Better handling of foreign keys in DELETE statements

2011-12-19 Thread Marti Raudsepp
On Mon, Dec 19, 2011 at 18:14, Pavel Stehule pavel.steh...@gmail.com wrote: you can disable check per session if you need ALTER TABLE ... DISABLE TRIGGER ALL; This is NOT a per-session command, this applies to all connections and queries, and may allow incorrect data into the table. Don't do

Re: [GENERAL] recovery_target_timeline and multiple slave behavior when master fails

2011-12-19 Thread Rick Pufky
Thanks for the comments. I'm not actually running with an archive directory in this configuration (archiving is disabled), however, scp'ing the new history file and the last WAL File from the new master allowed the other slave to just continue replay from where it left off. This is expected in

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Adrian Klaver
On Monday, December 19, 2011 7:26:33 am MURAT KOÇ wrote: Hi Adrian, I wrote a desktop application on Windows by using Npgsql.dll. So, I send SQL statement to database from this application code. I can't use psql command line (I know \password command changes password encrypted text).

Re: [GENERAL] Feature Request: Better handling of foreign keys in DELETE statements

2011-12-19 Thread Pavel Stehule
2011/12/19 Marti Raudsepp ma...@juffo.org: On Mon, Dec 19, 2011 at 18:14, Pavel Stehule pavel.steh...@gmail.com wrote: you can disable check per session if you need ALTER TABLE ... DISABLE TRIGGER ALL; This is NOT a per-session command, this applies to all connections and queries, and may

Re: [GENERAL] indexes and tables

2011-12-19 Thread Alan Hodgson
On Sunday, December 18, 2011 04:00:14 PM amit sehas wrote: Yes i was trying to determine how to make a View work in this situation. From reading the details on PostgreSQL Views are not persistent, ie they are just a SQL query short hand rather than actually creating any physical entity backing

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread MURAT KOÇ
Hi Adrian, Both of advices that are using md5 algorithm and setting log_statement for session specific worked well. Thanks for suggestions and solution advices. Best Regards, Murat KOC 2011/12/19 Adrian Klaver adrian.kla...@gmail.com On Monday, December 19, 2011 7:26:33 am MURAT KOÇ wrote:

Re: [GENERAL] fsync on ext4 does not work

2011-12-19 Thread Havasvölgyi Ottó
2011/12/19 Tomas Vondra t...@fuzzy.cz On 19 Prosinec 2011, 16:52, Havasvölgyi Ottó wrote: config: fsync=on sync_commit=on wal_sync_method=fsync I don't think you need to set wal_sync_method, comment it out. Even though the TPS in pgbench about 700 with 1 client. I have tried

Re: [GENERAL] New User: PostgreSQL Setup - The Program 'postgress' is needed by initdb but was not found in the same directory...

2011-12-19 Thread Tom Lane
Patrick Kevin McCaffrey p...@uwm.edu writes: I'm following the instructions that come with the source, and am stuck on this line: /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data When I run it, I get the following: sh: cannot create /dev/null: Permission denied This line suggests that

Re: [GENERAL] fsync on ext4 does not work

2011-12-19 Thread Havasvölgyi Ottó
2011/12/19 Florian Weimer fwei...@bfk.de * Havasvölgyi Ottó: Even though the TPS in pgbench about 700 with 1 client. I have tried other sync methods (fdatasync, open_sync), but all are similar. Should I disable write cache on HDD to make it work? Did you mount your ext4 file system

Re: [GENERAL] Feature Request: Better handling of foreign keys in DELETE statements

2011-12-19 Thread Hannes Erven
Hi Daniel, Now I wanted to delete about 10 million addresses (that are not referenced anymore from anywhere), and have a statement like: What about: DELETE FROM address WHERE id IN ( SELECT id FROM address EXCEPT ( SELECT address_id FROM tab1 UNION ALL

Re: [GENERAL] Changing Passwords as Encrypted not Clear-Text

2011-12-19 Thread Adrian Klaver
On Monday, December 19, 2011 11:46:05 am MURAT KOÇ wrote: Hi Adrian, Both of advices that are using md5 algorithm and setting log_statement for session specific worked well. Thanks for suggestions and solution advices. Glad it worked. A thought came to mind just now. If you decide to use