[PATCHES] ruleutils with pretty-print option

2003-06-29 Thread Andreas Pflug
The attached patches will add pg_get_ruledef(oid, int) pg_get_viewdef(text, int) pg_get_viewdef(oid, int) pg_get_indexdef(oid, int) pg_get_constraintdef(oid, int) pg_get_expr(text, oid, int) If the last parameter pretty-print is 0, these function will return the same result as

[PATCHES] ruleutils with pretty-print option

2003-07-06 Thread Andreas Pflug
Is there a problem about the archive? I posted this addition to the patch on July 2, and received it over the patches mailing list. Still, it doesn't appear in cvs, in unapplied patches or in the mailing list archive! So although that message made its way through the list server, it didn't end

Re: [PATCHES] ruleutils with pretty-print option

2003-07-21 Thread Andreas Pflug
Hi Bruce, so here's the complete patch against the current cvs. Description: The attached patches will add pg_get_ruledef(oid, bool) pg_get_viewdef(text, bool) pg_get_viewdef(oid, bool) pg_get_indexdef(oid, int4, bool) pg_get_constraintdef(oid, bool) pg_get_expr(text, oid, bool) If the

Re: [PATCHES] ruleutils with pretty-print option

2003-07-22 Thread Andreas Pflug
Bruce Momjian wrote: Andreas, looks good, but I need a diff -c, context diff. Hi Bruce, I intentionally only attached only non-context diffs because the patch is about 50 % size of the original file. Now, here's the same as context diff. Regards, Andreas Index: pg_proc.h

Re: [PATCHES] ruleutils with pretty-print option

2003-07-27 Thread Andreas Pflug
Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom, how do I pass PG_FUNCTION_ARGS to another function, while adding a new parameter? I wouldn't. Do the PG_GETARGS in the wrapper, and have the called function take a normal C parameter list. So I

Re: [PATCHES] ruleutils with pretty-print option

2003-07-28 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: + int prettyFlags = !PG_ARGISNULL(1) PG_GETARG_BOOL(1) ? PRETTYFLAG_PAREN|PRETTYFLAG_INDENT : 0; Since the pg_proc entries are all marked strict, it's unnecessary for you to write any ARGISNULL checks. Yeah you're right

Re: [PATCHES] ruleutils with pretty-print option

2003-07-31 Thread Andreas Pflug
Tom Lane wrote: Applied with some editorializing. In particular, I don't believe the original did the right thing with (a - (b - c)). Oops, missed that case... But now, we have (a + ( b + c)) again. A patch that removes parentheses for + and * is appended. Regards, Andfdsa

[Fwd: Re: [PATCHES] ruleutils with pretty-print option]

2003-07-31 Thread Andreas Pflug
Now the patch is *really* appended :-) Tom Lane wrote: Applied with some editorializing. In particular, I don't believe the original did the right thing with (a - (b - c)). Oops, missed that case... But now, we have (a + ( b + c)) again. A patch that removes parentheses for + and * is

Re: [Fwd: Re: [PATCHES] ruleutils with pretty-print option]

