[GENERAL] Return value of current_user before calling SECURITY DEFINER function.

2013-12-04 Thread Dmitriy Igrishin
Hello, Is there are way to determine a subject? Thanks. -- // Dmitriy.

Re: [GENERAL] Return value of current_user before calling SECURITY DEFINER function.

2013-12-04 Thread Dmitriy Igrishin
For clarity, is it possible to write a SECURITY DEFINER function which returns a value of current_user at the moment of call? 2013/12/4 Dmitriy Igrishin dmit...@gmail.com Hello, Is there are way to determine a subject? Thanks. -- // Dmitriy. -- // Dmitriy.

Re: [GENERAL] Return value of current_user before calling SECURITY DEFINER function.

2013-12-04 Thread Pavel Stehule
Hello pls, try session_user Regards Pavel 2013/12/4 Dmitriy Igrishin dmit...@gmail.com Hello, Is there are way to determine a subject? Thanks. -- // Dmitriy.

Re: [GENERAL] Return value of current_user before calling SECURITY DEFINER function.

2013-12-04 Thread Dmitriy Igrishin
2013/12/4 Pavel Stehule pavel.steh...@gmail.com Hello pls, try session_user Not really :-(. The user can perform SET ROLE before calling the SECURITY DEFINER function and I need to know who is the caller at the time of call. I need something like a calling_user() function... -- // Dmitriy.

Re: [GENERAL] Return value of current_user before calling SECURITY DEFINER function.

2013-12-04 Thread Dmitriy Igrishin
In other words, I need to get an information about *current* role of the caller inside the SECURITY DEFINER function. 2013/12/4 Dmitriy Igrishin dmit...@gmail.com 2013/12/4 Pavel Stehule pavel.steh...@gmail.com Hello pls, try session_user Not really :-(. The user can perform SET ROLE

Re: [GENERAL] Postgres 9.3 read block error went into recovery mode

2013-12-04 Thread Albe Laurenz
Shuwn Yuan Tee wrote: We recently experienced crash on out postgres production server. Here's our server environment: - Postgres 9.3 - in OpenVZ container - total memory: 64GB Here's the error snippet from postgres log: ERROR: could not read block 356121 in file

[GENERAL] unexplainable psql exit status 1

2013-12-04 Thread Tim Kane
HI all, Is anyone aware of cases where psql will occasionally return an exit status of 1, despite there being no obvious error condition? I have a regular (daily) cron that executes a fairly simple script of the form: psql --set ON_ERROR_STOP=1 -h $DB_HOST -U $DB_USER -a -v DATE='${DATE}' -v

Re: [GENERAL] unexplainable psql exit status 1

2013-12-04 Thread Tim Kane
I should have mentioned, psql client and server version 9.2.4 From: Tim Kane tim.k...@gmail.com Date: Wednesday, 4 December 2013 10:59 To: pgsql-general General pgsql-general@postgresql.org Subject: unexplainable psql exit status 1 HI all, Is anyone aware of cases where psql will

Re: [GENERAL] unexplainable psql exit status 1

2013-12-04 Thread Albe Laurenz
Tim Kane wrote: Is anyone aware of cases where psql will occasionally return an exit status of 1, despite there being no obvious error condition? I have a regular (daily) cron that executes a fairly simple script of the form: psql --set ON_ERROR_STOP=1 -h $DB_HOST -U $DB_USER -a

Re: [GENERAL] unexplainable psql exit status 1

2013-12-04 Thread Tim Kane
According to the documentation you quoted, it would be useless to set log_statement=all, because the problem is on the client end. Shell debugging sounds slightly more promising, but it will probably not tell you much more than that psql returned with exit code 1. A quick look at the

Re: [GENERAL] unexplainable psql exit status 1

2013-12-04 Thread Albe Laurenz
Tim Kane wrote: I’ve enabled shell debugging to be 100% sure that I’m not munging the return code anywhere. It’s entirely possible there is something going on at the shell side of things, though I fail to see how just at the minute :) The output of the script is as follows, bearing in mind

Re: [GENERAL] how much disk space does a VACUUM FULL take?

2013-12-04 Thread Vick Khera
On Tue, Dec 3, 2013 at 4:04 PM, john gale j...@smadness.com wrote: Does this suggest that VACUUM FULL needs free disk space on the order of the full size of the table that it's vacuuming to be able to complete? Or does it / can it write the filesystem files in the 1GB chunks stored in /base

Re: [GENERAL] Postgres 9.3 read block error went into recovery mode

2013-12-04 Thread Kevin Grittner
Albe Laurenz laurenz.a...@wien.gv.at wrote: Shuwn Yuan Tee wrote: We recently experienced crash on out postgres production server. Here's our server environment: - in OpenVZ container ERROR:  could not read block 356121 in file base/33134/33598.2: Bad address LOG:  server process (PID

[GENERAL] Need help with upsert

2013-12-04 Thread Eric Lamer
Hi, I need some help with upsert. Some info on what I want to do: Each day I create a table for my firewall logs. I have one entry for one occurrence of all the field except sum, which is the number of occurrence I have of each log that match all the field. My table has the

Re: [GENERAL] Need help with upsert

2013-12-04 Thread Serge Fonville
Hi, ERROR: column reference firewall is ambiguous LINE 3: ... a WHERE NOT EXISTS (SELECT * FROM upsert b WHERE b.firewall... set firewal = misses a table HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl 2013/12/4 Eric Lamer e...@phoenixsecure.com

Re: [GENERAL] Need help with upsert

2013-12-04 Thread Eric Lamer
LINE 3: ... a WHERE NOT EXISTS (SELECT * FROM upsert b WHERE b.firewall... As you can see it is b.firewall where b is alias to table upsert. That's why I don't understand the error. From: Serge Fonville [mailto:serge.fonvi...@gmail.com] Sent: December 4, 2013 12:53 PM To: Eric

Re: [GENERAL] how much disk space does a VACUUM FULL take?

2013-12-04 Thread Scott Marlowe
On Tue, Dec 3, 2013 at 2:04 PM, john gale j...@smadness.com wrote: Due to running low on disk space, we have recently removed a majority of rows from a table to an archival DB. Although VACUUM allows disk space to be re-used, VACUUM FULL is the only one that actively reclaims disk space

Re: [GENERAL] Need help with upsert

2013-12-04 Thread Vincent Veyron
Le mercredi 04 décembre 2013 à 17:48 +, Eric Lamer a écrit : Each day I want to copy the last 7 days into one table so I have one table with the last 7 days of logs. So I want to copy the data from 7 tables into 1. If the row does not exist I just insert and if the row

Re: [GENERAL] Postgres 9.3 read block error went into recovery mode

2013-12-04 Thread Merlin Moncure
On Tue, Dec 3, 2013 at 4:32 AM, Shuwn Yuan Tee shuwny...@binary.com wrote: We recently experienced crash on out postgres production server. Here's our server environment: - Postgres 9.3 - in OpenVZ container - total memory: 64GB Here's the error snippet from postgres log: ERROR: could

[GENERAL] compliance with 21 cfr part 11

2013-12-04 Thread e-letter
Readers, Can postgresql be deployed with audit trail and data validation capability, to meet compliance with 21 cfr part 11? -- 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] compliance with 21 cfr part 11

2013-12-04 Thread John R Pierce
On 12/4/2013 3:34 PM, e-letter wrote: Can postgresql be deployed with audit trail and data validation capability, to meet compliance with 21 cfr part 11? IMHO, that sort of audit trail should be higher level in your business logic, not in the database. but that's just my opinion, worth

Re: [GENERAL] compliance with 21 cfr part 11

2013-12-04 Thread Rob Sargent
On 12/04/2013 04:41 PM, John R Pierce wrote: On 12/4/2013 3:34 PM, e-letter wrote: Can postgresql be deployed with audit trail and data validation capability, to meet compliance with 21 cfr part 11? IMHO, that sort of audit trail should be higher level in your business logic, not in the

[GENERAL] Need help with upsert

2013-12-04 Thread Eric Lamer
Hi, I need some help with upsert. Some info on what I want to do: Each day I create a table for my firewall logs. I have one entry for one occurrence of all the field except sum, which is the number of occurrence I have of each log that match all the field. My table has the

Re: [GENERAL] compliance with 21 cfr part 11

2013-12-04 Thread Robin
I have built big nationwide health databases, and other secure systems requiring traceback and auditability. The more you are able to make the required processes transparent to the end user, the happier they are and the fewer problems you have from a user acceptance perspective. Audit does

Re: [GENERAL] Need help with upsert

2013-12-04 Thread Richard Dunks
Hello, On Dec 4, 2013, at 12:39 PM, Eric Lamer e...@phoenixsecure.com wrote: Hi, I need some help with upsert. Some info on what I want to do: Each day I create a table for my firewall logs. I have one entry for one occurrence of all the field except sum, which is the

Re: [GENERAL] compliance with 21 cfr part 11

2013-12-04 Thread Scott Marlowe
On Wed, Dec 4, 2013 at 9:15 PM, Robin robin...@live.co.uk wrote: I have built big nationwide health databases, and other secure systems requiring traceback and auditability. The more you are able to make the required processes transparent to the end user, the happier they are and the fewer