Thursday, 25 January 2007
|
| Problem with result ordering Thorsten Krner 19:02:35 |
| | Hi,
when I fire the following query: select m_id, m_u_id, m_title, m_rating from tablename where m_id in (26250, 11042, 16279, 42197, 672089);
I will get the same results in the same order, as in in the next query: select m_id, m_u_id, m_title, m_rating from tablename where m_id in (11042,42197,672089,26250,16279);
I wonder, how it is possible, to retrieve the results in the same order, as queried in the list. The listed IDs are from an application outside the database.
Version is PostgreSQL 8.2.1
Has anyone an idea, how to do this, while PostgreSQL knows nothing about hints, like oracle does?
THX, Thorsten
---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
|
| | 9 answers | Add comment |
|
| Access last inserted tuple info... Luis D. GarcМa 19:02:03 |
| | Hi, I'm working on a modification of PostgreSQL 8.1.4 and I need to access the information stored in the last tuple inserted in a table (All this from the backend code).
Could anyone please help me on this?
Greetings and Thanks... -- Luis D. GarcМa M.
Telf: (+58) 2418662663 Cel.: (+58) 4143482018
- FACYT - UC - - ComputaciСn -
|
| | 3 answer | Add comment |
|
| Re: Subject: Postgres processes have a burst of CPU usage Jim C. Nasby 18:43:12 |
| | On Tue, Jan 23, 2007 at 07:47:26AM -0800, Subramaniam Aiylam wrote:> Hello all,>
I have a setup in which four client machines access> a Postgres database (8.1.1) running on a Linux box.> So, there are connections from each machine to the> database; hence, the Linux box has about 2 postgres> processes associated with each machine.> I am using the JDBC driver> (postgresql-8.1-404.jdbc3.jar) to talk to the> database. I am also using the Spring framework(1.2.2)> and Hibernate (3.0.5) on top of JDBC. I use Apache's Beware of Hibernate... it likes to abuse the RDBMS...
DBCP database connection pool (1.2.1).> Now, there is one particular update that I make from> one of the client machines - this involves a> reasonably large object graph (from the Java point of> view). It deletes a bunch of rows (around 20 rows in> all) in 4-5 tables and inserts another bunch into the> same tables.> When I do this, I see a big spike in the CPU usage> of postgres processes that are associated with ALL the> client machines, not just the one I executed the> delete/insert operation on. The spike seems to happen> a second or two AFTER the original update completes> and last for a few seconds.> Is it that this operation is forcibly clearing some> client cache on ALL the postgres processes? Why is> there such an interdependency? Can I set some> parameter to turn this off? No, wouldn't be clearing anything. Would the other connections be updating the same data? If so they could be waiting on locks that the graph-updating code has acquired.
I suggest you turn on query logging and see what commands are actually being sent to the database. -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend
|
| | Add comment |
|
| upgrading pl/pgsql triggers from 7.4 to 8.2 Louis-David Mitterrand 18:12:07 |
| | Hello,
We tried upgrading a 7.4 base to 8.2 and found many issues with the triggers. What are the main changes in the pl/pgsql syntax or contraints checking between these two version?
Thanks,
---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster
|
| | 1 answer | Add comment |
|
| Table Meta-Data Greg Lindstrom 18:09:57 |
| | Hello,
I am running Postgres 8.0 on a Gento Box and would like to access the information about the tables in my database. How do I access the column names, data types, comments, etc?
Thanks, --greg
-- Greg Lindstrom 501 975.4859 (office) Programmer 501 219-4455 (fax) NovaSys Health greg.lindstrom@novasyshealth.com Little Rock, Arkansas
"We are the music makers, and we are the dreamers of dreams." W.W.
---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
|
| | 3 answer | Add comment |
|
| [pgsql-patches] pg_dumpall -f <filename> option Dave Page 18:08:18 |
| | Per discussion on -hackers, the attached patch adds the option
-f, --file=FILENAME
to pg_dumpall. In order to support this, a new (undocumented) format option (-Fa) is added to pg_dump which is identical to -Fp, except that the output file is opened for append rather than write.
This patch should be applied over the top of my previous patch (pg_dumpall_default_database3.diff).
Regards, Dave
diff -cr pgsql.orig/doc/src/sgml/ref/pg_dumpall.sgml pgsql.append/doc/src/sgml/ref/pg_dumpall.sgml *** pgsql.orig/doc/src/sgml/ref/pg_dumpall.sgmlTue Jan 16 09:36:33 2007 --- pgsql.append/doc/src/sgml/ref/pg_dumpall.sgmlTue Jan 16 11:19:05 2007 *************** *** 128,133 **** --- 128,143 ---- </para> </listitem> </varlistentry> + + <varlistentry> + <term><option>-f <replaceable class="parameter">filename</replaceable></option></term> + <term><option>--file=<replaceable class="parameter">filename</replaceable></option></term> + <listitem> + <para> + Write the output to the specified file. + </para> + </listitem> + </varlistentry> <varlistentry> <term><option>-g</option></term> diff -cr pgsql.orig/src/bin/pg_dump/pg_backup.h pgsql.append/src/bin/pg_dump/pg_backup.h *** pgsql.orig/src/bin/pg_dump/pg_backup.hMon Jan 15 12:54:05 2007 --- pgsql.append/src/bin/pg_dump/pg_backup.hTue Jan 16 10:21:12 2007 *************** *** 46,51 **** --- 46,58 ---- archNull = 4 } ArchiveFormat; + typedef enum _archiveMode + { + archModeAppend, + archModeWrite, + archModeRead + } ArchiveMode; + /* *We may want to have some more user-readable data, but in the mean *time this gives us some abstraction and type checking. *************** *** 166,172 **** /* Create a new archive */ extern Archive *CreateArchive(const char *FileSpec, const ArchiveFormat fmt, ! const int compression); /* The --list option */ extern void PrintTOCSummary(Archive *AH, RestoreOptions *ropt); --- 173,179 ---- /* Create a new archive */ extern Archive *CreateArchive(const char *FileSpec, const ArchiveFormat fmt, ! const int compression, ArchiveMode mode); /* The --list option */ extern void PrintTOCSummary(Archive *AH, RestoreOptions *ropt); diff -cr pgsql.orig/src/bin/pg_dump/pg_backup_archiver.c pgsql.append/src/bin/pg_dump/pg_backup_archiver.c *** pgsql.orig/src/bin/pg_dump/pg_backup_archiver.cMon Jan 15 12:54:05 2007 --- pgsql.append/src/bin/pg_dump/pg_backup_archiver.cTue Jan 16 11:10:16 2007 *************** *** 86,95 **** /* Public */ Archive * CreateArchive(const char *FileSpec, const ArchiveFormat fmt, ! const int compression) { ! ArchiveHandle *AH = _allocAH(FileSpec, fmt, compression, archModeWrite); return (Archive *) AH; } --- 86,95 ---- /* Public */ Archive * CreateArchive(const char *FileSpec, const ArchiveFormat fmt, ! const int compression, ArchiveMode mode) { ! ArchiveHandle *AH = _allocAH(FileSpec, fmt, compression, mode); return (Archive *) AH; } *************** *** 203,209 **** /* * Setup the output file if necessary. ! */ if (ropt->filename || ropt->compression) sav = SetOutput(AH, ropt->filename, ropt->compression); --- 203,209 ---- /* * Setup the output file if necessary. ! */ if (ropt->filename || ropt->compression) sav = SetOutput(AH, ropt->filename, ropt->compression); *************** *** 940,949 **** else #endif {/* Use fopen */ ! if (fn >= 0) ! AH->OF = fdopen(dup(fn), PG_BINARY_W); else ! AH->OF = fopen(filename, PG_BINARY_W); AH->gzOut = 0; } --- 940,959 ---- else #endif {/* Use fopen */ ! if (AH->mode == archModeAppend) ! { ! if (fn >= 0) ! AH->OF = fdopen(dup(fn), PG_BINARY_A); ! else ! AH->OF = fopen(filename, PG_BINARY_A); ! } else ! { ! if (fn >= 0) ! AH->OF = fdopen(dup(fn), PG_BINARY_W); ! else ! AH->OF = fopen(filename, PG_BINARY_W); ! } AH->gzOut = 0; } diff -cr pgsql.orig/src/bin/pg_dump/pg_backup_archiver.h pgsql.append/src/bin/pg_dump/pg_backup_archiver.h *** pgsql.orig/src/bin/pg_dump/pg_backup_archiver.hMon Jan 15 12:54:05 2007 --- pgsql.append/src/bin/pg_dump/pg_backup_archiver.hTue Jan 16 10:20:54 2007 *************** *** 122,133 **** typedef size_t (*CustomOutPtr) (struct _archiveHandle * AH, const void *buf, size_t len); - typedef enum _archiveMode - { - archModeWrite, - archModeRead - } ArchiveMode; - typedef struct _outputContext { void *OF; --- 122,127 ---- diff -cr pgsql.orig/src/bin/pg_dump/pg_dump.c pgsql.append/src/bin/pg_dump/pg_dump.c *** pgsql.orig/src/bin/pg_dump/pg_dump.cMon Jan 15 12:54:05 2007 --- pgsql.append/src/bin/pg_dump/pg_dump.cTue Jan 16 11:08:21 2007 *************** *** 477,501 **** /* open the output file */ switch (format[0]) { case 'c': case 'C': ! g_fout = CreateArchive(filename, archCustom, compressLevel); break; case 'f': case 'F': ! g_fout = CreateArchive(filename, archFiles, compressLevel); break; case 'p': case 'P': plainText = 1; ! g_fout = CreateArchive(filename, archNull, 0); break; case 't': case 'T': ! g_fout = CreateArchive(filename, archTar, compressLevel); break; default: --- 477,507 ---- /* open the output file */ switch (format[0]) { + case 'a': + case 'A': + plainText = 1; + g_fout = CreateArchive(filename, archNull, 0, archModeAppend); + break; + case 'c': case 'C': ! g_fout = CreateArchive(filename, archCustom, compressLevel, archModeWrite); break; case 'f': case 'F': ! g_fout = CreateArchive(filename, archFiles, compressLevel, archModeWrite); break; case 'p': case 'P': plainText = 1; ! g_fout = CreateArchive(filename, archNull, 0, archModeWrite); break; case 't': case 'T': ! g_fout = CreateArchive(filename, archTar, compressLevel, archModeWrite); break; default: diff -cr pgsql.orig/src/bin/pg_dump/pg_dumpall.c pgsql.append/src/bin/pg_dump/pg_dumpall.c *** pgsql.orig/src/bin/pg_dump/pg_dumpall.cTue Jan 16 09:36:33 2007 --- pgsql.append/src/bin/pg_dump/pg_dumpall.cTue Jan 16 11:19:44 2007 *************** *** 68,90 **** static intuse_setsessauth = 0; static intserver_version; int main(int argc, char *argv[]) { ! char *pghost = NULL; ! char *pgport = NULL; ! char *pguser = NULL; ! char *pgdb = NULL; boolforce_password = false; booldata_only = false; boolglobals_only = false; boolroles_only = false; booltablespaces_only = false; boolschema_only = false; ! PGconn *conn; intencoding; ! const char *std_strings; intc, ret; --- 68,92 ---- static intuse_setsessauth = 0; static intserver_version; + static FILE*OPF; + static char*filename = NULL; int main(int argc, char *argv[]) { ! char*pghost = NULL; ! char*pgport = NULL; ! char*pguser = NULL; ! char*pgdb = NULL; boolforce_password = false; booldata_only = false; boolglobals_only = false; boolroles_only = false; booltablespaces_only = false; boolschema_only = false; ! PGconn*conn; intencoding; ! const char*std_strings; intc, ret; *************** *** 94,99 **** --- 96,102 ---- {"inserts", no_argument, NULL, 'd'}, {"attribute-inserts", no_argument, NULL, 'D'}, {"column-inserts", no_argument, NULL, 'D'}, + {"file", required_argument, NULL, 'f'}, {"globals-only", no_argument, NULL, 'g'}, {"host", required_argument, NULL, 'h'}, {"ignore-version", no_argument, NULL, 'i'}, *************** *** 167,173 **** pgdumpopts = createPQExpBuffer(); ! while ((c = getopt_long(argc, argv, "acdDgh:il:oOp:rsS:tU:vWxX:", long_options, &optindex)) != -1) { switch (c) { --- 170,176 ---- pgdumpopts = createPQExpBuffer(); ! while ((c = getopt_long(argc, argv, "acdDf:gh:il:oOp:rsS:tU:vWxX:", long_options, &optindex)) != -1) { switch (c) { *************** *** 184,189 **** --- 187,202 ---- case 'D': appendPQExpBuffer(pgdumpopts, " -%c", c); break; + + case 'f': + filename = optarg; + #ifndef WIN32 + appendPQExpBuffer(pgdumpopts, " -f '%s'", filename); + #else + appendPQExpBuffer(pgdumpopts, " -f \"%s\"", filename); + #endif + + break; case 'g': globals_only = true; *************** *** 377,382 **** --- 390,411 ---- exit(1); } } + + /* + * Open the output file if required, otherwise use stdout + */ + if (filename) + { + OPF = fopen(filename, PG_BINARY_W); + if (!OPF) + { + fprintf(stderr, _("%s: could not open the output file \"%s\"\n"), + progname, filename); + exit(1); + } + } + else + OPF = stdout; /* * Get the active encoding and the standard_conforming_strings setting, so *************** *** 387,407 **** if (!std_strings) std_strings = "off"; ! printf("--\n-- PostgreSQL database cluster dump\n--\n\n"); if (verbose) dumpTimestamp("Started on"); ! printf("\\connect postgres\n\n"); if (!data_only) { /* Replicate encoding and std_strings in output */ ! printf("SET client_encoding = '%s';\n", pg_encoding_to_char(encoding)); ! printf("SET standard_conforming_strings = %s;\n", std_strings); if (strcmp(std_strings, "off") == 0) ! printf("SET escape_string_warning = 'off';\n"); ! printf("\n"); if (!tablespaces_only) { --- 416,436 ---- if (!std_strings) std_strings = "off"; ! fprintf(OPF, "--\n-- PostgreSQL database cluster dump\n--\n\n"); if (verbose) dumpTimestamp("Started on"); ! fprintf(OPF, "\\connect postgres\n\n"); if (!data_only) { /* Replicate encoding and std_strings in output */ ! fprintf(OPF, "SET client_encoding = '%s';\n", pg_encoding_to_char(encoding)); ! fprintf(OPF, "SET standard_conforming_strings = %s;\n", std_strings); if (strcmp(std_strings, "off") == 0) ! fprintf(OPF, "SET escape_string_warning = 'off';\n"); ! fprintf(OPF, "\n"); if (!tablespaces_only) { *************** *** 434,440 **** if (verbose) dumpTimestamp("Completed on"); ! printf("--\n-- PostgreSQL database cluster dump complete\n--\n\n"); exit(0); } --- 463,472 ---- if (verbose) dumpTimestamp("Completed on"); ! fprintf(OPF, "--\n-- PostgreSQL database cluster dump complete\n--\n\n"); ! ! if (filename) ! fclose(OPF); exit(0); } *************** *** 449,454 **** --- 481,487 ---- printf(_(" %s [OPTION]...\n"), progname); printf(_("\nGeneral options:\n")); + printf(_(" -f, --file=FILENAME output file name\n")); printf(_(" -i, --ignore-version proceed even when server version mismatches\n" " pg_dumpall version\n")); printf(_(" --help show this help, then exit\n")); *************** *** 571,577 **** i_rolcomment = PQfnumber(res, "rolcomment"); if (PQntuples(res) > 0) ! printf("--\n-- Roles\n--\n\n"); for (i = 0; i < PQntuples(res); i++) { --- 604,610 ---- i_rolcomment = PQfnumber(res, "rolcomment"); if (PQntuples(res) > 0) ! fprintf(OPF, "--\n-- Roles\n--\n\n"); for (i = 0; i < PQntuples(res); i++) { *************** *** 641,647 **** appendPQExpBuffer(buf, ";\n"); } ! printf("%s", buf->data); if (server_version >= 70300) dumpUserConfig(conn, rolename); --- 674,680 ---- appendPQExpBuffer(buf, ";\n"); } ! fprintf(OPF, "%s", buf->data); if (server_version >= 70300) dumpUserConfig(conn, rolename); *************** *** 649,655 **** PQclear(res); ! printf("\n\n"); destroyPQExpBuffer(buf); } --- 682,688 ---- PQclear(res); ! fprintf(OPF, "\n\n"); destroyPQExpBuffer(buf); } *************** *** 678,684 **** "ORDER BY 1,2,3"); if (PQntuples(res) > 0) ! printf("--\n-- Role memberships\n--\n\n"); for (i = 0; i < PQntuples(res); i++) { --- 711,717 ---- "ORDER BY 1,2,3"); if (PQntuples(res) > 0) ! fprintf(OPF, "--\n-- Role memberships\n--\n\n"); for (i = 0; i < PQntuples(res); i++) { *************** *** 687,702 **** char *grantor = PQgetvalue(res, i, 2); char *option = PQgetvalue(res, i, 3); ! printf("GRANT %s", fmtId(roleid)); ! printf(" TO %s", fmtId(member)); if (*option == 't') ! printf(" WITH ADMIN OPTION"); ! printf(" GRANTED BY %s;\n", fmtId(grantor)); } PQclear(res); ! printf("\n\n"); } /* --- 720,735 ---- char *grantor = PQgetvalue(res, i, 2); char *option = PQgetvalue(res, i, 3); ! fprintf(OPF, "GRANT %s", fmtId(roleid)); ! fprintf(OPF, " TO %s", fmtId(member)); if (*option == 't') ! fprintf(OPF, " WITH ADMIN OPTION"); ! fprintf(OPF, " GRANTED BY %s;\n", fmtId(grantor)); } PQclear(res); ! fprintf(OPF, "\n\n"); } /* *************** *** 718,724 **** "SELECT groname, grolist FROM pg_group ORDER BY 1"); if (PQntuples(res) > 0) ! printf("--\n-- Role memberships\n--\n\n"); for (i = 0; i < PQntuples(res); i++) { --- 751,757 ---- "SELECT groname, grolist FROM pg_group ORDER BY 1"); if (PQntuples(res) > 0) ! fprintf(OPF, "--\n-- Role memberships\n--\n\n"); for (i = 0; i < PQntuples(res); i++) { *************** *** 755,762 **** if (strcmp(groname, usename) == 0) continue; ! printf("GRANT %s", fmtId(groname)); ! printf(" TO %s;\n", fmtId(usename)); } PQclear(res2); --- 788,795 ---- if (strcmp(groname, usename) == 0) continue; ! fprintf(OPF, "GRANT %s", fmtId(groname)); ! fprintf(OPF, " TO %s;\n", fmtId(usename)); } PQclear(res2); *************** *** 765,771 **** PQclear(res); destroyPQExpBuffer(buf); ! printf("\n\n"); } /* --- 798,804 ---- PQclear(res); destroyPQExpBuffer(buf); ! fprintf(OPF, "\n\n"); } /* *************** *** 799,805 **** "ORDER BY 1"); if (PQntuples(res) > 0) ! printf("--\n-- Tablespaces\n--\n\n"); for (i = 0; i < PQntuples(res); i++) { --- 832,838 ---- "ORDER BY 1"); if (PQntuples(res) > 0) ! fprintf(OPF, "--\n-- Tablespaces\n--\n\n"); for (i = 0; i < PQntuples(res); i++) { *************** *** 841,854 **** appendPQExpBuffer(buf, ";\n"); } ! printf("%s", buf->data); free(fspcname); destroyPQExpBuffer(buf); } PQclear(res); ! printf("\n\n"); } /* --- 874,887 ---- appendPQExpBuffer(buf, ";\n"); } ! fprintf(OPF, "%s", buf->data); free(fspcname); destroyPQExpBuffer(buf); } PQclear(res); ! fprintf(OPF, "\n\n"); } /* *************** *** 869,875 **** PGresult *res; inti; ! printf("--\n-- Database creation\n--\n\n"); if (server_version >= 80100) res = executeQuery(conn, --- 902,908 ---- PGresult *res; inti; ! fprintf(OPF, "--\n-- Database creation\n--\n\n"); if (server_version >= 80100) res = executeQuery(conn, *************** *** 998,1004 **** exit(1); } ! printf("%s", buf->data); if (server_version >= 70300) dumpDatabaseConfig(conn, dbname); --- 1031,1037 ---- exit(1); } ! fprintf(OPF, "%s", buf->data); if (server_version >= 70300) dumpDatabaseConfig(conn, dbname); *************** *** 1009,1015 **** PQclear(res); destroyPQExpBuffer(buf); ! printf("\n\n"); } --- 1042,1048 ---- PQclear(res); destroyPQExpBuffer(buf); ! fprintf(OPF, "\n\n"); } *************** *** 1121,1127 **** appendStringLiteralConn(buf, pos + 1, conn); appendPQExpBuffer(buf, ";\n"); ! printf("%s", buf->data); destroyPQExpBuffer(buf); free(mine); } --- 1154,1160 ---- appendStringLiteralConn(buf, pos + 1, conn); appendPQExpBuffer(buf, ";\n"); ! fprintf(OPF, "%s", buf->data); destroyPQExpBuffer(buf); free(mine); } *************** *** 1151,1163 **** if (verbose) fprintf(stderr, _("%s: dumping database \"%s\"...\n"), progname, dbname); ! printf("\\connect %s\n\n", fmtId(dbname)); ret = runPgDump(dbname); if (ret != 0) { fprintf(stderr, _("%s: pg_dump failed on database \"%s\", exiting\n"), progname, dbname); exit(1); } } PQclear(res); --- 1184,1212 ---- if (verbose) fprintf(stderr, _("%s: dumping database \"%s\"...\n"), progname, dbname); ! fprintf(OPF, "\\connect %s\n\n", fmtId(dbname)); ! ! if (filename) ! fclose(OPF); ! ret = runPgDump(dbname); if (ret != 0) { fprintf(stderr, _("%s: pg_dump failed on database \"%s\", exiting\n"), progname, dbname); exit(1); } + + if (filename) + { + OPF = fopen(filename, PG_BINARY_A); + if (!OPF) + { + fprintf(stderr, _("%s: could not re-open the output file \"%s\"\n"), + progname, filename); + exit(1); + } + } + } PQclear(res); *************** *** 1179,1191 **** --- 1228,1255 ---- * Win32 has to use double-quotes for args, rather than single quotes. * Strangely enough, this is the only place we pass a database name on the * command line, except "postgres" which doesn't need quoting. + * + * If we have a filename, use the undocumented plain-append pg_dump format. */ + if (filename) + { + #ifndef WIN32 + appendPQExpBuffer(cmd, "%s\"%s\" %s -Fa '", SYSTEMQUOTE, pg_dump_bin, + #else + appendPQExpBuffer(cmd, "%s\"%s\" %s -Fa \"", SYSTEMQUOTE, pg_dump_bin, + #endif + pgdumpopts->data); + } + else + { #ifndef WIN32 appendPQExpBuffer(cmd, "%s\"%s\" %s -Fp '", SYSTEMQUOTE, pg_dump_bin, #else appendPQExpBuffer(cmd, "%s\"%s\" %s -Fp \"", SYSTEMQUOTE, pg_dump_bin, #endif pgdumpopts->data); + } + /* Shell quoting is not quite like SQL quoting, so can't use fmtId */ for (p = dbname; *p; p++) *************** *** 1413,1417 **** "%Y-%m-%d %H:%M:%S", #endif localtime(&now)) != 0) ! printf("-- %s %s\n\n", msg, buf); } --- 1477,1481 ---- "%Y-%m-%d %H:%M:%S", #endif localtime(&now)) != 0) ! fprintf(OPF, "-- %s %s\n\n", msg, buf); } diff -cr pgsql.orig/src/include/c.h pgsql.append/src/include/c.h *** pgsql.orig/src/include/c.hMon Jan 15 12:54:26 2007 --- pgsql.append/src/include/c.hMon Jan 15 21:42:26 2007 *************** *** 736,745 **** --- 736,747 ---- */ #if defined(WIN32) || defined(__CYGWIN__) #define PG_BINARYO_BINARY + #define PG_BINARY_A "ab" #define PG_BINARY_R "rb" #define PG_BINARY_W "wb" #else #define PG_BINARY0 + #define PG_BINARY_A "a" #define PG_BINARY_R "r" #define PG_BINARY_W "w" #endif
---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate
|
| | 3 answer | Add comment |
|
| Re: pgsql: Fix for plpython functions; return Bruce Momjian 18:00:06 |
| | Tom Lane wrote:> momjian@postgresql.org (Bruce Momjian) writes:> > Fix for plpython functions; return true/false for boolean,>
This patch has broken a majority of the buildfarm. Yea, reverted with comment added.
-- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives?
http://archives.postgresql.org
|
| | Add comment |
|
| crash on 8.2 and cvshead - failed to add item to the left sibling Joe Conway 17:59:08 |
| | [ Sorry if this is a duplicate -- resending since it hasn't made it to the list after 1 1/2 hour, possibly due to large attachment (?); here's a URL instead: http://www.joeconway.com/das_data_load_failure2.sql.gz ]
We just came upon a crash bug in Postgres >= 8.2. The attached standalone script (just needs a database with plpgsql installed) reproduces the crash for me on 32-bit machines (i686) but NOT on 64 bit machines (x86_64), for Postgres 8.2 and cvs-head, but not on 8.1. We've verified this on about four 32 bit machines, and four 64 bit machines (including one each under vmware on the same host). All machines were some flavor of Red Hat, Fedora, or Gentoo.
Here is the error: 8<-------------------------------------------------------------- das=# \i /home/jconway/pgsql/das_data_load_failure2.sql
[...snip...]
das_tbl_das_status_log ------------------------
(1 row)
psql:/home/jconway/pgsql/das_data_load_failure2.sql:419: PANIC: failed to add item to the left sibling for "pk_status_log_2007_01_4_10" CONTEXT: COPY das_status_log_2007_01_4_10, line 27: "10 2007-Jan-25 03:06:59.372266 -0800 r_x_data 406,386,482,342,338,338,330,310,322,330,314,326,334,31..." psql:/home/jconway/pgsql/das_data_load_failure2.sql:420: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. psql:/home/jconway/pgsql/das_data_load_failure2.sql:420: connection to server was lost 8<--------------------------------------------------------------
Here is a backtrace: 8<-------------------------------------------------------------- #0 0x00d2f402 in __kernel_vsyscall () #1 0x42901d40 in raise () from /lib/libc.so.6 #2 0x42903591 in abort () from /lib/libc.so.6 #3 0x082ed82e in errfinish (dummy=0) at elog.c:449 #4 0x082ee729 in elog_finish (elevel=22, fmt=0x832c0c4 "failed to add item to the %s for \"%s\"") at elog.c:937 #5 0x080b0483 in _bt_pgaddtup (rel=0xb5b4302c, page=0x86c6bfc "", itemsize=48, itup=0xb5e49d14, itup_off=36, where=0x832b826 "left sibling") at nbtinsert.c:1654 #6 0x080ae849 in _bt_split (rel=0xb5b4302c, buf=252, firstright=40, newitemoff=40, newitemsz=1312, newitem=0x8680714, newitemonleft=0 '\0') at nbtinsert.c:843 #7 0x080ad965 in _bt_insertonpg (rel=0xb5b4302c, buf=252, stack=0x869c3b4, keysz=4, scankey=0x8681538, itup=0x8680714, afteritem=0, split_only_page=0 '\0') at nbtinsert.c:538 #8 0x080acd08 in _bt_doinsert (rel=0xb5b4302c, itup=0x8680714, index_is_unique=1 '\001', heapRel=0xb5b42c7c) at nbtinsert.c:141 #9 0x080b484a in btinsert (fcinfo=0xbfc80380) at nbtree.c:224 #10 0x082f393c in FunctionCall6 (flinfo=0x866ef9c, arg1=3048484908, arg2=3217557044, arg3=3217557012, arg4=141339656, arg5=3048483964, arg6=1) at fmgr.c:1267 #11 0x080ab427 in index_insert (indexRelation=0xb5b4302c, values=0xbfc80634, isnull=0xbfc80614 "", heap_t_ctid=0x86cac08, heapRelation=0xb5b42c7c, check_uniqueness=1 '\001') at indexam.c:196 #12 0x081a08e5 in ExecInsertIndexTuples (slot=0x86899e4, tupleid=0x86cac08, estate=0x862cc14, is_vacuum=0 '\0') at execUtils.c:1088 #13 0x0814fcd9 in CopyFrom (cstate=0x863a590) at copy.c:2082 #14 0x0814d90b in DoCopy (stmt=0x860bd14) at copy.c:1141 #15 0x082555a7 in ProcessUtility (parsetree=0x860bd14, params=0x0, dest=0x860bbe4, completionTag=0xbfc80d1e "") at utility.c:635 #16 0x08253bff in PortalRunUtility (portal=0x862ec1c, query=0x860bd70, dest=0x860bbe4, completionTag=0xbfc80d1e "") at pquery.c:1063 #17 0x08253d72 in PortalRunMulti (portal=0x862ec1c, dest=0x860bbe4, altdest=0x860bbe4, completionTag=0xbfc80d1e "") at pquery.c:1131 #18 0x08253482 in PortalRun (portal=0x862ec1c, count=2147483647, dest=0x860bbe4, altdest=0x860bbe4, completionTag=0xbfc80d1e "") at pquery.c:700 #19 0x0824deb2 in exec_simple_query (query_string=0x860b9cc "copy das_status_log_2007_01_4_10 from stdin;") at postgres.c:939 #20 0x08251b5e in PostgresMain (argc=4, argv=0x85b1c80, username=0x85b1c50 "postgres") at postgres.c:3424 8<--------------------------------------------------------------
Joe
---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend
|
| | 1 answer | Add comment |
|
| Postgresql 64bit question Tony Caduto 17:54:25 |
| | Hi, I was just wondering if a 32bit client connected to a 64bit server, would it be possible for the 64bit server to return a OID that was over 4 billion to the 32 bit client and possibly cause a range error if the OID value was used in a unsigned 32-bit integer var?
Thanks,
-- Tony
---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster
|
| | 1 answer | Add comment |
|
| Fix for bug in plpython bool type conversion Guido Goldstein 17:54:18 |
| | Hi!
The attached patch fixes a bug in plpython.
This bug was found while creating sql from trigger functions written in plpython and later running the generated sql. The problem was that boolean was was silently converted to integer, which is ok for python but fails when the created sql is used.
The patch uses the Py_RETURN_xxx macros shown at http://docs.python.org/api/boolObjects.html .
It would be nice if someone could test and comment on the patch.
Cheers Guido
--- postgresql-8.2.1.orig/src/pl/plpython/plpython.c2006-11-21 22:51:05.000000000 +0100 +++ postgresql-8.2.1/src/pl/plpython/plpython.c2007-01-17 18:06:58.185497734 +0100 @@ -1580,8 +1580,8 @@ PLyBool_FromString(const char *src) { if (src[0] == 't') -return PyInt_FromLong(1); -return PyInt_FromLong(0); +Py_RETURN_TRUE; +Py_RETURN_FALSE; } static PyObject *
---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings
|
| | 3 answer | Add comment |
|
| Record Availability Brian Stapel 17:51:58 |
| | Thanks for your time. Are records created by performing function with in a function, immediately available to the calling function? For example, function A calls function B via the perform command. Function B creates new records. After function B completes and processing returns to function A, are the records created by function b available for further processing with in function A? _________________________________________________________________ Get the Live.com Holiday Page for recipes, gift-giving ideas, and more. www.live.com/?addtemplate=holiday |
| | Add comment |
|
| column limit? Shaunn Johnson 17:34:21 |
| | Howdy:
Trying to looking for this in the docs, but, can someone clue me in for the direction for column limit? I'm trying to build a table with, say, 50+ columns (all but 2 of them are integer) and getting some error (the error itself is ambiguous as it refers to "'").
Is there a limit as to how many columns a table can have? If so, what is it (or, where is the docs that explains that stuff) ?
Thanks!
-X
|
| | 11 answers | Add comment |
|
| Questions about warnings Magnus Hagander 17:05:28 |
| | I'm looking over the VC build trying to eliminate what warnings are left. One thing that appears in a couple of places is stuff like:
.\src\bin\psql\print.c(2014): warning C4090: 'function' : different 'const' qualifiers
This happens in psql when we do free() on a variable that's "const char **". The same thing happens in oracle_compat.c in the backend with pfree().
Is this a warning we should care about and remove (or change?) the const qualifyer? Or should I just ignore it?
//Magnus
---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend
|
| | 8 answers | Add comment |
|
| Re: Autovacuum Improvements Matthew O'Connor 16:59:20 |
| | Bruce Momjian wrote:> Yes, I think there are these TODO items. I was waiting to see what> additional replies there are before adding them.
Speaking of which, I was just looking at the TODO at:
http://www.postgresql.org/docs/faqs.TODO.html
and I think this item:
* Improve xid wraparound detection by recording per-table rather than per-database
is done and working in 8.2 no?
---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives?
http://archives.postgresql.org/
|
| | 107 answers | Add comment |
|
| libeay32.dll & ssleay32.dll in system PATH Steven De Vriendt 13:53:24 |
| | Hi,
When I try to install PostgreSQL8.2 I get this error message:
Incompactibel version of openssl detected in system path. when you remove libeay32.dll & ssleay32.dll in your system path postgres will install a newer version...
I've looked in my PATH but I can't seem to find it, can anyone help me out ?
|
| | 2 answer | Add comment |
|
| STOP all user access except for admin for a few minutes? Guest 12:32:35 |
| | Hi there,
Is is possible to stop all user access to postgres, but still give access to admin? Just temporarily, not a security setup.
Something like, stop all users but allow user x and y.
thx
---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings
|
| | 7 answers | Add comment |
|
| Re: "tupdesc reference is not owned by resource owner Portal" Stefan Kaltenbrunner 12:14:51 |
| | Tom Lane wrote:> Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:>> The following testcase(extracted from a much much larger production code >> sample) results in>
WARNING: TupleDesc reference leak: TupleDesc 0xb3573b88 (2249,1) still >> referenced>> CONTEXT: PL/pgSQL function "foo" line 4 at block variables initialization>> ERROR: tupdesc reference 0xb3573b88 is not owned by resource owner Portal>> CONTEXT: PL/pgSQL function "foo" while casting return value to >> function's return type> Hmm. What's happening is that the record-function call creates a> reference-counted TupleDesc, and tracking of the TupleDesc is> assigned to the subtransaction resource owner because we're inside> an EXCEPTION-block subtransaction. But the pointer is held by the> function's eval_context which lives throughout the function call,> and so the free happens long after exiting the subtransaction, and> the resource owner code quite properly complains about this.> In this particular case the worst consequence would be a short-term> memory leak, but I think there are probably variants with worse> problems, because anything done by a RegisterExprContextCallback()> callback is equally at risk.> I think the proper fix is probably to establish a new eval_context> when we enter an EXCEPTION block, and destroy it again on the way out.> Slightly annoying, but probably small next to the other overhead of> a subtransaction. Comments? we use exception blocks heavily here so anything that makes them slower is not nice but if it fixes the issue at hand I'm all for it ...
BTW, both of the CONTEXT lines are misleading. The WARNING happens> during exit from the begin-block, not entry to it; and the ERROR> happens after we've finished fooling with the result value. I'm> tempted to add a few more assignments to err_text to make this nicer. yeah wondered about that too when I tried to produce a simple testcase - the errors did't seem to make much sense in the context of what triggered them. Improving that would be a very godd thing to do.
Stefan
---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
|
| | 2 answer | Add comment |
|
| Uninstall procedure for pgadmin3 under Mac OS X 10.3 Yannick DEVOS 11:04:16 |
| | Dear pgadmin support community members,
I need your help for some tricky problem that I was unable to solve.
I am using pgadmin under Mac OS X Panther (10.3.9). The newest pgadmin releases only support Tiger (10.4) since they are compiled with dynamic links against 10.4 libraries and frameworks. Some weeks ago, one of you kindely helped me (I think it was Dave, but sorry, I am not sure anymore) in making a special 1.6.0 build for me.
Few days ago I decided to try 1.6.2 but I forgot that it does not work with 10.3. I installed it, and it crashes.
No problem, I thought, I just have to delete the pgadmin "binary" (in fact a bundle under OS X "Applications" folder), and then install back 1.6.0 "Panther" build. No way, the installation fails when I want to choose my apps disk in "Choose target" screen. The error is a bit cryptic for me, the message is (in fact it is in french, my translation could be errored) "You cannot install this software on this volume. (null)". I tried to delete preferences files or "Application support" files I found in my "user"/Library, but it still failing...
What is the procedure to uninstall it ? I looked after help or docs on the internet, but it was unsuccessfull.
Thanks for your help, Yannick.
PS : You could told me that I'd better compile my own pgadmin build. I will, but just for now I am too busy to spend time in compiling wxwidgets and so on. --- Hanh DOAN et Yannick DEVOS - Nature-Mekong Savourer les d lices du delta http://www.nature-mekong.com/
---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
|
| | 1 answer | Add comment |
|
| pg_get_domaindef() FAST PostgreSQL 10:18:06 |
| | Hi All,
I am now trying to implement pg_get_domaindef() function which is in the TODO list and ran into a minor issue.
When the following command is given
CREATE DOMAIN testdomain AS text CONSTRAINT testconstraint NOT NULL;
I couldn't find the CONSTRAINT name ('testconstraint' in this case) being stored in the system catalog. Any idea where I can find it?
Or is it acceptable, for the above statement, for pg_get_domaindef() to return
CREATE DOMAIN testdomain AS text CONSTRAINT NOT NULL;
Rgds, Arul Shaji This is an email from Fujitsu Australia Software Technology Pty Ltd, ABN 27 003 693 481. It is confidential to the ordinary user of the email address to which it was addressed and may contain copyright and/or legally privileged information. No one else may read, print, store, copy or forward all or any of it or its attachments. If you receive this email in error, please return to sender. Thank you.
If you do not wish to receive commercial email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.fujitsu.com.au
---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings
|
| | 15 answers | Add comment |
|
| Re: pgsql: Fix for plpython functions; return true/false for boolean, Tom Lane 09:52:32 |
| | momjian@postgresql.org (Bruce Momjian) writes:> Fix for plpython functions; return true/false for boolean,
This patch has broken a majority of the buildfarm.
regards, tom lane
---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
|
| | Add comment |
|
| indexing primary and foreign keys w/lookup table Neal Clark 09:26:26 |
| | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi All.
I was wondering...I currently have indexes on the primary key id and foreign key id's for tables that resemble the following. Is this a good idea/when would it benefit me? I don't want waste a lot of unnecessary space on indexes.
CREATE TABLE stuff ( idBIGSERIAL PRIMARY KEY, stuffTEXT ); CREATE INDEX stuff_id ON stuff(id);
CREATE TABLE accounts ( idBIGSERIAL PRIMARY KEY, nameTEXT, emailTEXT, ); CREATE INDEX accounts_id ON accounts(id);
CREATE TABLE stuff_by_account ( account_idBIGINT REFERENCES accounts(id), stuff_idBIGINT REFERENCES stuff(id) ); CREATE INDEX stuff_by_account_account_id ON stuff_by_account (account_id); CREATE INDEX stuff_by_account_stuff_id ON stuff_by_account(stuff_id);
do I need any/all of these indexes for my lookup table to work well? I am thinking I can get rid of stuff_id and accounts_id. Thoughts?
- -Neal -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin)
iD8DBQFFuC6POUuHw4wCzDMRArt1AJoC9QUwmTxgcUKw+Agp+zYIDq/G/QCgolHT oDFkLBCLjZBST7ypzbOOfew= =CCSs -----END PGP SIGNATURE-----
---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster
|
| | 3 answer | Add comment |
|
| Re: Example of RETURNING clause to get auto-generated keys Ken Johanson 08:53:51 |
| | Adam Rich wrote:> Let's say you have a table with "id, value" columns.>
And your normal query would be this:> INSERT into mytable (id,value) values (1,"foo"),(2,"bar");> Your new query would be like this:> INSERT into mytable (id,value) values (1,"foo"),(2,"bar")> RETURNING id;> And you would get a result back with one column (id) and> two rows (the newly inserted keys). You can also return> other fields if you like, you're not limited to just the> generated keys.>
Thank you Alvaro and Adam,
Now playing devil's advocate, can anyone see scenarios where this will not work as expected? Examples (descriptions not sql necessarily) of those would be helpful too...
Ken
---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
|
| | 4 answer | Add comment |
|
| Re: Postgresql Backup Alan Hodgson 07:57:35 |
| | On Wednesday 24 January 2007 20:57, "bala" <kbalavignesh@gmail.com> wrote:> 'script.sh' contains>
PGUSER=postgres pg_dumpall > /path/to/backup_date.sql> Running the script using crond creates the 0 byte files.> But , If i run the script in console , it creates the file with> content.> Any suggestion pls? Include the full path to pg_dumpall in the script. Make sure the postgres user can connect without a password or has an appropriate .pgpass file in it's home directory.
-- No matter how disastrously some government policy has turned out, anyone who criticizes it can expect to hear: 'But what would you replace it with?' When you put out a fire, what do you replace it with?
---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
|
| | 1 answer | Add comment |
|
| [pgsql-patches] vc++ regression tests Magnus Hagander 07:35:33 |
| | Attached is an updated patch for the win32/visualc++ specific parts of my previous patch, not included in the parts applied by Alvaro.
For win32 in general, this makes it possible to run the regression tests as an admin user by using the same restricted token method that's used by pg_ctl and initdb.
For vc++, it adds building of pg_regress.exe, adds a resultmap, and fixes how it runs the install.
//Magnus
Index: test/regress/pg_regress.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/test/regress/pg_regress.c,v retrieving revision 1.27 diff -c -r1.27 pg_regress.c *** test/regress/pg_regress.c19 Jan 2007 21:21:13 -00001.27 --- test/regress/pg_regress.c23 Jan 2007 13:46:41 -0000 *************** *** 67,73 **** --- 67,75 ---- static char *libdir = LIBDIR; static char *datadir = PGSHAREDIR; static char *host_platform = HOST_TUPLE; + #ifndef WIN32_ONLY_COMPILER static char *makeprog = MAKEPROG; + #endif #ifndef WIN32/* not used in WIN32 case */ static char *shellprog = SHELLPROG; *************** *** 133,138 **** --- 135,144 ---- the supplied arguments. */ __attribute__((format(printf, 2, 3))); + #ifdef WIN32 + typedef BOOL(WINAPI * __CreateRestrictedToken) (HANDLE, DWORD, DWORD, PSID_AND_ATTRIBUTES, DWORD, PLUID_AND_ATTRIBUTES, DWORD, PSID_AND_ATTRIBUTES, PHANDLE); + #endif + /* * allow core files if possible. */ *************** *** 855,870 **** return pid; #else char *cmdline2; STARTUPINFO si; PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); cmdline2 = malloc(strlen(cmdline) + 8); sprintf(cmdline2, "cmd /c %s", cmdline); ! if (!CreateProcess(NULL, cmdline2, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { fprintf(stderr, _("could not start process for \"%s\": %lu\n"), cmdline2, GetLastError()); --- 861,934 ---- return pid; #else char *cmdline2; + BOOL b; STARTUPINFO si; PROCESS_INFORMATION pi; + HANDLE origToken; + HANDLE restrictedToken; + SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; + SID_AND_ATTRIBUTES dropSids[2]; + __CreateRestrictedToken _CreateRestrictedToken = NULL; + HANDLE Advapi32Handle; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); + + Advapi32Handle = LoadLibrary("ADVAPI32.DLL"); + if (Advapi32Handle != NULL) + { + _CreateRestrictedToken = (__CreateRestrictedToken) GetProcAddress(Advapi32Handle, "CreateRestrictedToken"); + } + + if (_CreateRestrictedToken == NULL) + { + if (Advapi32Handle != NULL) + FreeLibrary(Advapi32Handle); + fprintf(stderr, "ERROR: Unable to create restricted tokens on this platform\n"); + exit_nicely(2); + } + + /* Open the current token to use as base for the restricted one */ + if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &origToken)) + { + fprintf(stderr, "Failed to open process token: %lu\n", GetLastError()); + exit_nicely(2); + } + + /* Allocate list of SIDs to remove */ + ZeroMemory(&dropSids, sizeof(dropSids)); + if (!AllocateAndInitializeSid(&NtAuthority, 2, + SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &dropSids[0].Sid) || + !AllocateAndInitializeSid(&NtAuthority, 2, + SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_POWER_USERS, 0, 0, 0, 0, 0, 0, &dropSids[1].Sid)) + { + fprintf(stderr, "Failed to allocate SIDs: %lu\n", GetLastError()); + exit_nicely(2); + } + + b = _CreateRestrictedToken(origToken, + DISABLE_MAX_PRIVILEGE, + sizeof(dropSids)/sizeof(dropSids[0]), + dropSids, + 0, NULL, + 0, NULL, + &restrictedToken); + + FreeSid(dropSids[1].Sid); + FreeSid(dropSids[0].Sid); + CloseHandle(origToken); + FreeLibrary(Advapi32Handle); + + if (!b) + { + fprintf(stderr, "Failed to create restricted token: %lu\n", GetLastError()); + exit_nicely(2); + } cmdline2 = malloc(strlen(cmdline) + 8); sprintf(cmdline2, "cmd /c %s", cmdline); ! if (!CreateProcessAsUser(restrictedToken, NULL, cmdline2, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { fprintf(stderr, _("could not start process for \"%s\": %lu\n"), cmdline2, GetLastError()); *************** *** 1690,1698 **** --- 1754,1768 ---- make_directory(buf); /* "make install" */ + #ifndef WIN32_ONLY_COMPILER snprintf(buf, sizeof(buf), SYSTEMQUOTE "\"%s\" -C \"%s\" DESTDIR=\"%s/install\" install with_perl=no with_python=no > \"%s/log/install.log\" 2>&1" SYSTEMQUOTE, makeprog, top_builddir, temp_install, outputdir); + #else + snprintf(buf, sizeof(buf), + SYSTEMQUOTE "perl \"%s/src/tools/msvc/install.pl\" \"%s/install\" >\"%s/log/install.log\" 2>&1" SYSTEMQUOTE, + top_builddir, temp_install, outputdir); + #endif if (system(buf)) { fprintf(stderr, _("\n%s: installation failed\nExamine %s/log/install.log for the reason.\nCommand was: %s\n"), progname, outputdir, buf); Index: test/regress/resultmap =================================================================== RCS file: /projects/cvsroot/pgsql/src/test/regress/resultmap,v retrieving revision 1.83 diff -c -r1.83 resultmap *** test/regress/resultmap3 Aug 2006 17:04:00 -00001.83 --- test/regress/resultmap23 Jan 2007 13:52:11 -0000 *************** *** 1,8 **** --- 1,11 ---- float4/i.86-pc-mingw32=float4-exp-three-digits + float4/i.86-pc-win32vc=float4-exp-three-digits float8/i.86-.*-freebsd=float8-small-is-zero float8/i.86-.*-openbsd=float8-small-is-zero float8/i.86-.*-netbsd=float8-small-is-zero float8/m68k-.*-netbsd=float8-small-is-zero float8/i.86-pc-mingw32=float8-exp-three-digits-win32 + float8/i.86-pc-win32vc=float8-exp-three-digits-win32 float8/i.86-pc-cygwin=float8-small-is-zero int8/i.86-pc-mingw32=int8-exp-three-digits + int8/i.86-pc-win32vc=int8-exp-three-digits \ No newline at end of file Index: tools/msvc/Solution.pm =================================================================== RCS file: /projects/cvsroot/pgsql/src/tools/msvc/Solution.pm,v retrieving revision 1.6 diff -c -r1.6 Solution.pm *** tools/msvc/Solution.pm16 Jan 2007 21:43:19 -00001.6 --- tools/msvc/Solution.pm23 Jan 2007 13:32:19 -0000 *************** *** 88,94 **** print O "#define HAVE_LIBZ 1\n" if ($self->{options}->{zlib}); print O "#define USE_SSL 1\n" if ($self->{options}->{openssl}); print O "#define ENABLE_NLS 1\n" if ($self->{options}->{nls}); ! print O "#define LOCALEDIR \"/usr/local/pgsql/share/locale\"\n" if ($self->{options}->{nls}); if ($self->{options}->{xml}) { print O "#define HAVE_LIBXML2\n"; print O "#define USE_LIBXML\n"; --- 88,94 ---- print O "#define HAVE_LIBZ 1\n" if ($self->{options}->{zlib}); print O "#define USE_SSL 1\n" if ($self->{options}->{openssl}); print O "#define ENABLE_NLS 1\n" if ($self->{options}->{nls}); ! print O "#define LOCALEDIR \"/share/locale\"\n" if ($self->{options}->{nls}); if ($self->{options}->{xml}) { print O "#define HAVE_LIBXML2\n"; print O "#define USE_LIBXML\n"; *************** *** 202,218 **** print "Generating pg_config_paths.h...\n"; open(O,'>', 'src\port\pg_config_paths.h') || confess "Could not open pg_config_paths.h"; print O <<EOF; ! #define PGBINDIR "/usr/local/pgsql/bin" ! #define PGSHAREDIR "/usr/local/pgsql/share" ! #define SYSCONFDIR "/usr/local/pgsql/etc" ! #define INCLUDEDIR "/usr/local/pgsql/include" ! #define PKGINCLUDEDIR "/usr/local/pgsql/include" ! #define INCLUDEDIRSERVER "/usr/local/pgsql/include/server" ! #define LIBDIR "/usr/local/pgsql/lib" ! #define PKGLIBDIR "/usr/local/pgsql/lib" ! #define LOCALEDIR "/usr/local/pgsql/share/locale" ! #define DOCDIR "/usr/local/pgsql/doc" ! #define MANDIR "/usr/local/pgsql/man" EOF close(O); } --- 202,218 ---- print "Generating pg_config_paths.h...\n"; open(O,'>', 'src\port\pg_config_paths.h') || confess "Could not open pg_config_paths.h"; print O <<EOF; ! #define PGBINDIR "/bin" ! #define PGSHAREDIR "/share" ! #define SYSCONFDIR "/etc" ! #define INCLUDEDIR "/include" ! #define PKGINCLUDEDIR "/include" ! #define INCLUDEDIRSERVER "/include/server" ! #define LIBDIR "/lib" ! #define PKGLIBDIR "/lib" ! #define LOCALEDIR "/share/locale" ! #define DOCDIR "/doc" ! #define MANDIR "/man" EOF close(O); } Index: tools/msvc/install.pl =================================================================== RCS file: /projects/cvsroot/pgsql/src/tools/msvc/install.pl,v retrieving revision 1.1 diff -c -r1.1 install.pl *** tools/msvc/install.pl29 Nov 2006 19:49:31 -00001.1 --- tools/msvc/install.pl23 Jan 2007 13:33:01 -0000 *************** *** 70,78 **** open($D, "dir /b /s $spec |") || croak "Could not list $spec\n"; while (<$D>) { chomp; my $tgt = $target . basename($_); print "."; ! copy($_, $tgt) || croak "Could not copy $_\n"; } close($D); print "\n"; --- 70,79 ---- open($D, "dir /b /s $spec |") || croak "Could not list $spec\n"; while (<$D>) { chomp; + next if /regress/; # Skip temporary install in regression subdir my $tgt = $target . basename($_); print "."; ! copy($_, $tgt) || croak "Could not copy $_: $!\n"; } close($D); print "\n"; Index: tools/msvc/mkvcbuild.pl =================================================================== RCS file: /projects/cvsroot/pgsql/src/tools/msvc/mkvcbuild.pl,v retrieving revision 1.10 diff -c -r1.10 mkvcbuild.pl *** tools/msvc/mkvcbuild.pl16 Jan 2007 21:43:19 -00001.10 --- tools/msvc/mkvcbuild.pl23 Jan 2007 13:34:13 -0000 *************** *** 259,269 **** }
! # Regression DLLs my $regress = $solution->AddProject('regress','dll','misc'); $regress->AddFile('src\test\regress\regress.c'); $regress->AddReference($postgres);
$solution->Save();
##################### --- 259,276 ---- }
! # Regression DLL and EXE my $regress = $solution->AddProject('regress','dll','misc'); $regress->AddFile('src\test\regress\regress.c'); $regress->AddReference($postgres);
+ my $pgregress = $solution->AddProject('pg_regress','exe','misc'); + $pgregress->AddFile('src\test\regress\pg_regress.c'); + $pgregress->AddIncludeDir('src\port'); + $pgregress->AddDefine('HOST_TUPLE="i686-pc-win32vc"'); + $pgregress->AddDefine('FRONTEND'); + $pgregress->AddReference($libpgport); + $solution->Save();
#####################
---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster
|
| | 1 answer | Add comment |
|
| Re: [pgsql-patches] Tablespace for temporary Bruce Momjian 07:35:07 |
| | Patch withdrawn by author; corrected version expected.
---------------------------------------------------------------------------
Jaime Casanova wrote:> On 1/13/07, Albert Cervera Areny <albertca@hotpop.com> wrote:> > It was already possible to set the guc on postgresql.conf when I posted the> > patch...> >
ok... fixed... the problem was that this code only let> num_temp_tablespaces be greater than zero when we are in an> interactive command (eg. a SET command) but setting the guc from> postgresql.conf at startup time is not interactive so> num_temp_tablespaces is zero and when i try to get the first temp> tablespace to use (MyProcPid % num_temp_tablespaces) causes a floatin> exception (division by zero).> + if (source >= PGC_S_INTERACTIVE && IsTransactionState())> + {> + /*> + * Verify that all the names are valid tablspace names> + * We do not check for USAGE rights should we?> + */> + foreach(l, namelist)> + {> + char *curname = (char *) lfirst(l);> +> + if (get_tablespace_oid(curname) == InvalidOid)> + ereport((source == PGC_S_TEST) ? NOTICE : ERROR,> + (errcode(ERRCODE_UNDEFINED_OBJECT),> + errmsg("tablespace \"%s\" does not exist", curname)));> +> + num_temp_tablespaces++;> + }> + }> new patch added, with that piece of code refactored to let> num_temp_tablespaces get a value greater than zero always that the guc> is setted, i also add some docs.> the patch passes all 104 regression tests and all my tests as well...> i think the patch is ready to be applied to HEAD, any committer want> to review it?> -- > regards,> Jaime Casanova> "Programming today is a race between software engineers striving to> build bigger and better idiot-proof programs and the universe trying> to produce bigger and better idiots.> So far, the universe is winning."> Richard Cook [ Attachment, skipping... ]
---------------------------(end of broadcast)---------------------------> TIP 5: don't forget to increase your free space map settings -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
|
| | 1 answer | Add comment |
|