2003-07-31 Thread Andreas Pflug
Tom Lane wrote: Now the patch is *really* appended :-) And rejected. Ok, the ckeck for node being the first child already does the trick for standard l-t-r evaluation. You cannot assume that an operator is commutative or associative just because it has a name you think ought to be. (For

Re: [Fwd: Re: [PATCHES] ruleutils with pretty-print option]

2003-07-31 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: Well, to me it's not well-known that floating-point addition is not associative, do I need to re-learn my math? regression=# select (1.0::float8 + (-1.0::float8)) + 1.0e-20::float8; ?column? -- 1e-20 (1 row) regression

[PATCHES] win32 libpq

2003-08-24 Thread Andreas Pflug
The attached patch allows libpq to be compiled under native win32. It adds the missing thread.c. Additionally, it corrects the option to compile for debugging. Regards, Andreas RCS file: /projects/cvsroot/pgsql-server/src/include/pg_config.h.win32,v retrieving revision 1.11 diff -u -r1.11

[PATCHES] non-blocking libpq under win32

2003-08-24 Thread Andreas Pflug
The attached patch reenables non-blocking operation under win32. The global variable was left uninitialized, so the compiler would silently make it 0. This resulted in connectMakeNonblocking() setting nonblocking to zero, i.e. blocking. Regards, Andreas RCS file:

[PATCHES] libpq with ssl under win32

2003-08-25 Thread Andreas Pflug
The attached patch enables libpq to be linked with ssl support (openssl 0.9.7.b tested). Client certificates are commented out because the implementation is *nix specific, regarding the location resolution of the .pem files. It needs to be discussed where these files should be located. For

[PATCHES] non-blocking libpq under win32

2003-08-25 Thread Andreas Pflug
The attached patch reenables non-blocking operation under win32. The global variable was left uninitialized, so the compiler would silently make it 0. This resulted in connectMakeNonblocking() setting nonblocking to zero, i.e. blocking. Regards, Andreas RCS file:

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-04 Thread Andreas Pflug
Kurt Roeckx wrote: You're assuming all systems have an AF_INET6 constant, which is not the case. Please make use of HAVE_IPV6. Can't directly see anything else wrong with it. Here's the patch with HAVE_IPV6 conditional compiling. Regards, Andreas Index: hba.c

Re: [PATCHES] libpq-win32 patches

2003-09-05 Thread Andreas Pflug
Hi Bruce, + +/* getpwuid doesn't exist under win32 */ +#define getpwuid(uid) NULL + #endif /* pg_config_h_win32__ */ Why was this needed? I realize we don't have getpwuid() on Win32, but we do have GetUserName() for cases where we need the name but not the directory. Because all the

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Andreas Pflug
Andrew Dunstan wrote: Andreas, You should check that the CIDR mask is a valid integer. You would need to use strtol() rather than atoi() to do that. Perhaps this should be hoisted out of ip.c:SockAddr_cidr_mask() and put in hba.c. Right, I added this. Regards, Andreas Index: hba.c

Re: [PATCHES] IPV4 addresses on IPV6 machines in pg_hba.conf

2003-09-05 Thread Andreas Pflug
Tom Lane wrote: I thought this was still really messy, so I modified it to use a separate promote v4 address to v6 subroutine. I've applied the attached patch (plus docs). It's not very well tested since I don't have an IPv6 setup here; please check that it does what you want. It SEGVs. Reason

Re: [PATCHES] Unixware 713 probs

2003-09-07 Thread Andreas Pflug
Larry Rosenman wrote: Here's a quickie patch I did to fix it. Patching this or not, if the function's called the backend will SEGV either (at least on my 2.4.20 it does) because a IPV6 address is copied in the memory space of a IPV4 address. Regards, Andreas ---(end

Re: [PATCHES] Unixware 713 probs

2003-09-08 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: Larry Rosenman wrote: Here's a quickie patch I did to fix it. Patching this or not, if the function's called the backend will SEGV either (at least on my 2.4.20 it does) because a IPV6 address is copied in the memory

[PATCHES] libpq endless loop if client_min_messages=debug1

2003-12-28 Thread Andreas Pflug
My Deja wrote: I am trying to get some query trees to appear in the PostgreSQL log and in order to that I have set client_min_messages = DEBUG1 in order to use the following settings debug_print_parse, debug_print_rewritten, or debug_print_plan which are required for the query tree to show up

[PATCHES] thread safety testing fix

2004-05-28 Thread Andreas Pflug
When checking for thread safety with src/tools/thread/thread_test.c, the mktemp function wants an argument that contains 6 X, while the current version only supplies 5 X which will fail on my SuSE 8.1. Patch attached. Regards, Andreas Index: thread_test.c

[PATCHES] Compiling libpq with VisualC

2004-05-28 Thread Andreas Pflug
Some modifications are needed to compile libpq with vc6: fe-connect.c: - pg_config_paths.h isn't available. SYSCONFDIR is already defined so fe-connect.c doesn't need to include that. patch appended win32.mak: - pg_config.h must be generated - port/pgstrcasecmp.c is needed - port/path.c is not

[PATCHES] Libpq ssl fix

2004-05-28 Thread Andreas Pflug
init_ssl_system will return 0 on success and -1 on failure, which will be interpreted just the other way round in initialize_SSL. Patch appended. Regards, Andreas Index: fe-secure.c === RCS file:

Re: [PATCHES] Libpq ssl fix

2004-05-28 Thread Andreas Pflug
Manfred Spraul wrote: Btw, --enable-thread-safety on Linux (RedHat Fedora Core 1) fails in configure with configure: error: *** Thread test program failed. Your platform is not thread-safe. *** Check the file 'config.log'for the exact reason. I had this too, for two reasons: - configure

Re: [PATCHES] thread safety testing fix

2004-05-28 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: When checking for thread safety with src/tools/thread/thread_test.c, the mktemp function wants an argument that contains 6 X, while the current version only supplies 5 X which will fail on my SuSE 8.1. Patch attached. Isn't

Re: [PATCHES] Libpq ssl fix

2004-05-28 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: init_ssl_system will return 0 on success and -1 on failure, which will be interpreted just the other way round in initialize_SSL. Patch appended. Hmm, that looks backwards to me too, but this would seem to imply that Manfred Spraul

Re: [PATCHES] Compiling libpq with VisualC

2004-06-03 Thread Andreas Pflug
Bruce Momjian wrote: fe-connect.c: - pg_config_paths.h isn't available. SYSCONFDIR is already defined so fe-connect.c doesn't need to include that. patch appended This shouldn't be needed anymore. Where is SYSCONFDIR coming from? Is it from some Win32 include file? It should only be

Re: [PATCHES] Compiling libpq with VisualC

2004-06-04 Thread Andreas Pflug
Bruce Momjian wrote: Andreas Pflug wrote: Bruce Momjian wrote: fe-connect.c: - pg_config_paths.h isn't available. SYSCONFDIR is already defined so fe-connect.c doesn't need to include that. patch appended This shouldn't be needed anymore. Where is SYSCONFDIR

Re: [PATCHES] Compiling libpq with VisualC

2004-06-04 Thread Andreas Pflug
Andreas Pflug wrote: The attached patch will create a dummy pg_config_paths.h. Additionally, ENABLE_THREAD_SAFETY is supported by the makefile (but not by the sources, which need some rework) Now including the patch... Regards, Andreas Index: win32.mak

Re: [PATCHES] Compiling libpq with VisualC

2004-06-04 Thread Andreas Pflug
The appended patch implements ENABLE_THREAD_SAFETY for win32 compiled with Visual C. Two additional files will supply the needed pthread stuff. There's no SIGPIPE for native win32, so there are some #IFNDEF WIN32 to skip installing a signal handler for this. I'm not sure if this is going to

[PATCHES] Int2 vector to array equality

2004-06-06 Thread Andreas Pflug
While trying to pg_constraint JOIN pg_index ON indrelid=conrelid AND conkey=indkey I noticed (once again) that these columns have different types (although describing the same thing), and there's no equality operator for them. The attached patch adds an equality operator bool

Re: [PATCHES] [HACKERS] serverlog function (log_destination file)

2004-06-08 Thread Andreas Pflug
Magnus Hagander wrote: Specifically about the logs, I still think there is a lot of value to being able to read the logs remotely even if you can't restart postmaster. Since I believe that retrieving the logs easily without server file access is a feature that's welcomed by many users, here's my

Re: [PATCHES] [HACKERS] serverlog function (log_destination file)

2004-06-10 Thread Andreas Pflug
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Looks good to me. The only issue I saw was that the default file name mentioned in postgresql.conf doesn't match the actual default. I'm really not happy with the concept that the postmaster overrides its stderr direction. I

Re: [PATCHES] [HACKERS] serverlog function (log_destination file)

2004-06-10 Thread Andreas Pflug
Sorry I didn't get back on this earlier, yesterday morning my internet access was literally struck by lightning, I'm running temporary hardware now. Bruce Momjian wrote: Looks good to me. The only issue I saw was that the default file name mentioned in postgresql.conf doesn't match the actual

Re: [PATCHES] Compiling libpq with VisualC

2004-06-11 Thread Andreas Pflug
Bruce Momjian wrote: I have looked over this patch. I noticed this: -static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER; - +static pthread_mutex_t init_mutex; +static int mutex_initialized = 0; +if

Re: [PATCHES] Compiling libpq with VisualC

2004-06-11 Thread Andreas Pflug
Bruce Momjian wrote: Agreed. My pthread book says pthread_mutex_init() should be called only once, and we have to guarantee that. If the Windows implentation allows it to be called multiple times, just create a function to be called only by Win32 that does that and leave the Unix safe. Ok,

Re: [PATCHES] [HACKERS] serverlog function (log_destination file)

2004-06-11 Thread Andreas Pflug
Bruce Momjian wrote: I was thinking of close/reopen so log files could be rotated. Log file rotation is fine, if we find a consensus quite soon how to implement it... Seems as if I might find some time to implement it until feature freeze. The attached patch has the default filename issue

Re: [PATCHES] [HACKERS] serverlog function (log_destination file)

2004-06-11 Thread Andreas Pflug
Tom Lane wrote: This has got portability issues (fopen(ab)) My doc says b is ignored on ansi systems, and recommends using it. Do you have other experiences? and I don't care for its use of malloc in preference to palloc either. Do we already have an applicable memory context in the

Re: [PATCHES] Compiling libpq with VisualC

2004-06-11 Thread Andreas Pflug
Manfred Spraul wrote: Wrong. There are portable test-and-set functions in the Win32 SDK: for example InterlockedCompareExchange. They operate on ints and do not need initialization. 'k, missed that one. Lets use it. There is a third option: Add one C++ file and use the constructor to initialize

[PATCHES] win32 libpq ENABLE_THREAD_SAFETY

2004-06-13 Thread Andreas Pflug
So here's the updated ENABLE_THREAD_SAFETY patch for win32, to be compiled under VC5/6/7 (tested with VC6). nmake -f win32.mak [DEBUG=1] [USE_SSL=1] [ENABLE_THREAD_SAFETY=1] are supported. Regards, Andreas /*- * *

Re: [PATCHES] stderr win32 admin check

2004-06-15 Thread Andreas Pflug
Dave Page wrote: It could still be run on NT4 under the following conditions: 1) Running as a service 2) Running if the user logged in is not an administrator. Well, isn't running as a service sufficient? I thought that was the only interesting case for non-hackers anyway. As long as

Re: [PATCHES] stderr win32 admin check

2004-06-15 Thread Andreas Pflug
Dave Page wrote: you can only run one instance as a service on a single machine. If you mean only run one instance of postmaster as service, that's not true. If you like two pgsql servers (i.e. db clusters), you can install two services, both using the same binary with different cmd line

Re: [PATCHES] Tablespace patch review

2004-06-18 Thread Andreas Pflug
Gavin Sherry wrote: On Fri, 18 Jun 2004, Andreas Pflug wrote: Gavin Sherry wrote: On Fri, 18 Jun 2004, Bruce Momjian wrote: [snip] TODO. You sound like a man who's expecting a several-generations-polished facility when we only just committed the first version today. I do not feel

Re: [PATCHES] Tablespace patch review

2004-06-18 Thread Andreas Pflug
Gavin Sherry wrote: I would debate that. Firstly, tablespaces aren't supported on windows yet. Just a matter of time. And I'm talking of win32 workstations connecting to *ix servers too. Secondly, I'd think that Unix users would be fine with a command line tool, especially one that can connect

Re: [PATCHES] Tablespace patch review

2004-06-18 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: IMHO checking objects in a tablespace is a routine administrative task, so it should be supported natively by the server without need of contribs. I strongly disagree. Dropping a tablespace is not a routine activity, Dropping

