[PATCHES] [pgsql-hackers-win32] pg_ctl --help
pg_ctl --help ---skiped--- -P user name of account to register PostgreSQL server -U password of account to register PostgreSQL server ---skiped--- I think that isn't right ;) Good thinking... :-) Patch attached (but probably easier for any committer to make the change directly) Claudio --- Certain disclaimers and policies apply to all email sent from Memetrics. For the full text of these disclaimers and policies see a href=http://www.memetrics.com/emailpolicy.html;http://www.memetrics.com/em ailpolicy.html/a pg_ctl.patch Description: Binary data ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [PATCHES] build infrastructure for extensions v3
Dear Peter, I am still opposed to adding more targets of the form light-install, It is a renaming of the previous 'install' target, as the new install is the previous 'server-install', so it is no different from the current status. I let 'light-install' as a compromise wrt Tom view that the default installation should not include header files, so that it would be still easy to do that... client-only install, etc. Ok, as you wish. I just felt it was easy and useful. Please discuss this on -hackers. It can be done as a separate patch later on if need be. Ok. While I now understand what you are doing in contrib, I ask who is going to want to maintain two parallel sets of makefiles, one for PGXS and one for in-tree builds? Yep, that is indeed a good point. One who is going to want to use the PGXS ones anyway? Well, I've been disappointed in the past when I wanted to test a contrib and had to reconfigure everything to do so. So I really think it is useful to be able to add contribs as an after-thought. I really tend to think that there could be the pgxs only version, but that would break compile without installing, and you don't want that, as previously discussed. So there is no perfect solution:-( What I can do is to enable the current makefiles to use pgxs if desired by the user, maybe with some switch, say make install vs make USE_PGXS=yes install... I'll lose the clean illustration part but would have one makefile only and still enable using pgxs if needed. I realize they're good examples, but examples should be put into the documentation, so people can find them. Humm. Paste your documentation (pgxs.sgml) somewhere into xfunc.sgml, where it discusses writing user-defined functions. This material isn't long enough to warrant a chapter of its own. Ok. + ifdef PGXS + LDFLAGS += -L$(pkglibdir) + endif needs to disappear. There is nothing to link with in there. (If there is, that's a bug.) I think I added it because it did not work without that, but I can recheck whether it is really needed. libpgport should be installed in the normal libdir. Ok. I'll submit a new patch on tomorrow to hopefully address all these issues. Thanks a lot for all these comments, have a nice day, -- Fabien Coelho - [EMAIL PROTECTED] ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])
Re: [PATCHES] build infrastructure for extensions v3
Patch withdrawn by author. --- Fabien COELHO wrote: Dear patchers, Please find attached version number 3 for a patch to enable extensions such as contribs or external add-ons to be installed simply with an already installed postgresql. This version addresses Peter's comments about src/makefiles/Makefile.* that do not need to be installed. It works for me, as previous versions. See other comments in previous submissions and responses. -- Fabien. Content-Description: [ Attachment, skipping... ] ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [PATCHES] serverlog rotation/functions
Path withdrawn by author. --- Andreas Pflug wrote: 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 === RCS file: /projects/cvsroot/pgsql-server/src/backend/postmaster/postmaster.c,v retrieving revision 1.405 diff -u -r1.405 postmaster.c --- src/backend/postmaster/postmaster.c 24 Jun 2004 21:02:55 - 1.405 +++ src/backend/postmaster/postmaster.c 6 Jul 2004 22:12:22 - @@ -729,6 +729,11 @@ reset_shared(PostPortNumber); /* + * Opens alternate log file + */ + LogFileInit(); + + /* * Estimate number of openable files. This must happen after setting * up semaphores, because on some platforms semaphores count as open * files. Index: src/backend/utils/adt/misc.c === RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/adt/misc.c,v retrieving revision 1.35 diff -u -r1.35 misc.c --- src/backend/utils/adt/misc.c 2 Jul 2004 18:59:22 - 1.35 +++ src/backend/utils/adt/misc.c 6 Jul 2004 22:12:34 - @@ -202,3 +202,137 @@ FreeDir(fctx-dirdesc); SRF_RETURN_DONE(funcctx); } + + +extern FILE *logfile; // in elog.c +#define MAXLOGFILECHUNK 5 + +static char *absClusterPath(text *arg) +{ + char *filename; + + if (is_absolute_path(VARDATA(arg))) + filename=VARDATA(arg); + else + { + filename = palloc(strlen(DataDir)+VARSIZE(arg)+2); + sprintf(filename, %s/%s, DataDir, VARDATA(arg)); + } + return filename; +} + + +Datum pg_logfile_get(PG_FUNCTION_ARGS) +{ + size_t size=MAXLOGFILECHUNK; + char *buf=0; + size_t nbytes; + FILE *f; + + if (!PG_ARGISNULL(0)) + size = PG_GETARG_INT32(0); + if (size MAXLOGFILECHUNK) + { + size = MAXLOGFILECHUNK; + ereport(WARNING, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg(Maximum size is %d., size))); + } + + if (PG_ARGISNULL(2)) + f = logfile; + else + { +/* explicitely named logfile */ + char *filename = absClusterPath(PG_GETARG_TEXT_P(2)); + f = fopen(filename, r); + if (!f) + { + ereport(WARNING, + (errcode_for_file_access(), + errmsg(file not found %s, filename))); + PG_RETURN_NULL(); + } + } + + if (f) + { + + if (PG_ARGISNULL(1)) + fseek(f, -size, SEEK_END); + else + { + long pos = PG_GETARG_INT32(1); + if (pos = 0) + fseek(f, pos, SEEK_SET); + else + fseek(f, pos, SEEK_END); + } + buf = palloc(size+1); + nbytes = fread(buf, 1, size, f); + buf[nbytes] = 0; + + fseek(f, 0, SEEK_END); + + if (!PG_ARGISNULL(2)) + fclose(f); + } + + if (buf) + PG_RETURN_CSTRING(buf); + else + PG_RETURN_NULL(); +} + + +Datum pg_logfile_length(PG_FUNCTION_ARGS) +{ + if (PG_ARGISNULL(0)) + { + if (logfile) + { + fflush(logfile); + PG_RETURN_INT32(ftell(logfile)); + } + } + else + { + struct stat fst; + fst.st_size=0; + stat(absClusterPath(PG_GETARG_TEXT_P(0)), fst); + + PG_RETURN_INT32(fst.st_size); + } + PG_RETURN_INT32(0); +} + + +Datum pg_logfile_name(PG_FUNCTION_ARGS) +{ + char *filename=LogFileName(); + if (filename) + { + if (strncmp(filename, DataDir, strlen(DataDir))) + PG_RETURN_CSTRING(filename); + else + PG_RETURN_CSTRING(filename+strlen(DataDir)+1); + } + PG_RETURN_NULL(); +} + + +Datum pg_logfile_rotate(PG_FUNCTION_ARGS) +{ + char *renamedFile = LogFileRotate(); + + if (renamedFile) + { + if (strncmp(renamedFile, DataDir, strlen(DataDir))) + PG_RETURN_CSTRING(renamedFile); + else + PG_RETURN_CSTRING(renamedFile+strlen(DataDir)+1); + } + else + PG_RETURN_NULL(); +} + Index:
Re: [PATCHES] add missing options to pg_dumpall
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. --- \Stefan Kaltenbrunner wrote: Bruce Momjian wrote: Patch applied. Thanks. thanks - that's wonderful news :-) However the patch as it went in has a minor cosmetic issues with the display of the --help output. Maybe something like the attached patch should be applied to restore the alphabetical option ordering and make the output more like the pg_dump output. Stefan Index: src/bin/pg_dump/pg_dumpall.c === RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_dump/pg_dumpall.c,v retrieving revision 1.44 diff -u -r1.44 pg_dumpall.c --- src/bin/pg_dump/pg_dumpall.c 12 Jul 2004 14:35:45 - 1.44 +++ src/bin/pg_dump/pg_dumpall.c 14 Jul 2004 17:56:04 - @@ -310,26 +310,26 @@ printf(_(Usage:\n)); printf(_( %s [OPTION]...\n), progname); - printf(_(\nOptions:\n)); + printf(_(\nGeneral options:\n)); + printf(_( -i, --ignore-version proceed even when server version mismatches\n + pg_dumpall version\n)); + printf(_( --help show this help, then exit\n)); + printf(_( --versionoutput version information, then exit\n)); + printf(_(\nOptions controlling the output content:\n)); printf(_( -a, --data-only dump only the data, not the schema\n)); printf(_( -c, --clean clean (drop) databases prior to create\n)); printf(_( -d, --insertsdump data as INSERT, rather than COPY, commands\n)); printf(_( -D, --column-inserts dump data as INSERT commands with column names\n)); printf(_( -g, --globals-only dump only global objects, no databases\n)); - printf(_( -i, --ignore-version proceed even when server version mismatches\n - pg_dumpall version\n)); - printf(_( -s, --schema-onlydump only the schema, no data\n)); - printf(_( -S, --superuser=NAME specify the superuser user name to use in the dump\n)); printf(_( -o, --oids include OIDs in dump\n)); printf(_( -O, --no-owner do not output commands to set object ownership\n)); - printf(_( -v, --verboseverbose mode\n)); + printf(_( -s, --schema-onlydump only the schema, no data\n)); + printf(_( -S, --superuser=NAME specify the superuser user name to use in the dump\n)); printf(_( -x, --no-privileges do not dump privileges (grant/revoke)\n)); printf(_( -X disable-dollar-quoting, --disable-dollar-quoting\n disable dollar quoting, use SQL standard quoting\n)); printf(_( -X disable-triggers, --disable-triggers\n - disable triggers during data-only restore\n)); - printf(_( --help show this help, then exit\n)); - printf(_( --versionoutput version information, then exit\n)); + disable triggers during data-only restore\n)); printf(_(\nConnection options:\n)); printf(_( -h, --host=HOSTNAME database server host or socket directory\n)); -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [PATCHES] [HACKERS] possibly updating techdocs; mysql2pgsql on gborg
hi, just a contrib/mysql/README patch. Somehow the links got reversed. 5c5 http://gborg.postgresql.org/project/mysql2psql/projdisplay.php --- http://www.omnistarinc.com/~fonin/downloads.php#my2pg 9c9 Another tool, mysql2pgsql, can be found at: --- A third tool, mysql2pgsql.perl, can be found at: 11c11 http://www.omnistarinc.com/~fonin/downloads.php#my2pg --- http://gborg.postgresql.org/project/mysql2psql/projdisplay.php On Thu, Jul 15, 2004 at 12:45:51AM -0400, Robert Treat wrote: Hey Joseph, just noticed this in my drafts folder... not sure why it was there, hope it makes sense to you :-) OK, I have updated the link on the techdocs site, and after looking at your project statement have a few recommendations for you. The first is that you need to put some mention that your script is a descendant of Dobrica's script just to give props to those who came before but also so people know to use your script over the old one. Second, you need to send a patch to pgsql-patches for the postgresql core server that updates contrib/mysql/README and contrib/mysql/mysql2pgsql.pl to reference your newer script. Since we are technically past feature freeze, you need to include a list of any bugs that were fixed in the old script by the new script. Hope this helps. Robert Treat On Thursday 01 July 2004 17:22, you wrote: I don't see the old link you are referring to (and neither did grep); is this on the main page of techdocs or someplace else? Robert Treat If the main page is http://techdocs.postgresql.org/ (which may be index.htm or index.php but my browser doesn't show) that is where the outdated link is. This is what I see when I do view source on that page: lia href=/redir.php?link=http://docman.sourceforge.net/home_html/projects/sql/ mysql2pgsql target=_blankmysql2pgsql/a - A Perl script used to convert MySQL databases dump to a PostgreSQL-compatible format, by a href=/redir.php?link=mailto:[EMAIL PROTECTED] target=_blankDobrica Pavlinusic/a/li HISTORY === Dobrica Pavlinusic has a project called docman at sourceforge In a subdirectory of the project there he put the file mysql2pgsql That file on sourceforge hasn't been edited since 19-Apr-2001 (dir listing) The most recent version of the mysql2pgsql script is at http://gborg.postgresql.org/project/mysql2psql/projdisplay.php thanks for your reply. joesp -- Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [PATCHES] [HACKERS] possibly updating techdocs; mysql2pgsql on gborg
Thanks, fixed. --- joe speigle wrote: hi, just a contrib/mysql/README patch. Somehow the links got reversed. 5c5 http://gborg.postgresql.org/project/mysql2psql/projdisplay.php --- http://www.omnistarinc.com/~fonin/downloads.php#my2pg 9c9 Another tool, mysql2pgsql, can be found at: --- A third tool, mysql2pgsql.perl, can be found at: 11c11 http://www.omnistarinc.com/~fonin/downloads.php#my2pg --- http://gborg.postgresql.org/project/mysql2psql/projdisplay.php On Thu, Jul 15, 2004 at 12:45:51AM -0400, Robert Treat wrote: Hey Joseph, just noticed this in my drafts folder... not sure why it was there, hope it makes sense to you :-) OK, I have updated the link on the techdocs site, and after looking at your project statement have a few recommendations for you. The first is that you need to put some mention that your script is a descendant of Dobrica's script just to give props to those who came before but also so people know to use your script over the old one. Second, you need to send a patch to pgsql-patches for the postgresql core server that updates contrib/mysql/README and contrib/mysql/mysql2pgsql.pl to reference your newer script. Since we are technically past feature freeze, you need to include a list of any bugs that were fixed in the old script by the new script. Hope this helps. Robert Treat On Thursday 01 July 2004 17:22, you wrote: I don't see the old link you are referring to (and neither did grep); is this on the main page of techdocs or someplace else? Robert Treat If the main page is http://techdocs.postgresql.org/ (which may be index.htm or index.php but my browser doesn't show) that is where the outdated link is. This is what I see when I do view source on that page: lia href=/redir.php?link=http://docman.sourceforge.net/home_html/projects/sql/ mysql2pgsql target=_blankmysql2pgsql/a - A Perl script used to convert MySQL databases dump to a PostgreSQL-compatible format, by a href=/redir.php?link=mailto:[EMAIL PROTECTED] target=_blankDobrica Pavlinusic/a/li HISTORY === Dobrica Pavlinusic has a project called docman at sourceforge In a subdirectory of the project there he put the file mysql2pgsql That file on sourceforge hasn't been edited since 19-Apr-2001 (dir listing) The most recent version of the mysql2pgsql script is at http://gborg.postgresql.org/project/mysql2psql/projdisplay.php thanks for your reply. joesp -- Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
[PATCHES] win32 readline
Readline is pretty badly broken under mingw. Basically, it disables the alt-gr key, which renders psql almost useless on most locales (no way to type backslash, and a whole lot of other characters, for example). This patch disables readline on win32. (meaning it's back to working the way it did in = 7.4, since msvc compiles have never supported readline) The patch also contains two definitions for win32/port/security.c that were for some reason not included when the rest of the win32-admin-check patch was applied earlier, that I stumbled on while making this patch. //Magnus readline_win32.patch Description: readline_win32.patch ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
[PATCHES] initdb authentication
Ok, here is one more try at the initdb default authentication stuff. This one adds the switches --ident and --trust, which will configure pg_hba.conf with ident and trust authentication respectively. If trust authentication is selected, a warning is written to pg_hba.conf. The old switches for password prompt/file still apply. This one makes it mandatory to pick some kind of authentication. If that's not wanted, it's easy to change it to default to trust (which I think is wrong, but we've been through that already..) Oh, and this time, the comments are updated :-) //Magnus initdb_auth.patch Description: initdb_auth.patch ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [PATCHES] initdb authentication
Magnus Hagander wrote: This one makes it mandatory to pick some kind of authentication. If that's not wanted, it's easy to change it to default to trust (which I think is wrong, but we've been through that already..) I don't think I like any of this. Sooner rather than later, people need to look at pg_hba.conf and think about it. I don't like switches that induce them to skip that step. And I certainly don't like forcing extra switches on users that just try out an installation locally. I would be in favor of making everything supertight and secure by default, no questions asked. The is a definable goal. But as long as there is no agreement on that, let's not create illusions in that direction while inconveniencing a bunch of people for little gain. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [PATCHES] initdb authentication
Peter Eisentraut wrote: Magnus Hagander wrote: This one makes it mandatory to pick some kind of authentication. If that's not wanted, it's easy to change it to default to trust (which I think is wrong, but we've been through that already..) I don't think I like any of this. Sooner rather than later, people need to look at pg_hba.conf and think about it. I don't like switches that induce them to skip that step. And I certainly don't like forcing extra switches on users that just try out an installation locally. I would be in favor of making everything supertight and secure by default, no questions asked. The is a definable goal. But as long as there is no agreement on that, let's not create illusions in that direction while inconveniencing a bunch of people for little gain. I think the basic problem is that right now there is no way to do an initdb and have it be secure _before_ you edit pg_hba.conf. That isn't acceptable. If I am on an insecure machine, the window if time between initdb and editing of pg_hba.conf is pretty bad. I could edit pg_hba.conf.sample, but then I am editing a sample file. I think Magnus's patch takes us closer to secure. I do agree that by default we shouldn't require any flag and install unsecure and issue a warning. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 8: explain analyze is your friend
Re: [PATCHES] initdb authentication
On Thu, Jul 15, 2004 at 11:20:46PM +0200, Peter Eisentraut wrote: Magnus Hagander wrote: This one makes it mandatory to pick some kind of authentication. If that's not wanted, it's easy to change it to default to trust (which I think is wrong, but we've been through that already..) I don't think I like any of this. Sooner rather than later, people need to look at pg_hba.conf and think about it. I don't like switches that induce them to skip that step. And I certainly don't like forcing extra switches on users that just try out an installation locally. I agree with this sentiment. On the spanish list is common to see people trying to do things on an RPM-installed server, which is configured to use IDENT by default, and asking why they cannot connect. The answer is always to look at pg_hba.conf and the relevant documentation. If it were my choice, I'd disallow connections by default completely, and spit a reject message along the lines of you should have a look at pg_hba.conf. -- Alvaro Herrera (alvherre[a]dcc.uchile.cl) Uno combate cuando es necesario... ¡no cuando está de humor! El humor es para el ganado, o para hacer el amor, o para tocar el baliset. No para combatir. (Gurney Halleck) ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])
Re: [PATCHES] initdb authentication
Bruce Momjian [EMAIL PROTECTED] writes: I think the basic problem is that right now there is no way to do an initdb and have it be secure _before_ you edit pg_hba.conf. That isn't acceptable. If I am on an insecure machine, the window if time between initdb and editing of pg_hba.conf is pretty bad. Bruce, you of all people should be aware that there is no such window. The postmaster *is not running* and cannot accept any hostile connections if you haven't started it. Argue all you like about the potential for novice error, but don't try to scare us by claiming that it's inherently insecure. regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])
Re: [PATCHES] initdb authentication
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: I think the basic problem is that right now there is no way to do an initdb and have it be secure _before_ you edit pg_hba.conf. That isn't acceptable. If I am on an insecure machine, the window if time between initdb and editing of pg_hba.conf is pretty bad. Bruce, you of all people should be aware that there is no such window. The postmaster *is not running* and cannot accept any hostile connections if you haven't started it. Argue all you like about the potential for novice error, but don't try to scare us by claiming that it's inherently insecure. Ah, I forgot about postmaster start. (My scripts do it automatically here.) Maybe we just need to print a warning telling people they should secure pg_hba.conf before starting the postmaster on an insecure machine. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [PATCHES] [subxacts] Savepoint syntax
On Wed, Jul 14, 2004 at 03:03:02PM -0400, Alvaro Herrera wrote: Please test, review and apply. If anyone is able to crash the server using this I'll be most interested. I just noticed that the misc regression test is generated, and so it needs to be patched ... interdiff output attached. -- Alvaro Herrera (alvherre[a]dcc.uchile.cl) Entristecido, Wutra (canción de Las Barreras) echa a Freyr a rodar y a nosotros al mar only in patch2: unchanged: --- src/test/regress/output/misc.source 10 May 2004 22:44:49 - 1.42 +++ src/test/regress/output/misc.source 16 Jul 2004 05:08:18 - @@ -644,6 +644,7 @@ real_city reltime_tbl road + savepoints shighway slow_emp4000 street @@ -661,7 +662,7 @@ toyemp varchar_tbl xacttest -(97 rows) +(98 rows) SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))); name ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly