Re: [HACKERS] EXPLAIN verbose?

2006-05-12 Thread Qingqing Zhou
Cristiano Duarte [EMAIL PROTECTED] wrote Does anyone know how to discover the tables (with schemas or oid) involved on a select statement? I tried EXPLAIN but it only reports the table names, not schemas or oid. In general, this is a pretty difficult problem - thinking you may do a

Re: [HACKERS] BEGIN inside transaction should be an error

2006-05-12 Thread Mario Weilguni
Am Donnerstag, 11. Mai 2006 22:16 schrieb Simon Riggs: On Wed, 2006-05-10 at 21:24 -0400, Tom Lane wrote: Martijn van Oosterhout kleptog@svana.org writes: How do other database deal with this? Either they nest BEGIN/COMMIT or they probably throw an error without aborting the transaction,

[HACKERS] any, anyelement, and anyarray

2006-05-12 Thread Thomas Hallgren
I have some questions regarding any, anyelement, and anyarray. - Why does PostgreSQL declare three different generic types? Isn't one enough? ISTM it would be far simpler to use constructs like 'any' and 'any[]' but neither of them are permitted. - Why isn't the 'anyarray' declared as an

[HACKERS] Clarification required

2006-05-12 Thread Dhanaraj M
I could not understand the following TODO item. Can anyone explain this. Monitoring: = Allow server logs to be remotely read and removed using SQL commands Does it mean that the server log file should be read by the client? What kind of removal (using SQL)? Also I like to know where

Re: [HACKERS] Clarification required

2006-05-12 Thread Dave Page
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dhanaraj M Sent: 12 May 2006 12:31 To: pgsql-hackers@postgresql.org Subject: [HACKERS] Clarification required I could not understand the following TODO item. Can anyone explain this.

Re: [HACKERS] BEGIN inside transaction should be an error

2006-05-12 Thread Jaime Casanova
On 5/12/06, Mario Weilguni [EMAIL PROTECTED] wrote: Am Donnerstag, 11. Mai 2006 22:16 schrieb Simon Riggs: On Wed, 2006-05-10 at 21:24 -0400, Tom Lane wrote: Martijn van Oosterhout kleptog@svana.org writes: How do other database deal with this? Either they nest BEGIN/COMMIT or they

Re: [HACKERS] any, anyelement, and anyarray

2006-05-12 Thread Tom Lane
Thomas Hallgren [EMAIL PROTECTED] writes: - Why does PostgreSQL declare three different generic types? Isn't one enough? ISTM it would be far simpler to use constructs like 'any' and 'any[]' but neither of them are permitted. any isn't the same as anyelement, because it doesn't have the

Re: [HACKERS] any, anyelement, and anyarray

2006-05-12 Thread Thomas Hallgren
Tom Lane wrote: Thomas Hallgren [EMAIL PROTECTED] writes: - Why does PostgreSQL declare three different generic types? Isn't one enough? ISTM it would be far simpler to use constructs like 'any' and 'any[]' but neither of them are permitted. any isn't the same as anyelement, because

Re: [HACKERS] Continuing pgstat update timeout failures in buildfarm

2006-05-12 Thread Bruce Momjian
Tom Lane wrote: The reliability of that recent pgstat patch is clearly completely unacceptable. Please revert it until it's fixed. I'm tired of looking at intermittent buildfarm failures. Yes, I am getting to it. -- Bruce Momjian http://candle.pha.pa.us EnterpriseDB

Re: [HACKERS] any, anyelement, and anyarray

2006-05-12 Thread Tom Lane
Thomas Hallgren [EMAIL PROTECTED] writes: I've been trying to use any with no luck. How do I declare a function that takes an any as a parameter? ANY is a reserved word, so to use it as a type name you need quotes: regression=# create function foo(any) returns int as '' language sql; ERROR:

Re: [HACKERS] Clarification required

2006-05-12 Thread Jim C. Nasby
On Fri, May 12, 2006 at 05:00:51PM +0530, Dhanaraj M wrote: I could not understand the following TODO item. Can anyone explain this. Monitoring: = Allow server logs to be remotely read and removed using SQL commands Does it mean that the server log file should be read by the

[HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Hogan, James F. Jr.
I am trying desperately to find a way to create an audit table to log...who SELECTED what... as I am dealing with HR data and Health Care Patient Data Any help would be greatly appreciated and put to good use in the Austin Texas Hospitals. Thanks Jim -Original Message- From: Hogan,

[HACKERS] DH_check return value test correct?

2006-05-12 Thread Michael Fuhr
load_dh_file() in src/backend/libpq/be-secure.c does the following: if (DH_check(dh, codes)) { elog(LOG, DH_check error (%s): %s, fnbuf, SSLerrmessage()); return NULL; } Isn't that the wrong test for DH_check's return value? According to the OpenSSL documentation DH_check()

Re: [HACKERS] Bug in signal handler

2006-05-12 Thread Florian Weimer
* Martijn van Oosterhout: The fact remains that the postmaster has *always* been coded like that, and we have *never* seen any problems. Barring proof that there is a problem, I'm uninterested in rewriting it just because someone doesn't like it. It should probably also be remembered that

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Josh Berkus
Jim, I am trying desperately to find a way to create an audit table to log...who SELECTED what... as I am dealing with HR data and Health Care Patient Data Well, the issue with doing this by trigger or RULE is that unlike updates and deletes, SELECTS do *not* guarentee single execution. For

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Joshua D. Drake
Hogan, James F. Jr. wrote: I am trying desperately to find a way to create an audit table to log...who SELECTED what... as I am dealing with HR data and Health Care Patient Data Any help would be greatly appreciated and put to good use in the Austin Texas Hospitals. Use statement logging and

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Andrew Dunstan
Josh Berkus wrote: Secondly, you can use the log. We've discussed on this list making it possible to log in CSV, XML or other database-digestable format. Unfortuantely, there doesn't appear to be much momentum behind that; I don't know that anyone is writing any code presently.

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Josh Berkus
Andrew, The real problem is the message, which is now from the logging code's point of view basically an opaque string. Changing that would be a massive undertaking, especially when you think of the effect on the translators. Hmmm ... I don't see this as a problem. Just stick the whole

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Andrew Dunstan
Josh Berkus wrote: Andrew, The real problem is the message, which is now from the logging code's point of view basically an opaque string. Changing that would be a massive undertaking, especially when you think of the effect on the translators. Hmmm ... I don't see this as a

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Jim C. Nasby
On Fri, May 12, 2006 at 02:43:56PM -0400, Andrew Dunstan wrote: Josh Berkus wrote: Andrew, The real problem is the message, which is now from the logging code's point of view basically an opaque string. Changing that would be a massive undertaking, especially when you think of the

Re: [HACKERS] Inheritance, Primary Keys and Foreign Keys

2006-05-12 Thread Albert Cervera Areny
Of course, that's an option for my case. Just wanted to know if this solution could be useful for PostgreSQL in general. Mainly because I'll add some triggers to check what maybe PostgreSQL should do itself but it's unimplemented. If that's not interesting or a proper solution for PostgreSQL I'll

Re: [HACKERS] DH_check return value test correct?

2006-05-12 Thread Tom Lane
Michael Fuhr [EMAIL PROTECTED] writes: Isn't that the wrong test for DH_check's return value? Yeah, sure looks that way, doesn't it? If $PGDATA/dh1024.pem exists and if SSL connections are enabled, then each SSL connection logs the following: DH_check error (dh1024.pem): No SSL error

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Tom Lane
Josh Berkus josh@agliodbs.com writes: Well, the issue with doing this by trigger or RULE is that unlike updates and deletes, SELECTS do *not* guarentee single execution. For example, if the table is on the loop end of a nested loop, it could be fired hundreds or thousands of times. This

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Tom Lane
Josh Berkus josh@agliodbs.com writes: Hmmm ... I don't see this as a problem. Just stick the whole message into a single XML field. This is one area where XML is easier that SQL; since it's a document format, it has no problem with a great big blob of text. Unstructured Data and all that

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Josh Berkus
Tom, This argument strikes me as nonsense. You've got a utility that's smart enough to parse the very-free-format message bodies, but it's going to be too confused by the log line prefix? Having tinkered a little with PQA, yes, actually. The issue is that the message text can easily be

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Joshua D. Drake
Tom Lane wrote: Josh Berkus josh@agliodbs.com writes: Hmmm ... I don't see this as a problem. Just stick the whole message into a single XML field. This is one area where XML is easier that SQL; since it's a document format, it has no problem with a great big blob of text. Unstructured

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Joshua D. Drake
Josh Berkus wrote: Tom, This argument strikes me as nonsense. You've got a utility that's smart enough to parse the very-free-format message bodies, but it's going to be too confused by the log line prefix? Having tinkered a little with PQA, yes, actually. The issue is that the message

Re: [HACKERS] [GENERAL] Querying libpq compile time options

2006-05-12 Thread Bruce Momjian
[EMAIL PROTECTED] wrote: Hi all I am writing an app that uses libpq, but because it is threaded I want to make sure that the dynamic library being used has been compiled with the right option. How do I do this? Is there a call such as bool PQisThreadSafe() that I can call? [ Email

Re: [HACKERS] DH_check return value test correct?

2006-05-12 Thread Michael Fuhr
On Fri, May 12, 2006 at 06:39:44PM -0400, Tom Lane wrote: Michael Fuhr [EMAIL PROTECTED] writes: If $PGDATA/dh1024.pem exists and if SSL connections are enabled, then each SSL connection logs the following: DH_check error (dh1024.pem): No SSL error reported The backend then loads the

Re: [HACKERS] audit table containing Select statements submitted

2006-05-12 Thread Tom Lane
Joshua D. Drake [EMAIL PROTECTED] writes: Hmmm... well why don't we add log_line_suffix :) Doesn't help; you'd also need logic in there to quote any XML tags appearing in the message text. At that point, adding a log_line_suffix is a transparent pretense of generality --- what you might as well

Re: [HACKERS] DH_check return value test correct?

2006-05-12 Thread Tom Lane
Michael Fuhr [EMAIL PROTECTED] writes: Incidentally, is it necessary to load the DH parameters anew and call DH_check for every connection? We could maybe improve on that on Unix, but not so easily on Windows. Given the evidently nonexistent demand for this feature, I can't see putting any work

Re: [HACKERS] [GENERAL] Querying libpq compile time options

2006-05-12 Thread spaminos-sql
From: Bruce Momjian pgman@candle.pha.pa.us [EMAIL PROTECTED] wrote: Hi allI am writing an app that uses libpq, but because it is threaded I want to make sure that the dynamic library being used has been compiled with the right option. How do I do this?Is there a call such as "bool

Re: [HACKERS] Need some clarification

2006-05-12 Thread Qingqing Zhou
Dhanaraj M [EMAIL PROTECTED] wrote 2. *Invalidate prepared queries, like INSERT, when the table definition is altered *Invalidation means recompilation or deletion of the prepared stmt here.* *Both the items look similar. i.e) needs recompilation of the query after altering the table.

Re: [HACKERS] Need some clarification

2006-05-12 Thread Tom Lane
Qingqing Zhou [EMAIL PROTECTED] writes: Yes, IMHO the basic idea is like that - the difficulty is that we are lack of efficient object tracking mechanism, so that when an underlying object is changed, all the prepared plans should be invalidated. The basic signaling mechanism does exist (the