Re: [PATCHES] Tablespace patch review

2004-06-19 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: Tom Lane wrote: As for the authentication-is-expensive issue, what of it? You *should* have to authenticate yourself in order to look inside another person's database. The sort of cross-database inspection being proposed here would

Re: [PATCHES] Tablespace patch review

2004-06-19 Thread Andreas Pflug
Dave Page wrote: -Original Message- From: [EMAIL PROTECTED] on behalf of Bruce Momjian Sent: Sat 6/19/2004 1:05 AM To: Andreas Pflug Cc: Tom Lane; Gavin Sherry; PostgreSQL-patches Subject: Re: [PATCHES] Tablespace patch review We can build a gui on top of the command-line tool

Re: [PATCHES] Tablespace patch review

2004-06-19 Thread Andreas Pflug
Bruce Momjian wrote: I don't see why an admin tool can't connect to each database and get a listing of what is in each tablespace. I don't think connecting to 100 databases to get that information will be slow. Well, whatever you call slow or not slow. I checked it; connecting 10 databases,

Re: [PATCHES] Tablespace patch review

2004-06-19 Thread Andreas Pflug
Dave Page wrote: -Original Message- From: Andreas Pflug [mailto:[EMAIL PROTECTED] Sent: Sat 6/19/2004 6:40 PM To: Bruce Momjian Cc: Dave Page; Tom Lane; PostgreSQL-patches Subject: Re: [PATCHES] Tablespace patch review Well, whatever you call slow or not slow. I checked it; connecting

Re: [PATCHES] Compiling libpq with VisualC

2004-06-19 Thread Andreas Pflug
Two minor tweaks: sys/time.h in libpq-be.h isn't present on win32 vc6. Apparently, it isn't used in Linux either; libpq will compile without it. All usages of gettimeofday throughout the backend don't seem connection related, so libpq-be.h seems an odd place to include it. ERROR in elog.h has

Re: [PATCHES] Compiling libpq with VisualC

2004-06-20 Thread Andreas Pflug
Tom wrote: It's there to declare struct timeval, and I'm fairly certain that diking it out of the header would break things on some platforms. Where does Windows define struct timeval? struct timeval is defined in winsock.h under vc6. I'm checking for _MSC_VER now. Agreed. We define

[PATCHES] serverlog rotation/functions

2004-06-28 Thread Andreas Pflug
The attached patch includes serverlog rotation with minimal shared memory usage as discussed and functions to access it. Regards, Andreas Index: doc/src/sgml/func.sgml === RCS file:

[PATCHES] pg_tablespace_databases

2004-06-28 Thread Andreas Pflug
From an idea of Bruce, the attached patch implements the function pg_tablespace_databases(oid) RETURNS SETOF oid which delivers as set of database oids having objects in the selected tablespace, enabling an admin to examine only the databases affecting the tablespace for objects instead of

Re: [PATCHES] pg_tablespace_databases

2004-06-28 Thread Andreas Pflug
Andreas Pflug wrote: From an idea of Bruce, the attached patch implements the function pg_tablespace_databases(oid) RETURNS SETOF oid which delivers as set of database oids having objects in the selected tablespace, enabling an admin to examine only the databases affecting the tablespace

Re: [PATCHES] patch queue reminder

2004-06-30 Thread Andreas Pflug
Fabien COELHO wrote: Dear patchers, I have two minor patches that are being submitted but which do not appear yet in the official patch queue on the web site: http://momjian.postgresql.org/cgi-bin/pgpatches That site is maintained by Bruce, who is out to Armenia until next week, with

Re: [PATCHES] pg_tablespace_databases

2004-07-01 Thread Andreas Pflug
Joe Conway wrote: If there are no objections, I'll review and apply this tonight (west coast USA time). Andreas, please provide a corresponding documentation patch. Here we are. Since I don't have a SGML build environment, syntax is not checked. Regards, Andreas Index: func.sgml

Re: [PATCHES] pg_tablespace_databases

2004-07-02 Thread Andreas Pflug
Joe Conway wrote: Attached is the patch I plan to apply. There are a couple of changes from what was posted. 1) You must have meant tablespace instead of namespace here: + row +

Re: [PATCHES] serverlog rotation/functions

2004-07-06 Thread Andreas Pflug
Updated version. Only timestamp of fresh logfile in shared mem, with sanity checks. On SIGHUP, timestamp is checked if rotation was issued, as well as changed log_filename setting from postgresql.conf. Regards, Andreas Index: src/backend/postmaster/postmaster.c

Re: [PATCHES] pg_autovacuum integration attempt #2

2004-07-12 Thread Andreas Pflug
Peter Eisentraut wrote: Bruce Momjian wrote: I have added this patch plus your later comments to the patch queue. The autovacuum process still uses libpq to send its queries, which is not the idea behind backend integration. Can we consider this a non-fatal bug that has to be solved

Re: [PATCHES] serverlog rotation/functions

2004-07-13 Thread Andreas Pflug
Bruce Momjian wrote: How is this patch supposed to work? Do people need to modify postgresql.conf and then sighup the postmaster? It seems more logical for the super-user to call a server-side function. I assume calling pg_logfile_rotate() to be the standard way. calling pg_logfile_rotate

Re: [PATCHES] serverlog rotation/functions

2004-07-13 Thread Andreas Pflug
Tom Lane wrote: That was something that bothered me too. I think in the patch as given, the GUC parameter determining the logfile name would have to be PGC_POSTMASTER, ie, you could not change it on the fly because the backends wouldn't all switch together. In my original posting it was

Re: [PATCHES] serverlog rotation/functions

2004-07-14 Thread Andreas Pflug
Tom Lane wrote: That struck me as not only useless but the deliberately hard way to do it. To use that in the real world, you'd have to set up a cron job to trigger the rotation, Still on my radar... which means a lot of infrastructure and privilege; whereas ISTM the point of this feature was to

Re: [PATCHES] serverlog rotation/functions

2004-07-14 Thread Andreas Pflug
Bruce Momjian wrote: Also there are no documenttion changes. Here are the missing docs, freshly created against cvs. Regards, Andreas Index: func.sgml === RCS file: /projects/cvsroot/pgsql-server/doc/src/sgml/func.sgml,v retrieving

[PATCHES] logfile subprocess and Fancy File Functions

2004-07-17 Thread Andreas Pflug
in * postgresql.conf), using an internal naming scheme that mangles * creation time and current postmaster pid. * * Author: Andreas Pflug [EMAIL PROTECTED] * * Copyright (c) 2004, PostgreSQL Global Development Group * * * IDENTIFICATION * $PostgreSQL

Re: [PATCHES] logfile subprocess and Fancy File Functions

2004-07-18 Thread Andreas Pflug
are reached or passed, the * current logfile is closed and a new one is created (rotated). * The logfiles are stored in a subdirectory (configurable in * postgresql.conf), using an internal naming scheme that mangles * creation time and current postmaster pid. * * Author: Andreas Pflug [EMAIL

Re: [PATCHES] logfile subprocess and Fancy File Functions

2004-07-19 Thread Andreas Pflug
Magnus Hagander wrote: Super-minor nitpicking from just eyeing over the patch, not actually checking how it works. Reviewing the own code the most obvious things are overlooked. This patch changes the error message for pg_signal_backend() to only superuser may access generic file functions.

Re: [PATCHES] logfile subprocess and Fancy File Functions

2004-07-20 Thread Andreas Pflug
Bruce Momjian wrote: Andreas Pflug wrote: Very nice. You did a nice trick of reading the log filenames into a timestamp field: count = sscanf(de-d_name, %04d-%02d-%02d_%02d%02d%02d_%05d.log, yea$ You only process files that match that pattern for pg_logfiles_ls() (perhaps this should

Re: [PATCHES] logfile subprocess and Fancy File Functions

2004-07-20 Thread Andreas Pflug
Bruce Momjian wrote: Peter Eisentraut wrote: Bruce Momjian wrote: Peter Eisentraut wrote: Andreas Pflug wrote: How should the prefix be named? pgsql_ ? Make the file names configurable. He has code to interpret the file names as timestamps that can be used in queries. If we allowed full user

Re: [PATCHES] logfile subprocess and Fancy File Functions

2004-07-20 Thread Andreas Pflug
. If these limits are reached or passed, the * current logfile is closed and a new one is created (rotated). * The logfiles are stored in a subdirectory (configurable in * postgresql.conf), using an internal naming scheme that mangles * creation time and current postmaster pid. * * Author: Andreas

Re: [PATCHES] logfile subprocess and Fancy File Functions

2004-07-21 Thread Andreas Pflug
Bruce Momjian wrote: Andreas Pflug wrote: OK, new idea. Forget about modifying pg_dir_ls(). Instead add pg_file_stat the returns the file size, times. You can then easily use that for file size and times. Also, if you want, add an is_dir boolean so people can write functions that walk

Re: [PATCHES] logfile subprocess and Fancy File Functions

2004-07-21 Thread Andreas Pflug
stderr is * not available). Used before ereport/elog can be used /*- * * genfile.c * * * Copyright (c) 2004, PostgreSQL Global Development Group * * Author: Andreas Pflug [EMAIL PROTECTED] * * IDENTIFICATION

Re: [PATCHES] logfile subprocess and Fancy File Functions

2004-07-22 Thread Andreas Pflug
Bruce Momjian wrote: Here is what you can do: SELECT filename, (SELECT file_len FROM pg_file_stat(filename)), (SELECT file_ctime FROM pg_file_stat(filename)), (SELECT file_mtime FROM pg_file_stat(filename)), (SELECT file_atime FROM pg_file_stat(filename)) FROM pg_dir_ls('/etc') AS

Re: [PATCHES] logfile subprocess and Fancy File Functions

2004-07-23 Thread Andreas Pflug
Bruce Momjian wrote: Are we done? Seems pg_file_stat() works fine. Do we need other adjustments? Here are the documentation changes. Regards, Andreas Index: catalogs.sgml === RCS file:

Re: [PATCHES] [HACKERS] Function to kill backend

2004-07-26 Thread Andreas Pflug
Tom Lane wrote: If you don't mind plastering a use at your own risk sign on it, then go for it. killing a backend is obviously much more at your own risk than a descent function. Taken from your mail, I understand that a killed backend might leave some loose ends, eg. open locks, which would

[PATCHES] logger subprocess

2004-07-27 Thread Andreas Pflug
This is the known patch, with following changes: - realStdErr handed over for EXEC_BACKEND, but still not tested - Sometimes EMFILE is received in the logger's process queue, when a backend ended after a SSL connection was interrupted. This is ignored now (previously it forced an exit(1) and

[PATCHES] Admin functions contrib

2004-07-27 Thread Andreas Pflug
() AS A (filetime timestamp, pid int4, filename text); /*- * * genfile.c * * * Copyright (c) 2004, PostgreSQL Global Development Group * * Author: Andreas Pflug [EMAIL PROTECTED] * * IDENTIFICATION * $PostgreSQL

Re: [PATCHES] logger subprocess

2004-07-28 Thread Andreas Pflug
Bruce Momjian wrote: Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches It will be applied as soon as one of the PostgreSQL committers reviews and approves it. Do not apply. I'm investigating issues under win32. Main

Re: [PATCHES] Admin functions contrib

2004-07-29 Thread Andreas Pflug
Bruce Momjian wrote: I talked to Tom about this today. First, I want to apologize for running you around in circles in this. I don't think we are giving it the attention it needs because of our schedule. I also think the functionality is drifting into the new features territory and this is also

Re: [PATCHES] Admin functions contrib

2004-07-29 Thread Andreas Pflug
Bruce Momjian wrote: Basically I think we are converging on an answer that we can't do any of this for 7.5. If it's not going into the distribution as contrib or core, I'll package that as additional admin pack. I'm quite sure I can convince the win32 installer packager guys to include that as

Re: [PATCHES] Admin functions contrib

2004-07-29 Thread Andreas Pflug
Bruce Momjian wrote: If it's not going into the distribution as contrib or core, I'll package that as additional admin pack. I'm quite sure I can convince the win32 installer packager guys to include that as default-on option as soon as I'm able to prove them how it's working. Uh, but it isn't

Re: [PATCHES] Admin functions contrib

2004-07-30 Thread Andreas Pflug
Dave Page wrote: As Bruce has seen, this is some pretty nice functionality that Andreas has added to pga3, and is one of the few areas that we lag behind SQL Server etc. in on the management front. If you're curious what Bruce has seen, it was this:

Re: [PATCHES] Admin functions contrib

2004-07-31 Thread Andreas Pflug
Bruce Momjian wrote: Do people want the server file logging/rotating patch applied if it is Unix-only? Right now the patch is ifdef'ed so Win32 use of it is disabled. Andreas is asking. Please commit ASAP. Is I stated several times, I'll do the win32 as soon as I get a chance to. It's not a

Re: [PATCHES] Admin functions contrib

2004-07-31 Thread Andreas Pflug
Peter Eisentraut wrote: Bruce Momjian wrote: Do people want the server file logging/rotating patch applied if it is Unix-only? Right now the patch is ifdef'ed so Win32 use of it is disabled. How is logging typically handled on Windows? It is done using the eventlog service (which is supported as

Re: [PATCHES] Admin functions contrib

2004-07-31 Thread Andreas Pflug
Tom Lane wrote: Do people want the server file logging/rotating patch applied if it is Unix-only? Right now the patch is ifdef'ed so Win32 use of it is disabled. I'm slightly worried that we might be painting ourselves into a corner, ie implementing functionality that will never work on Windows.

[PATCHES] logger subprocess including win32

2004-08-04 Thread Andreas Pflug
and a new one is created (rotated). * The logfiles are stored in a subdirectory (configurable in * postgresql.conf), using an internal naming scheme that mangles * creation time and current postmaster pid. * * Author: Andreas Pflug [EMAIL PROTECTED] * * Copyright (c) 2004, PostgreSQL Global

[PATCHES] Win32 tablespace

2004-08-05 Thread Andreas Pflug
The attached patch implements a symlink for win32 using junctions, and uses that for win32 tablespaces. Regards, Andreas Index: tablespace.c === RCS file: /projects/cvsroot/pgsql-server/src/backend/commands/tablespace.c,v retrieving

Re: [PATCHES] logger subprocess including win32

2004-08-05 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: Attached the patch, an orgy in #ifdefs, decorated with various indents and crlf line ends (glad we have pgindent). I spent a fair amount of time fooling with this, trying to extract something that I trusted enough to apply at this late date

Re: [PATCHES] logger subprocess including win32

2004-08-05 Thread Andreas Pflug
Tom Lane wrote: if (!ReadFile(...)) { DWORD error = GetLastError(); if (error == ERROR_HANDLE_EOF) exit(0); Got it. And there's no reason that the pipe thread can't do exit(0) for itself? Not really. All threads are equivalent. BTW, should there be a last NOTICE syslogger shutting

Re: [PATCHES] Win32 tablespace

2004-08-06 Thread Andreas Pflug
Dave Page wrote: This is obviously win2k+ only though - There's a chance it might work on NT4 with =SP4, because AFAIR the updated NTFS driver already understands the W2K format. until now we've tried to support NT4 as well, although it seems that we can't get initdb to work as we'd like in the

Re: [PATCHES] Win32 tablespace

2004-08-07 Thread Andreas Pflug
Bruce Momjian wrote: OK, applied. I moved the funciton into port/dirmod.c and cleaned up the interface for Win32. Would someone test this on Win32 in case I broke something? Yes, something's broken, see patch. Second, HAVE_SYMLINK must be defined somewhere (configure?). Third, a junction is a

Re: [PATCHES] Win32 tablespace

2004-08-08 Thread Andreas Pflug
[EMAIL PROTECTED] wrote: (create/drop tablespace works too) I can *not* confirm this; after configure; make clean; make; make install I got tablespace not supported. pg_config.h lacks HAVE_SYMLINK=1. Regards, Andreas ---(end of broadcast)--- TIP 8:

Re: [PATCHES] [HACKERS] libpq problem

2004-08-11 Thread Andreas Pflug
Andreas Pflug wrote: Some recent change in libpq seems to interfere with gtk. After I tested a new pgadmin3 version on linuy yesterday, I found that the GUI is hanging after PQconnectdb was called. After the call, the db connection is fully functional, but the GUI mouse will show waiting

Re: [PATCHES] Win32 Event log

2004-08-12 Thread Andreas Pflug
Dave Page wrote: Dave Page [EMAIL PROTECTED] writes: The attached patch directs FATAL and PANIC elog's to the event log as well as their normal destination. I don't think this is a good idea. In the first place, FATAL errors are not necessarily serious or out-of-the-ordinary --- an example

[PATCHES] Compiling libpq with VC6

2004-08-13 Thread Andreas Pflug
libpq currently doesn't compile with vc6. The reason is a conflict of prototypes for rename and unlink, which happens when fe-lobj.c includes io.h. The attached patch will redefine unlink and rename only if FRONTEND is not defined. Regards, Andreas Index: port.h

Re: [PATCHES] [pgsql-hackers-win32] libpq build problem with io.h

2004-08-17 Thread Andreas Pflug
Bruce, I posted the attached patch 4 days ago, with the comment The attached patch will redefine unlink and rename only if FRONTEND is not defined.. I still believe this a good way to fix it. Tom Lane wrote: To put that in a more positive light: we like to think that our code is Posix-compliant

Re: [PATCHES] Compiling libpq with VC6

2004-08-18 Thread Andreas Pflug
Bruce Momjian wrote: The problem with this approach is that it has us using the non-reliable libc rename/unlink rather than our own in libpq. Not really. The backend will still use the reliable pg_ functions. Frontends continue to use the libc functions, which are totally sufficient in

Re: [PATCHES] Compiling libpq with VC6

2004-08-18 Thread Andreas Pflug
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Andreas Pflug wrote: Not really. The backend will still use the reliable pg_ functions. Frontends continue to use the libc functions, which are totally sufficient in non-concurrent access situations. I would like to keep full Unix semantics

Re: [PATCHES] Compiling libpq with VC6

2004-08-18 Thread Andreas Pflug
Tom Lane wrote: Hm. Given that we now support a native Windows port, do we care about building libpq with VC6 anymore? Yes please! I just tried: I renamed libpq.a to libpq.lib. pgAdmin links with that, but will crash. Regards, Andreas ---(end of

Re: [PATCHES] log_filename_prefix -- log_filename + strftime()

2004-08-27 Thread Andreas Pflug
Tom Lane wrote: Ed L. [EMAIL PROTECTED] writes: Attached is a patch which replaces the 'log_filename_prefix' configuration directive with a similar 'log_filename' directive. + changes the default log filename to exclude the PID; This would be better stated as makes it impossible to use the PID

  1   2   >