threads listlengths 1 2.99k |
|---|
[
{
"msg_contents": "hi,\n\n i am developing an application using php and postgresql. i do not know how to capture the return values of functions (stored procedures) from php.\n\n please reply to prasanna_be_eee@yahoo.com\n\n thanking you profusely,\n\n prasanna.v\n\n\n\n---------------------------------\nDo You Yahoo!?\nYahoo! Mail Personal Address - Get email at your own domain with Yahoo! Mail.\nhi,\n i am developing an application using php and postgresql. i do not know how to capture the return values of functions (stored procedures) from php.\n please reply to prasanna_be_eee@yahoo.com\n thanking you profusely,\n prasanna.vDo You Yahoo!?\nYahoo! Mail Personal Address - \nGet email at your own domain with Yahoo! Mail.",
"msg_date": "Tue, 5 Jun 2001 23:37:59 -0700 (PDT)",
"msg_from": "prasanna venkatesan <prasanna_be_eee@yahoo.com>",
"msg_from_op": true,
"msg_subject": "capturing stored procedure return values from php??please help ."
},
{
"msg_contents": "> \n> hi,\n> \n> i am developing an application using php and postgresql. i do not\n> know how to capture the return values of functions (stored\n> procedures) from php.\n>\n\nselect myfunction(parameter) ;\n\n\n",
"msg_date": "Wed, 6 Jun 2001 14:24:41 +0200 (CEST)",
"msg_from": "\"Reinoud van Leeuwen\" <reinoud@xs4all.nl>",
"msg_from_op": false,
"msg_subject": "Re: capturing stored procedure return values from php??please help ."
}
] |
[
{
"msg_contents": "\n> We have deliberately avoided trying to abort as soon as the connection\n> drops, for fear that that might cause unexpected problems.\n\nIsn't there the additional worry, that if the backend does not abort,\nthat the client might not even notice the error (receives the next packet\nwhich happens to be aligned at row boundaries) ? \nThus my understanding would be, that we eighter need to retry the send, \nor abort immediately.\n\nIf you do the query cancel, and the connection problem was only intermittent\nthen the client might receive the query cancelled response for which he is not\nprepared, no ?\n\nImho if the backend cannot allways safely abort, that would be a bug, no ?\n\nAndreas\n",
"msg_date": "Wed, 6 Jun 2001 11:16:41 +0200 ",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: Idea: quicker abort after loss of client connection"
}
] |
[
{
"msg_contents": "I don't understand following behavior of psql:-)\nThis is PostgreSQL 7.1.2 on Linux.\n--\nTatsuo Ishii\n\n$ psql pgimage\nWelcome to psql, the PostgreSQL interactive terminal.\n\nType: \\copyright for distribution terms\n \\h for help with SQL commands\n \\? for help on internal slash commands\n \\g or terminate with semicolon to execute query\n \\q to quit\n\npgimage=# \\lo\n List of databases\n Database | Owner | Encoding \n-----------+---------+----------\n ascii | t-ishii | EUC_JP\n foo | t-ishii | EUC_JP\n foo1 | t-ishii | EUC_JP\n latin1 | t-ishii | LATIN2\n pgimage | t-ishii | EUC_JP\n template0 | t-ishii | EUC_JP\n template1 | t-ishii | EUC_JP\n test | t-ishii | EUC_JP\n testdb2 | t-ishii | EUC_JP\n(9 rows)\n\n\\l: extra argument 'o' ignored\npgimage-# \\lo_list\n Large objects\n ID | Description \n---------+-------------\n 2401715 | \n 2401723 | \n 2401726 | \n 2401739 | \n 2401742 | \n 2401754 | \n 2401757 | \n(7 rows)\n\npgimage-# select * from pg_database;\nERROR: parser: parse error at or near \"m\"\npgimage=# \n",
"msg_date": "Wed, 06 Jun 2001 23:13:26 +0900",
"msg_from": "Tatsuo Ishii <t-ishii@sra.co.jp>",
"msg_from_op": true,
"msg_subject": "psql bug or feature?"
},
{
"msg_contents": "Tatsuo Ishii writes:\n\n> I don't understand following behavior of psql:-)\n> This is PostgreSQL 7.1.2 on Linux.\n\nI think you're still running the 7.1.1 version of psql, because this is\none bug fixed in 7.1.2. Try 'psql --version'.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Wed, 6 Jun 2001 16:45:46 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: psql bug or feature?"
},
{
"msg_contents": "Tatsuo Ishii <t-ishii@sra.co.jp> writes:\n> I don't understand following behavior of psql:-)\n\nI can't replicate that misbehavior. I'm not using MULTIBYTE though,\nmaybe it depends on that ...\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 06 Jun 2001 11:08:38 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: psql bug or feature? "
},
{
"msg_contents": "> Tatsuo Ishii writes:\n> \n> > I don't understand following behavior of psql:-)\n> > This is PostgreSQL 7.1.2 on Linux.\n> \n> I think you're still running the 7.1.1 version of psql, because this is\n> one bug fixed in 7.1.2. Try 'psql --version'.\n\nYou are right. I seem to mixed up 7.1.1 psql with 7.1.2 backend. Sorry\nfor the confusion.\n--\nTatsuo Ishii\n",
"msg_date": "Thu, 07 Jun 2001 10:03:15 +0900",
"msg_from": "Tatsuo Ishii <t-ishii@sra.co.jp>",
"msg_from_op": true,
"msg_subject": "Re: psql bug or feature?"
}
] |
[
{
"msg_contents": "\nMorning all ...\n\n\tBuild a file with 100k INSERT statements in it, and run psql -f on\nthat file ... no BEGIN/END in the file, just straight INSERTs ... what is\nthe max throughput ppl can see?\n\n\tI'm seeing reports of it maxing out on an AIX around 450, and on\nan HP around 380 ... anyone seeing higher? and what sort of\nconfiguration?\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org\nprimary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org\n\n",
"msg_date": "Wed, 6 Jun 2001 11:44:29 -0300 (ADT)",
"msg_from": "The Hermit Hacker <scrappy@hub.org>",
"msg_from_op": true,
"msg_subject": "Max inserts / sec ... on any platform?"
},
{
"msg_contents": "> Build a file with 100k INSERT statements in it, and run psql -f on that\n> file ... no BEGIN/END in the file, just straight INSERTs ... what is the\n> max throughput ppl can see?\n\n Hmmmm.... Depends. Inserting up to 5,000 of Apache log records takes no\nlonger than a couple of wallclock minutes on Pentium-133 with 48 MB RAM and\nno-cache Fujitsu IDE HDD (no DMA). (OK, OK, it's a home server, under my\ndesk :) No psql -f, though, using a home brewn dumb script runner. And yes,\nno fsync and 10 inserts per transaction. Relation is currently 350,000+\nlong.\n Not sure whether it makes interest. Care to send your file for me to try\nit out? [bg]zip is OK.\n\n\n--\n\n ������������������������������������\n\n",
"msg_date": "Wed, 06 Jun 2001 15:45:58 +0000",
"msg_from": "KuroiNeko <evpopkov@carrier.kiev.ua>",
"msg_from_op": false,
"msg_subject": "Re: Max inserts / sec ... on any platform?"
},
{
"msg_contents": "\n\nOkay, based on 5k records and a \"couple of wallclock minutes\" being equal\nto ~120sec, you are getting 41 inserts/sec?\n\nOn Wed, 6 Jun 2001, KuroiNeko wrote:\n\n> > Build a file with 100k INSERT statements in it, and run psql -f on that\n> > file ... no BEGIN/END in the file, just straight INSERTs ... what is the\n> > max throughput ppl can see?\n>\n> Hmmmm.... Depends. Inserting up to 5,000 of Apache log records takes no\n> longer than a couple of wallclock minutes on Pentium-133 with 48 MB RAM and\n> no-cache Fujitsu IDE HDD (no DMA). (OK, OK, it's a home server, under my\n> desk :) No psql -f, though, using a home brewn dumb script runner. And yes,\n> no fsync and 10 inserts per transaction. Relation is currently 350,000+\n> long.\n> Not sure whether it makes interest. Care to send your file for me to try\n> it out? [bg]zip is OK.\n>\n>\n> --\n>\n> LD$/G-$OAM$rJa$i$L\n>\n>\n> ---------------------------(end of broadcast)---------------------------\n> TIP 3: if posting/reading through Usenet, please send an appropriate\n> subscribe-nomail command to majordomo@postgresql.org so that your\n> message can get through to the mailing list cleanly\n>\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org\nprimary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org\n\n",
"msg_date": "Wed, 6 Jun 2001 15:45:40 -0300 (ADT)",
"msg_from": "The Hermit Hacker <scrappy@hub.org>",
"msg_from_op": true,
"msg_subject": "Re: Max inserts / sec ... on any platform?"
}
] |
[
{
"msg_contents": "I've installed a fresh postgresql-7.1.2 on a Debian GNU/Linux, when\nimporting my first database from a dump I got this error:\n\nERROR: ExecAppend: Fail to add null value in not null attribute\nfc_state\nFATAL 2: ZeroFill(/data/postgres/pg_xlog/xlogtemp.1223) failed: No such\nfile or directory\nServer process (pid 1223) exited with status 512 at Wed Jun 6 14:59:58\n2001\nTerminating any active server processes...\nServer processes were terminated at Wed Jun 6 14:59:58 2001\nReinitializing shared memory and semaphores\nDEBUG: database system was interrupted at 2001-06-06 14:58:56 BST\nDEBUG: CheckPoint record at (0, 1522068)\nDEBUG: Redo record at (0, 1522068); Undo record at (0, 0); Shutdown\nTRUE\nDEBUG: NextTransactionId: 615; NextOid: 18720\nDEBUG: database system was not properly shut down; automatic recovery\nin progress...\nDEBUG: redo starts at (0, 1522132)\nDEBUG: open(logfile 0 seg 3) failed: No such file or directory\nDEBUG: redo done at (0, 50331512)\nFATAL 2: ZeroFill(/data/postgres/pg_xlog/xlogtemp.1224) failed: No such\nfile or directory\n/usr/local/pgsql/bin/postmaster: Startup proc 1224 exited with status\n512 - abort\n\nand now the database cannot be started again. I have no idea where to\nstart looking...\n\n-- \nAlessio F. Bragadini\t\talessio@albourne.com\nAPL Financial Services\t\thttp://village.albourne.com\nNicosia, Cyprus\t\t \tphone: +357-2-755750\n\n\"It is more complicated than you think\"\n\t\t-- The Eighth Networking Truth from RFC 1925\n",
"msg_date": "Wed, 06 Jun 2001 17:53:43 +0300",
"msg_from": "Alessio Bragadini <alessio@albourne.com>",
"msg_from_op": true,
"msg_subject": "Strange error, probably WAL-related"
},
{
"msg_contents": "Alessio Bragadini <alessio@albourne.com> writes:\n> FATAL 2: ZeroFill(/data/postgres/pg_xlog/xlogtemp.1223) failed: No such\n> file or directory\n\nI think you ran out of disk space. The error message is misleading :-(\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 06 Jun 2001 11:21:41 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Strange error, probably WAL-related "
},
{
"msg_contents": "Tom Lane wrote:\n\n> I think you ran out of disk space. The error message is misleading :-(\n\nThat was true! Well, thanks...\n\n-- \nAlessio F. Bragadini\t\talessio@albourne.com\nAPL Financial Services\t\thttp://village.albourne.com\nNicosia, Cyprus\t\t \tphone: +357-2-755750\n\n\"It is more complicated than you think\"\n\t\t-- The Eighth Networking Truth from RFC 1925\n",
"msg_date": "Wed, 06 Jun 2001 19:08:15 +0300",
"msg_from": "Alessio Bragadini <alessio@albourne.com>",
"msg_from_op": true,
"msg_subject": "Re: Strange error, probably WAL-related"
}
] |
[
{
"msg_contents": "Hi all,\n I am having problems deleting a record with oid. I tried\nselect lo_unlink(68778) from tablename\nwhere 68778 is the oid\nbut it gives :\nlo_unlink\n-----------\n -1\n -1\n(2 rows)\n\nand when I try to delete that record by:\ndelete from tablename where id=1;\nit goes on hang.\nI want to drop this table and create a new one with the same name. But I am \nstuck.\nAny help would be greatly appreciated.\nThanks,\nRai\n_________________________________________________________________________\nGet Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.\n\n",
"msg_date": "Wed, 06 Jun 2001 15:14:14 ",
"msg_from": "\"rai lalit\" <rai_l@hotmail.com>",
"msg_from_op": true,
"msg_subject": "Delete oid giving problems"
}
] |
[
{
"msg_contents": "I'm haveing a very hard time with these views, rules, and I don't know if \nit's a programing problem, or it's that I don't understand the docs. I have \nthis:\n\nwebunl=> \\d\n List of relations\n Name | Type | Owner\n-----------------------------+----------+--------\n admin_view | view | martin\n admin_view_categ | view | martin\n admin_view_docente | view | martin\n admin_view_facultades | view | martin\n admin_view_materias | view | martin\n admin_view_modal | view | martin\n area | table | martin\n area_id_area_seq | sequence | martin\n carrera | table | martin\n carrera_id_curso_seq | sequence | martin\n categ | table | martin\n categ_id_categ_seq | sequence | martin\n docentes | table | martin\n docentes_id_docente_seq | sequence | martin\n facultad | table | martin\n facultad_id_fac_seq | sequence | martin\n inscripcion | table | martin\n log_carrera | table | martin\n log_carrera_id_log_seq | sequence | martin\n materias | table | martin\n materias_id_mat_seq | sequence | martin\n modalidad | table | martin\n nexo_categ | table | martin\n nexo_facultad | table | martin\n niveles | table | martin\n niveles_id_nivel_seq | sequence | martin\n resol | table | martin\n sub_area | table | martin\n sub_area_id_subarea_seq | sequence | martin\n tipo_cursado | table | martin\n tipo_cursado_id_cursado_seq | sequence | martin\n tipo_modal | table | martin\n tipo_modal_id_mod_seq | sequence | martin\n(33 rows)\n \nwebunl=> INSERT INTO admin_view\nwebunl-> \n(titulo,subarea,descripcion,matricula,nivel,requisitos,duracion,cupos,numero,year,fecha,fecha_ini,fecha_fin,lugar,informes \n,director,carrera)\nwebunl-> VALUES ('y este el tiutulo',14,'descripcion',0,1,'Y bueno, los \nrequisitos \nson.....',12,0,34534,2000,'6/6/2000','10/10/2001','30/12/2001','Donde\nwebunl'> mas.......','Para mas info, limpie','Quien, yo?','Esta es una \ncarrera');\nINSERT 240131 1\nwebunl=> \\c webunl - mariana\nYou are now connected to database webunl.\n\\c: extra argument 'mariana' ignored\nwebunl=> \\c webunl mariana\nYou are now connected to database webunl as user mariana.\nwebunl=> INSERT INTO admin_view\nwebunl-> \n(titulo,subarea,descripcion,matricula,nivel,requisitos,duracion,cupos,numero,year,fecha,fecha_ini,fecha_fin,lugar,informes \n,director,carrera)\nwebunl-> VALUES ('y este el tiutulo',14,'descripcion',0,1,'Y bueno, los \nrequisitos \nson.....',12,0,34534,2000,'6/6/2000','10/10/2001','30/12/2001','Donde\nwebunl'> mas.......','Para mas info, limpie','Quien, yo?','Esta es una \ncarrera');\nERROR: carrera_id_curso_seq.nextval: you don't have permissions to set \nsequence carrera_id_curso_seq\nwebunl=> select version();\n version\n------------------------------------------------------------------\n PostgreSQL 7.1.2 on sparc-sun-solaris2.8, compiled by GCC 2.95.2\n(1 row)\n\n\nThe rules are OK as for what I see, but the other user insert even though the \nuser mariana has ALL permissions on the views (all the views) through her \ngroup (webunl_admin)\n\n\nwebunl=> select * from pg_group;\n groname | grosysid | grolist\n--------------+----------+------------------\n webunl_admin | 500 | {1015,1005,1014}\n(1 row)\n\nwebunl=> select * from pg_user;\n usename | usesysid | usecreatedb | usetrace | usesuper | usecatupd | \npasswd | valuntil\n----------+----------+-------------+----------+----------+-----------+----------+----------\n postgres | 1013 | t | t | t | t | \n******** |\n webmail | 33 | t | f | t | t | \n******** |\n todo | 1004 | f | f | f | f | \n******** |\n aroman | 1014 | t | f | f | f | \n******** |\n mariana | 1015 | f | f | f | f | \n******** |\n martin | 1005 | f | f | f | f | \n******** |\n(6 rows)\n \nWhat's wrong with this? As you can see, mariana belongs to the webunl_admin \ngroup, and I (martin) have granted ALL permissions to that group.\nAny ideas?\n\nSaludos... :-)\n\n-- \nCualquiera administra un NT.\nEse es el problema, que cualquiera administre.\n-----------------------------------------------------------------\nMartin Marques | mmarques@unl.edu.ar\nProgramador, Administrador | Centro de Telematica\n Universidad Nacional\n del Litoral\n-----------------------------------------------------------------\n",
"msg_date": "Wed, 6 Jun 2001 18:39:42 +0300",
"msg_from": "=?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= <martin@bugs.unl.edu.ar>",
"msg_from_op": true,
"msg_subject": "something smells bad"
},
{
"msg_contents": "On Jue 07 Jun 2001 00:58, you wrote:\n> 1) Please don't crosspost to both hackers and general\n>\n> On Wed, 6 Jun 2001, [iso-8859-1] Mart�n Marqu�s wrote:\n> > ERROR: carrera_id_curso_seq.nextval: you don't have permissions to set\n> > sequence carrera_id_curso_seq\n>\n> Because of the way postgres works, you need to grant write permission on\n> the carrera_id_curso_seq for your inserts to succeed.\n\nThis doesn't sound logical. The user from the group granted can insert data, \nbut not in a SERIAL field?\nThis is not what the \"RULES and permissions\" documentation says.\n\nMore info:\n\nwebunl=> \\dp\n Access permissions for database \"webunl\"\n Relation | Access permissions\n-----------------------------+------------------------------------------------\n admin_view | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n admin_view_categ | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n admin_view_docente | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n admin_view_facultades | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n admin_view_materias | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n admin_view_modal | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n area | {\"=r\",\"martin=arwR\"}\n area_id_area_seq |\n carrera | {\"=r\",\"martin=arwR\"}\n carrera_id_curso_seq |\n categ | {\"=r\",\"martin=arwR\"}\n categ_id_categ_seq |\n docentes | {\"=r\",\"martin=arwR\"}\n docentes_id_docente_seq |\n facultad | {\"=r\",\"martin=arwR\"}\n facultad_id_fac_seq |\n inscripcion | {\"=r\",\"martin=arwR\"}\n log_carrera | {\"=\",\"martin=arwR\"}\n log_carrera_id_log_seq |\n materias | {\"=r\",\"martin=arwR\"}\n materias_id_mat_seq |\n modalidad | {\"=r\",\"martin=arwR\"}\n nexo_categ | {\"=r\",\"martin=arwR\"}\n nexo_facultad | {\"=r\",\"martin=arwR\"}\n niveles | {\"=r\",\"martin=arwR\"}\n niveles_id_nivel_seq |\n resol | {\"=r\",\"martin=arwR\"}\n sub_area | {\"=r\",\"martin=arwR\"}\n sub_area_id_subarea_seq |\n tipo_cursado | {\"=r\",\"martin=arwR\"}\n tipo_cursado_id_cursado_seq |\n tipo_modal | {\"=r\",\"martin=arwR\"}\n tipo_modal_id_mod_seq |\n\n\nAs you can see, the permissions look OK.\n\nSaludos... :-)\n\n-- \nCualquiera administra un NT.\nEse es el problema, que cualquiera administre.\n-----------------------------------------------------------------\nMartin Marques | mmarques@unl.edu.ar\nProgramador, Administrador | Centro de Telematica\n Universidad Nacional\n del Litoral\n-----------------------------------------------------------------\n",
"msg_date": "Wed, 6 Jun 2001 18:57:13 +0300",
"msg_from": "=?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= <martin@bugs.unl.edu.ar>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] something smells bad"
},
{
"msg_contents": "On Jue 07 Jun 2001 01:14, Alex Pilosov wrote:\n> On Wed, 6 Jun 2001, [iso-8859-1] Mart�n Marqu�s wrote:\n> > On Jue 07 Jun 2001 00:58, you wrote:\n> > > 1) Please don't crosspost to both hackers and general\n>\n> (plonk myself)\n\nSorry, I sent it to both because it's what I usually see on things that seem \nto not work on Postgres. \n\n> > > On Wed, 6 Jun 2001, [iso-8859-1] Mart�n Marqu�s wrote:\n> > > > ERROR: carrera_id_curso_seq.nextval: you don't have permissions to\n> > > > set sequence carrera_id_curso_seq\n> > >\n> > > Because of the way postgres works, you need to grant write permission\n> > > on the carrera_id_curso_seq for your inserts to succeed.\n> >\n> > This doesn't sound logical. The user from the group granted can insert\n> > data, but not in a SERIAL field?\n> > This is not what the \"RULES and permissions\" documentation says.\n>\n> I guess the documentation has to be changed then.\n>\n> Postgres sequences are really non-transparent, and you have to be aware of\n> that. Such as, when you drop the table, sequence won't get dropped,\n> permissions are separate on table and sequence, and various other things.\n\nI am aware of this.\n\n> > area_id_area_seq |\n> > carrera_id_curso_seq |\n> > categ_id_categ_seq |\n> > docentes_id_docente_seq |\n> > facultad_id_fac_seq |\n> > log_carrera_id_log_seq |\n> > materias_id_mat_seq |\n> > niveles_id_nivel_seq |\n> >\n> > As you can see, the permissions look OK.\n>\n> You must have permissions on _seq as well as on the underlying table...\n\nOK, now I'm more then astonished!\nWhy was I able to insert as martin then?\nIsn't it true (as the docs say) that when I execute a query over a view with \nrules, the rules (querys in the DO of the RULE) are executed with permssions \nof the owner of the rule (or the view? Any way, martin is owner of both) and \nnot of the user that executed the query?\n\nI am totally puzzeled! %-P\n\nSaludos... :-)\n\n-- \nCualquiera administra un NT.\nEse es el problema, que cualquiera administre.\n-----------------------------------------------------------------\nMartin Marques | mmarques@unl.edu.ar\nProgramador, Administrador | Centro de Telematica\n Universidad Nacional\n del Litoral\n-----------------------------------------------------------------\n",
"msg_date": "Wed, 6 Jun 2001 19:12:46 +0300",
"msg_from": "=?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= <martin@bugs.unl.edu.ar>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] something smells bad"
},
{
"msg_contents": "1) Please don't crosspost to both hackers and general\n\n\nOn Wed, 6 Jun 2001, [iso-8859-1] Mart�n Marqu�s wrote:\n\n> ERROR: carrera_id_curso_seq.nextval: you don't have permissions to set \n> sequence carrera_id_curso_seq\nBecause of the way postgres works, you need to grant write permission on\nthe carrera_id_curso_seq for your inserts to succeed.\n\n> The rules are OK as for what I see, but the other user insert even though the \n> user mariana has ALL permissions on the views (all the views) through her \n> group (webunl_admin)\n> \n> \n> webunl=> select * from pg_group;\n> groname | grosysid | grolist\n> --------------+----------+------------------\n> webunl_admin | 500 | {1015,1005,1014}\n> (1 row)\n\n",
"msg_date": "Wed, 6 Jun 2001 17:58:52 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] something smells bad"
},
{
"msg_contents": "On Wed, 6 Jun 2001, [iso-8859-1] Mart�n Marqu�s wrote:\n\n> On Jue 07 Jun 2001 00:58, you wrote:\n> > 1) Please don't crosspost to both hackers and general\n> >\n(plonk myself)\n\n> > On Wed, 6 Jun 2001, [iso-8859-1] Mart�n Marqu�s wrote:\n> > > ERROR: carrera_id_curso_seq.nextval: you don't have permissions to set\n> > > sequence carrera_id_curso_seq\n> >\n> > Because of the way postgres works, you need to grant write permission on\n> > the carrera_id_curso_seq for your inserts to succeed.\n> \n> This doesn't sound logical. The user from the group granted can insert data, \n> but not in a SERIAL field?\n> This is not what the \"RULES and permissions\" documentation says.\nI guess the documentation has to be changed then.\n\nPostgres sequences are really non-transparent, and you have to be aware of\nthat. Such as, when you drop the table, sequence won't get dropped,\npermissions are separate on table and sequence, and various other things. \n\n> area_id_area_seq |\n> carrera_id_curso_seq |\n> categ_id_categ_seq |\n> docentes_id_docente_seq |\n> facultad_id_fac_seq |\n> log_carrera_id_log_seq |\n> materias_id_mat_seq |\n> niveles_id_nivel_seq |\n> \n> As you can see, the permissions look OK.\nYou must have permissions on _seq as well as on the underlying table...\n\n",
"msg_date": "Wed, 6 Jun 2001 18:14:54 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] something smells bad"
},
{
"msg_contents": "On Wed, 6 Jun 2001, [iso-8859-1] Mart�n Marqu�s wrote:\n\n> OK, now I'm more then astonished!\n> Why was I able to insert as martin then?\n> Isn't it true (as the docs say) that when I execute a query over a view with \n> rules, the rules (querys in the DO of the RULE) are executed with permssions \n> of the owner of the rule (or the view? Any way, martin is owner of both) and \n> not of the user that executed the query?\n\nNo. With both views and rules, the actions are executed as the user who\nexecuted the query. I don't know if there are plans to allow the 'execute\nas owner' for rules, right now this option only exists for the triggers.\n\n\n",
"msg_date": "Wed, 6 Jun 2001 19:27:50 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] something smells bad"
},
{
"msg_contents": "Sending this to the Hackers list because I think that there may be a bug.\n\nOn Jue 07 Jun 2001 02:27, Alex Pilosov wrote:\n> On Wed, 6 Jun 2001, [iso-8859-1] Mart�n Marqu�s wrote:\n> > OK, now I'm more then astonished!\n> > Why was I able to insert as martin then?\n> > Isn't it true (as the docs say) that when I execute a query over a view\n> > with rules, the rules (querys in the DO of the RULE) are executed with\n> > permssions of the owner of the rule (or the view? Any way, martin is\n> > owner of both) and not of the user that executed the query?\n>\n> No. With both views and rules, the actions are executed as the user who\n> executed the query. I don't know if there are plans to allow the 'execute\n> as owner' for rules, right now this option only exists for the triggers.\n\nWell, after todays tests, I have to say that rules are executed with owner \nprivileges, and not users.\nThis is the output:\n\nwebunl=> \\dp\n\n Access permissions for database \"webunl\"\n Relation | Access permissions\n-----------------------------+------------------------------------------------\n admin_view | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n admin_view_categ | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n admin_view_docente | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n admin_view_facultades | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n admin_view_materias | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n admin_view_modal | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n area | {\"=r\",\"martin=arwR\"}\n area_id_area_seq |\n carrera | {\"=r\",\"martin=arwR\"}\n carrera_id_curso_seq | {\"=\",\"martin=arwR\"}\n categ | {\"=r\",\"martin=arwR\"}\n categ_id_categ_seq |\n docentes | {\"=r\",\"martin=arwR\"}\n docentes_id_docente_seq | {\"=\",\"martin=arwR\"}\n facultad | {\"=r\",\"martin=arwR\"}\n facultad_id_fac_seq |\n inscripcion | {\"=r\",\"martin=arwR\"}\n log_carrera | {\"=\",\"martin=arwR\"}\n log_carrera_id_log_seq | {\"=\",\"martin=arwR\"}\n materias | {\"=r\",\"martin=arwR\"}\n materias_id_mat_seq | {\"=\",\"martin=arwR\"}\n modalidad | {\"=r\",\"martin=arwR\"}\n nexo_categ | {\"=r\",\"martin=arwR\"}\n nexo_facultad | {\"=r\",\"martin=arwR\"}\n niveles | {\"=r\",\"martin=arwR\"}\n niveles_id_nivel_seq |\n resol | {\"=r\",\"martin=arwR\"}\n sub_area | {\"=r\",\"martin=arwR\"}\n sub_area_id_subarea_seq |\n tipo_cursado | {\"=r\",\"martin=arwR\"}\n tipo_cursado_id_cursado_seq |\n tipo_modal | {\"=r\",\"martin=arwR\"}\n tipo_modal_id_mod_seq |\n(33 rows)\n \nwebunl=> GRANT ALL ON \ncarrera_id_curso_seq,docentes_id_docente_seq,log_carrera_id_log_seq,materias_id_mat_seq \n TO GROUP webunl_admin;\nCHANGE\nwebunl=> \\c webunl mariana\nYou are now connected to database webunl as user mariana.\nwebunl=> INSERT INTO admin_view\nwebunl-> \n(titulo,subarea,descripcion,matricula,nivel,requisitos,duracion,cupos,numero,year,fecha,fecha_ini,fecha_fin,lugar,informes \n,director,carrera)\nwebunl-> VALUES ('y este el tiutulo',14,'descripcion',0,1,'Y bueno, los \nrequisitos \nson.....',12,0,34534,2000,'6/6/2000','10/10/2001','30/12/2001','Donde\nwebunl'> mas.......','Para mas info, limpie','Quien, yo?','Esta es una \ncarrera');\nINSERT 240135 1\nwebunl=>\n\nNow, mariana is a member of the webunl_admin group, and before the GRANT to \nall those sequences, the query (INSERT) shes executing here gave an error \nwhen trying to do a carrera_id_curso_seq:next (is this the right sintax?).\n\nSaludos.... :-)\n\n-- \nCualquiera administra un NT.\nEse es el problema, que cualquiera administre.\n-----------------------------------------------------------------\nMartin Marques | mmarques@unl.edu.ar\nProgramador, Administrador | Centro de Telematica\n Universidad Nacional\n del Litoral\n-----------------------------------------------------------------\n",
"msg_date": "Thu, 7 Jun 2001 09:26:52 +0300",
"msg_from": "=?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= <martin@bugs.unl.edu.ar>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] something smells bad"
},
{
"msg_contents": "On Thu, 7 Jun 2001, [iso-8859-1] Mart�n Marqu�s wrote:\n\n> On Jue 07 Jun 2001 02:27, Alex Pilosov wrote:\n> > On Wed, 6 Jun 2001, [iso-8859-1] Mart�n Marqu�s wrote:\n> > > OK, now I'm more then astonished!\n> > > Why was I able to insert as martin then?\n> > > Isn't it true (as the docs say) that when I execute a query over a view\n> > > with rules, the rules (querys in the DO of the RULE) are executed with\n> > > permssions of the owner of the rule (or the view? Any way, martin is\n> > > owner of both) and not of the user that executed the query?\n> >\n> > No. With both views and rules, the actions are executed as the user who\n> > executed the query. I don't know if there are plans to allow the 'execute\n> > as owner' for rules, right now this option only exists for the triggers.\n> \n> Well, after todays tests, I have to say that rules are executed with owner \n> privileges, and not users.\n> This is the output:\n*mutter* I was mistaken, indeed, views are executed with permissions of\nowner of the view. \n\n-alex\n\n\n",
"msg_date": "Thu, 7 Jun 2001 12:46:15 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] something smells bad"
},
{
"msg_contents": "> Sending this to the Hackers list because I think that there may be a bug.\n\n\nDid you include the smell in the email message? :-)\n\n\n> \n> On Jue 07 Jun 2001 02:27, Alex Pilosov wrote:\n> > On Wed, 6 Jun 2001, [iso-8859-1] Mart?n Marqu?s wrote:\n> > > OK, now I'm more then astonished!\n> > > Why was I able to insert as martin then?\n> > > Isn't it true (as the docs say) that when I execute a query over a view\n> > > with rules, the rules (querys in the DO of the RULE) are executed with\n> > > permssions of the owner of the rule (or the view? Any way, martin is\n> > > owner of both) and not of the user that executed the query?\n> >\n> > No. With both views and rules, the actions are executed as the user who\n> > executed the query. I don't know if there are plans to allow the 'execute\n> > as owner' for rules, right now this option only exists for the triggers.\n> \n> Well, after todays tests, I have to say that rules are executed with owner \n> privileges, and not users.\n> This is the output:\n> \n> webunl=> \\dp\n> \n> Access permissions for database \"webunl\"\n> Relation | Access permissions\n> -----------------------------+------------------------------------------------\n> admin_view | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n> admin_view_categ | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n> admin_view_docente | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n> admin_view_facultades | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n> admin_view_materias | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n> admin_view_modal | {\"=r\",\"martin=arwR\",\"group webunl_admin=arwR\"}\n> area | {\"=r\",\"martin=arwR\"}\n> area_id_area_seq |\n> carrera | {\"=r\",\"martin=arwR\"}\n> carrera_id_curso_seq | {\"=\",\"martin=arwR\"}\n> categ | {\"=r\",\"martin=arwR\"}\n> categ_id_categ_seq |\n> docentes | {\"=r\",\"martin=arwR\"}\n> docentes_id_docente_seq | {\"=\",\"martin=arwR\"}\n> facultad | {\"=r\",\"martin=arwR\"}\n> facultad_id_fac_seq |\n> inscripcion | {\"=r\",\"martin=arwR\"}\n> log_carrera | {\"=\",\"martin=arwR\"}\n> log_carrera_id_log_seq | {\"=\",\"martin=arwR\"}\n> materias | {\"=r\",\"martin=arwR\"}\n> materias_id_mat_seq | {\"=\",\"martin=arwR\"}\n> modalidad | {\"=r\",\"martin=arwR\"}\n> nexo_categ | {\"=r\",\"martin=arwR\"}\n> nexo_facultad | {\"=r\",\"martin=arwR\"}\n> niveles | {\"=r\",\"martin=arwR\"}\n> niveles_id_nivel_seq |\n> resol | {\"=r\",\"martin=arwR\"}\n> sub_area | {\"=r\",\"martin=arwR\"}\n> sub_area_id_subarea_seq |\n> tipo_cursado | {\"=r\",\"martin=arwR\"}\n> tipo_cursado_id_cursado_seq |\n> tipo_modal | {\"=r\",\"martin=arwR\"}\n> tipo_modal_id_mod_seq |\n> (33 rows)\n> \n> webunl=> GRANT ALL ON \n> carrera_id_curso_seq,docentes_id_docente_seq,log_carrera_id_log_seq,materias_id_mat_seq \n> TO GROUP webunl_admin;\n> CHANGE\n> webunl=> \\c webunl mariana\n> You are now connected to database webunl as user mariana.\n> webunl=> INSERT INTO admin_view\n> webunl-> \n> (titulo,subarea,descripcion,matricula,nivel,requisitos,duracion,cupos,numero,year,fecha,fecha_ini,fecha_fin,lugar,informes \n> ,director,carrera)\n> webunl-> VALUES ('y este el tiutulo',14,'descripcion',0,1,'Y bueno, los \n> requisitos \n> son.....',12,0,34534,2000,'6/6/2000','10/10/2001','30/12/2001','Donde\n> webunl'> mas.......','Para mas info, limpie','Quien, yo?','Esta es una \n> carrera');\n> INSERT 240135 1\n> webunl=>\n> \n> Now, mariana is a member of the webunl_admin group, and before the GRANT to \n> all those sequences, the query (INSERT) shes executing here gave an error \n> when trying to do a carrera_id_curso_seq:next (is this the right sintax?).\n> \n> Saludos.... :-)\n> \n> -- \n> Cualquiera administra un NT.\n> Ese es el problema, que cualquiera administre.\n> -----------------------------------------------------------------\n> Martin Marques | mmarques@unl.edu.ar\n> Programador, Administrador | Centro de Telematica\n> Universidad Nacional\n> del Litoral\n> -----------------------------------------------------------------\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org\n> \n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 11 Jun 2001 00:28:28 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: something smells bad"
},
{
"msg_contents": "On Lun 11 Jun 2001 07:28, you wrote:\n> > Sending this to the Hackers list because I think that there may be a bug.\n>\n> Did you include the smell in the email message? :-)\n\nOhhh, I don't have already the device to send odors on the net. ;-P\n\n\nAnyway, I would like to know if I'm wrong. I had to change privileges on the \nsequences to make this work. I'm not happy with the solution (mine) because I \nthought that using views and rules would be enough, which was almost. \nSequences got out. :-)\n\nSaludos... :-)\n\n-- \nCualquiera administra un NT.\nEse es el problema, que cualquiera administre.\n-----------------------------------------------------------------\nMartin Marques | mmarques@unl.edu.ar\nProgramador, Administrador | Centro de Telematica\n Universidad Nacional\n del Litoral\n-----------------------------------------------------------------\n",
"msg_date": "Mon, 11 Jun 2001 08:25:59 +0300",
"msg_from": "=?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= <martin@bugs.unl.edu.ar>",
"msg_from_op": true,
"msg_subject": "Re: something smells bad"
},
{
"msg_contents": "Bruce Momjian wrote:\n> \n> > Sending this to the Hackers list because I think that there may be a bug.\n> \n> Did you include the smell in the email message? :-)\n> \nWhat sort of card do I need to read, I mean smell this?\n\nDoes it help that this machine runs Win95, thereby already stinking\nsomewhat?\n\nI wish IBM would hurry and release the StinkPad. :^)\n",
"msg_date": "Mon, 11 Jun 2001 11:28:09 -0500",
"msg_from": "\"Keith G. Murphy\" <keithmur@mindspring.com>",
"msg_from_op": false,
"msg_subject": "Re: something smells bad"
}
] |
[
{
"msg_contents": "Hi all,\n I am trying to delete a record which had one of the fields as oid.\nI was able to delete all the records except for 3.\nI tried:\nselect lo_unlink(64445) from tablename\nAnd then:\ndelete from tablename where id=1;\n\nit worked\nBut for 3 records the delete command goes in hang.\n\non executing:\nselect lo_unlink(67787) from tablename\n\nit gives:\nlo_unlink\n-----------\n -1\n -1\n(2 rows)\nand on deleting with the delete command it goes on hang.\n\nI want to drop the same table but can't do that either.\nI want to create another table with the same name.\n\nAny help would be appreciated.\n\nThanks in advance,\nRai\n\n_________________________________________________________________________\nGet Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.\n\n",
"msg_date": "Wed, 06 Jun 2001 16:03:59 ",
"msg_from": "\"rai lalit\" <rai_l@hotmail.com>",
"msg_from_op": true,
"msg_subject": "Delete oid causing problems"
}
] |
[
{
"msg_contents": "With XSDs right around the corner using ISO 8601 compliant dates, what\nare the chances Postgres could fully support them?\n\nThe primary difference between that and what it does now is a T for\nthe date / time seperator rather than a space and the potential for a\nZ for the timezone seperator.\n\nI'm convinced this was done to piss me off and enforce conversion\nroutines for databases to actually accept the information passed.\n\nInfo:\n\n1999-05-31T13:20:00.000-05:00\n\nMay 31st 1999 at 1.20pm Eastern Standard Time which is 5 hours behind\nCo-Ordinated Universal Time\n\nhttp://www.cs.utsa.edu/~wagner/date/8601.pdf\nhttp://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dateTime\n--\nRod Taylor\n\nYour eyes are weary from staring at the CRT. You feel sleepy. Notice\nhow restful it is to watch the cursor blink. Close your eyes. The\nopinions stated above are yours. You cannot imagine why you ever felt\notherwise.",
"msg_date": "Wed, 6 Jun 2001 12:14:13 -0400",
"msg_from": "\"Rod Taylor\" <rbt@barchord.com>",
"msg_from_op": true,
"msg_subject": "Timestamp change - 8601 compliance"
},
{
"msg_contents": "> With XSDs right around the corner using ISO 8601 compliant dates, what\n> are the chances Postgres could fully support them?\n\nGood.\n\n> The primary difference between that and what it does now is a T for\n> the date / time seperator rather than a space and the potential for a\n> Z for the timezone seperator.\n\nThe currently accepted date/time format *is* ISO-compliant. However,\nthere is the \"machine interchange\" (my quotes) version which has the\nembedded \"T\" and \"Z\" fields.\n\n> I'm convinced this was done to piss me off and enforce conversion\n> routines for databases to actually accept the information passed.\n\nOf course ;)\n\nI have patches to support a \"julian day\" format (with a leading \"J\" or\n\"JD\"), and istm that support for the \"T\" and \"Z\" fillers would be close\nto trivial. I'll try some testing...\n\n - Thomas\n",
"msg_date": "Wed, 06 Jun 2001 20:55:42 +0000",
"msg_from": "Thomas Lockhart <lockhart@alumni.caltech.edu>",
"msg_from_op": false,
"msg_subject": "Re: Timestamp change - 8601 compliance"
}
] |
[
{
"msg_contents": "Hi,\n\nI am trying to use postgresql in some research\nproject. I need to add some new operators, some\nwill probably take more than 2 input tuple streams.\nThe new operator will be considered by optimizer\nwhen estimating cost and choosing a plan.\n\nCan anyone tell me how hard this will be? And\nwhere is a good place to start? \n\nThanks.\n\nFeng\n\n\n",
"msg_date": "Wed, 6 Jun 2001 11:16:59 -0500 (CDT)",
"msg_from": "Feng Tian <ftian@cs.wisc.edu>",
"msg_from_op": true,
"msg_subject": "Adding some new operators"
}
] |
[
{
"msg_contents": "\nMorning all ...\n\n\tHave a client that is running an HP server, specs as follows:\n\n> HP-UX 11.00 HP 9000 L-200, Dual CPU (400MHz - 64 bit),\n> OS Disk: 9GB U2W-LVD SCSI, 10K rpm\n\n\tThey are trying to determine whether or not it will be able to\nhandle their environment, and we're trying to help them from the PgSQL\nside of things ...\n\n\tThey've got one of the HP developers working side-by-side with\nthem, looking at the hardware itself, and they've found:\n\n\" Running two concurrent Psql/Postgres processes made things worse. They\nare blocking each other on semaphores. Elapsed time went from 4m:30s to\n6m:15s (100K inserts).\"\n\n\tThe 4m:30s is running one process for 100K inserts ... with two\nCPUs/processes, it increases the time to process by almost 40% ... ?\n\n\tDoes this make sense?\n\n\tLooking at disk IO during the inserts, its pretty much dead ...\nother then the occasional 'burst' to disk, the disks are quiet, so its all\ngetting tied up in CPU ...\n\n\tThoughts? Suggestions? Other things to investigate that I'm not\nthinking of?\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org\nprimary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org\n\n\n\n",
"msg_date": "Wed, 6 Jun 2001 14:23:49 -0300 (ADT)",
"msg_from": "The Hermit Hacker <scrappy@hub.org>",
"msg_from_op": true,
"msg_subject": "Dual-CPU slower then Single under HP?"
},
{
"msg_contents": "The Hermit Hacker <scrappy@hub.org> writes:\n> \tThe 4m:30s is running one process for 100K inserts ... with two\n> CPUs/processes, it increases the time to process by almost 40% ... ?\n\nDo you mean two processes inserting into the same table?\n\nI committed some changes recently that reduce the amount of contention\ninvolved in that scenario, but it's not released yet.\n\nAnother fairly likely issue is the not-very-good implementation of\nspinlocks. We've talked about finding a way other than select() to\nblock on a spinlock, but no one's done anything about it yet...\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 06 Jun 2001 14:00:38 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Dual-CPU slower then Single under HP? "
},
{
"msg_contents": "On Wed, 6 Jun 2001, Tom Lane wrote:\n\n> The Hermit Hacker <scrappy@hub.org> writes:\n> > \tThe 4m:30s is running one process for 100K inserts ... with two\n> > CPUs/processes, it increases the time to process by almost 40% ... ?\n>\n> Do you mean two processes inserting into the same table?\n\nYup ...\n\n> I committed some changes recently that reduce the amount of contention\n> involved in that scenario, but it's not released yet.\n\nSo, this is one of those \"known problem, improved in v7.2\" sort of issues?\n\n\n",
"msg_date": "Wed, 6 Jun 2001 15:46:30 -0300 (ADT)",
"msg_from": "The Hermit Hacker <scrappy@hub.org>",
"msg_from_op": true,
"msg_subject": "Re: Dual-CPU slower then Single under HP? "
},
{
"msg_contents": "The Hermit Hacker <scrappy@hub.org> writes:\n> So, this is one of those \"known problem, improved in v7.2\" sort of issues?\n\nYup.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 06 Jun 2001 14:54:12 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Dual-CPU slower then Single under HP? "
},
{
"msg_contents": "\nGreat, thanks :)\n\nOn Wed, 6 Jun 2001, Tom Lane wrote:\n\n> The Hermit Hacker <scrappy@hub.org> writes:\n> > So, this is one of those \"known problem, improved in v7.2\" sort of issues?\n>\n> Yup.\n>\n> \t\t\tregards, tom lane\n>\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org\nprimary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org\n\n",
"msg_date": "Wed, 6 Jun 2001 16:08:15 -0300 (ADT)",
"msg_from": "The Hermit Hacker <scrappy@hub.org>",
"msg_from_op": true,
"msg_subject": "Re: Dual-CPU slower then Single under HP? "
}
] |
[
{
"msg_contents": "Does anyone want to keep elog(NOIND)? It's not used anywhere, and I think\nthe notion of indentation levels, while kind of obsolete with syslog\nanyway, should not be part of the elog API.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Wed, 6 Jun 2001 19:28:01 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": true,
"msg_subject": "elog(NOIND)?"
},
{
"msg_contents": "Peter Eisentraut <peter_e@gmx.net> writes:\n> Does anyone want to keep elog(NOIND)? It's not used anywhere, and I think\n> the notion of indentation levels, while kind of obsolete with syslog\n> anyway, should not be part of the elog API.\n\nNuke it.\n\nWhile you're at it, rearrange the numeric order of the elog levels to be\nsensible. There are some bizarrely-coded tests in elog.c that could be\nsimplified if severity levels had the obvious ordering.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 06 Jun 2001 14:03:28 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: elog(NOIND)? "
},
{
"msg_contents": "Tom Lane writes:\n\n> While you're at it, rearrange the numeric order of the elog levels to be\n> sensible. There are some bizarrely-coded tests in elog.c that could be\n> simplified if severity levels had the obvious ordering.\n\nOkay, but I'm not sure there will be a total ordering forever. For\nexample, it's pretty useless to log user-level errors like \"syntax error\"\nto the server log by default. There needs to be more flexibility.\n\nDoes anyone foresee a problem with making them an enum?\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Thu, 7 Jun 2001 16:40:08 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": true,
"msg_subject": "Re: elog(NOIND)? "
}
] |
[
{
"msg_contents": "Hi,\n\nI am trying to use postgresql in a research\nproject. I need to add several new operators, some\nwill probably take more than 2 input tuple streams.\nThe new operator will be considered by optimizer\nwhen estimating cost and choosing a plan.\n\nCan anyone tell me how hard this will be? And\nwhere is a good place to start? \n\nThanks.\n\nFeng\n\n\n\n",
"msg_date": "Wed, 6 Jun 2001 13:17:16 -0500 (CDT)",
"msg_from": "Feng Tian <ftian@cs.wisc.edu>",
"msg_from_op": true,
"msg_subject": "Adding some new operators"
}
] |
[
{
"msg_contents": "There is a \"postgres\" option -o which can redirect the server output to a\nfile. The postmaster output will still go to stderr. Does anyone recall\nhow this was supposed to be useful?\n\nInteresting code (from elog):\n\n /* NOTE: debug file is typically pointed at stderr */\n write(Debugfile, msg_buf, len);\n\n ...\n\n /*\n * fflush here is just to improve the odds that we get to see\n * the error message, in case things are so hosed that\n * proc_exit crashes. [...]\n */\n fflush(stdout);\n fflush(stderr);\n\nFat chance. ;-)\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Wed, 6 Jun 2001 21:43:53 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": true,
"msg_subject": "And what about that Debugfile?"
},
{
"msg_contents": "Peter Eisentraut <peter_e@gmx.net> writes:\n> There is a \"postgres\" option -o which can redirect the server output to a\n> file. The postmaster output will still go to stderr. Does anyone recall\n> how this was supposed to be useful?\n\nThat code is, um, ancient. I recall having seen comments to the effect\nthat you were expected to do something like \"-o /dev/ttyNN\" to redirect\nthe debug output of a particular backend to your console. There's even\na field in the initial connection message to allow this to be specified\nconveniently --- but I believe we've disabled it for security reasons,\nsince one doesn't really want random clients to be able to command the\nbackend to write on an arbitrary filename.\n\nI can see some value in being able to separate the log output of one\nbackend from the rest of 'em ... but given the security issues, it seems\nunlikely that anyone will ever again use the feature in the way it was\nintended. It needs to be rethunk.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 06 Jun 2001 17:25:21 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: And what about that Debugfile? "
}
] |
[
{
"msg_contents": "Eric writes:\n\n> I can realize this function in the SYBase,but How can i do it in the PostgreSQL?\n>\n> /****SQL***/\n> if not exists(select id from test) insert into test(id) values (280);\n> /*********/\n\nI don't know if this is SQL92, but \n\ninsert into test(id) select 280 where not exists(select id from test);\n",
"msg_date": "Wed, 06 Jun 2001 18:32:37 -0400",
"msg_from": "Robert Forsman <thoth@purplefrog.com>",
"msg_from_op": true,
"msg_subject": "Re: SQL( \"if ...exists...),how to do it in the PostgreSQL?"
}
] |
[
{
"msg_contents": "pgsql-hackers-owner@postgresql.org ,in message <200106062214.f56ME2E51506@postg\n\tresql.org>, wrote: \n\n> First it's not standard SQL, so chances aren't that good.\n> Second, how do you think the system should behave in the\n> following case:\n> \n> * Table A has one trigger BEFORE INSERT doing some checks\n> plus inserting a row into table newA and updating a row in\n> table balanceA. It also has triggers BEFORE UPDATE and\n> BEFORE DELETE that update balanceA.\n> \n> * Now we do your REPLACE INTO\n> \n> The problem is that in a concurrent multiuser environment you\n> cannot know if that row exists until you actually do the\n> insert (except you lock the entire table and check for).\n> Since there's a BEFORE trigger which potentially could\n> suppress the INSERT, you can't do the insert before fireing\n> it. Now it has been run, did it's inserts and updates and the\n> statement must be converted into an UPDATE because the row\n> exists - how do you undo the trigger work?\n\n How about doing things the other way around ? :\n\n Attempt the update. If it succeeds and affects zero rows (and therefore\nlaunches no triggers?), then do an insert.\n\n Any failure during the update should probably constitute failure of the\nreplace and preclude attempting the insert.\n\n I have to weigh in and say that I REALLY wish SQL had a standard REPLACE\n(or I'd call it \"SET\") operator. Since it does not I have to do the UPDATE\n|| INSERT thing in many places. It doesn't help either when your library has\nbugs that prevent returning an accurate count of rows affected either.\n\n-- \nBob Forsman thoth@gainesville.fl.us\n http://www.gainesville.fl.us/~thoth/\n",
"msg_date": "Wed, 06 Jun 2001 18:45:34 -0400",
"msg_from": "Robert Forsman <thoth@purplefrog.com>",
"msg_from_op": true,
"msg_subject": "Re: Daily Digest V1 #1428 "
},
{
"msg_contents": "Robert Forsman wrote:\n> \n> It doesn't help either when your library has\n> bugs that prevent returning an accurate count of rows affected either.\n\nSo does it have such bugs ?\n\n---------------\nHannu\n",
"msg_date": "Thu, 07 Jun 2001 08:05:44 +0500",
"msg_from": "Hannu Krosing <hannu@tm.ee>",
"msg_from_op": false,
"msg_subject": "Re: Re: Daily Digest V1 #1428"
},
{
"msg_contents": "Hannu Krosing <hannu@tm.ee> ,in message <3B1EEF88.7E086190@tm.ee>, wrote: \n\n> Robert Forsman wrote:\n> > \n> > It doesn't help either when your library has\n> > bugs that prevent returning an accurate count of rows affected either.\n> \n> So does it have such bugs ?\n\n Postgres 7 fixed that JDBC bug. Now we just need NOC to upgrade our\nfield servers.\n\n-- \nBob Forsman thoth@gainesville.fl.us\n http://www.gainesville.fl.us/~thoth/\n",
"msg_date": "Thu, 07 Jun 2001 10:37:36 -0400",
"msg_from": "Robert Forsman <thoth@purplefrog.com>",
"msg_from_op": true,
"msg_subject": "Re: Re: Daily Digest V1 #1428 "
}
] |
[
{
"msg_contents": "\nHello,\n\nI'm a long time Postgres user who uses MySQL when I have to. I recently\nran into an issue with MySQL where this construct didn't do what I expect:\n\nWHERE date_column = NULL\n\nI expected it to work like \"date_column IS NULL\" like it does it\nPostgres 7.0.2, but instead it returned an empty result set. \n\nAfter conversing with some folks on the MySQL list, it was mentioned that:\n\n * \"NULL is *NOT* a value. It's an absence of a value, and doing *any*\ncomparisons with NULL is invalid (the result must always be NULL, even\nif you say \"foo = NULL\").\" \n\n * Postgres handling is non-standard (even if it's intuitive.) \n\nMy questions then are: 1.) What IS the standard for handling NULLs? and\nthen 2.) If Postgres handling is different than the standard, what's the\nreason? \n\nTo me, having \" = NULL\" be the same as \" IS NULL\" is intuitive and thus\nuseful, but I also like appeal of using standards when possible. :) \n\nThanks!\n\n -mark\n\nhttp://mark.stosberg.com/\n",
"msg_date": "Wed, 06 Jun 2001 20:00:45 -0500",
"msg_from": "Mark Stosberg <mark@summersault.com>",
"msg_from_op": true,
"msg_subject": "behavior of ' = NULL' vs. MySQL vs. Standards"
},
{
"msg_contents": "On Wed, 6 Jun 2001, Mark Stosberg wrote:\n\n> \n> Hello,\n> \n> I'm a long time Postgres user who uses MySQL when I have to. I recently\n> ran into an issue with MySQL where this construct didn't do what I expect:\n> \n> WHERE date_column = NULL\n> \n> I expected it to work like \"date_column IS NULL\" like it does it\n> Postgres 7.0.2, but instead it returned an empty result set. \n> \n> After conversing with some folks on the MySQL list, it was mentioned that:\n> \n> * \"NULL is *NOT* a value. It's an absence of a value, and doing *any*\n> comparisons with NULL is invalid (the result must always be NULL, even\n> if you say \"foo = NULL\").\" \n> \n> * Postgres handling is non-standard (even if it's intuitive.) \n> \n> My questions then are: 1.) What IS the standard for handling NULLs? and\n> then 2.) If Postgres handling is different than the standard, what's the\n> reason? \n> \n> To me, having \" = NULL\" be the same as \" IS NULL\" is intuitive and thus\n> useful, but I also like appeal of using standards when possible. :) \n\nYes, column = NULL should *never* return true according to the spec (it\nshould always return NULL in fact as stated). The reason for breaking\nwith the spec is AFAIK to work with broken microsoft clients that seem to\nthink that =NULL is a meaningful test and generate queries using that.\n\nIn general, =NULL should be avoided in favor of IS NULL by users that are\ngenerating their own queries.\n\n\n",
"msg_date": "Wed, 6 Jun 2001 18:12:51 -0700 (PDT)",
"msg_from": "Stephan Szabo <sszabo@megazone23.bigpanda.com>",
"msg_from_op": false,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards"
},
{
"msg_contents": "Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:\n> Yes, column = NULL should *never* return true according to the spec (it\n> should always return NULL in fact as stated). The reason for breaking\n> with the spec is AFAIK to work with broken microsoft clients that seem to\n> think that =NULL is a meaningful test and generate queries using that.\n\nMicrosoft Access is the guilty party, IIRC. I recently tried to stir up\nsome interest in changing this behavior back to the standard, but\napparently there are still too many people using broken versions of\nAccess.\n\nA compromise answer might be to offer a SET variable that selects the\nMicrosoft-compatible misimplementation. Would that fly?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 06 Jun 2001 22:19:42 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards "
},
{
"msg_contents": "\nOn Wed, 6 Jun 2001, Tom Lane wrote:\n\n> Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:\n> > Yes, column = NULL should *never* return true according to the spec (it\n> > should always return NULL in fact as stated). The reason for breaking\n> > with the spec is AFAIK to work with broken microsoft clients that seem to\n> > think that =NULL is a meaningful test and generate queries using that.\n> \n> Microsoft Access is the guilty party, IIRC. I recently tried to stir up\n> some interest in changing this behavior back to the standard, but\n> apparently there are still too many people using broken versions of\n> Access.\n> \n> A compromise answer might be to offer a SET variable that selects the\n> Microsoft-compatible misimplementation. Would that fly?\n\nIt would for me. I'd rather have the default be the spec correct behavior\nand let people configure their server to follow the misinterpretation.\nIs the conversion just the hack in the grammar rules for \na_expr '=' a_expr?\n\n\n",
"msg_date": "Wed, 6 Jun 2001 20:12:46 -0700 (PDT)",
"msg_from": "Stephan Szabo <sszabo@megazone23.bigpanda.com>",
"msg_from_op": false,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards "
},
{
"msg_contents": "Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:\n>> A compromise answer might be to offer a SET variable that selects the\n>> Microsoft-compatible misimplementation. Would that fly?\n\n> It would for me. I'd rather have the default be the spec correct behavior\n> and let people configure their server to follow the misinterpretation.\n\nYes, I agree.\n\n> Is the conversion just the hack in the grammar rules for \n> a_expr '=' a_expr?\n\nAFAIK that's it. It might be a little tricky to do cleanly,\nthough, since gram.y shouldn't look at SET vars. Really, the\nconversion would have to be done in analyze.c instead.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 07 Jun 2001 06:00:30 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards "
},
{
"msg_contents": "> > Yes, column = NULL should *never* return true according to the spec (it\n> > should always return NULL in fact as stated). The reason for breaking\n> > with the spec is AFAIK to work with broken microsoft clients that seem to\n> > think that =NULL is a meaningful test and generate queries using that.\n> Microsoft Access is the guilty party, IIRC. I recently tried to stir up\n> some interest in changing this behavior back to the standard, but\n> apparently there are still too many people using broken versions of\n> Access.\n\nSince according to the standard \"column = NULL\" is a near-useless\nconstruct (equivalent to \"FALSE\") it does not seem to pollute the\ngrammar much to allow an M$ compatible interpretation. I was not happy\nhaving it added (much better to ask that responsive, customer-focused\ncompany to fix their language compliance) but now that it is there it\nseems to be an isolated and manageable feature.\n\n - Thomas\n",
"msg_date": "Thu, 07 Jun 2001 13:41:32 +0000",
"msg_from": "Thomas Lockhart <lockhart@fourpalms.org>",
"msg_from_op": false,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards"
},
{
"msg_contents": "Stephan Szabo wrote:\n> \n> On Wed, 6 Jun 2001, Tom Lane wrote:\n> \n> > Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:\n> > > Yes, column = NULL should *never* return true according to the spec (it\n> > > should always return NULL in fact as stated). The reason for breaking\n> > > with the spec is AFAIK to work with broken microsoft clients that seem to\n> > > think that =NULL is a meaningful test and generate queries using that.\n\n> I'd rather have the default be the spec correct behavior\n> and let people configure their server to follow the misinterpretation.\n\nI like that idea as well. Someone like me who didn't know that this\nfeature was in there for M$ could have assumed it _was_ standard\nbehavior, and started using it as a habit. Then when I started porting\nmy code to another database, I'd have an extra surprise in for me. :) \n\nRather than being an option targeted at just this piece of grammer,\nperhaps it could a piece of a potentially larger option of \"stricter\nstandards compliance.\" I realize there are a number of useful extensions\nto the SQL standard in Postgres (which I like and use.), but it seems\nlike there would be uses for minimizing non-standard behavior, as well. \n\nThank you all for your contributions to Postgres-- I use it everyday. :) \n\n -mark\n\nhttp://mark.stosberg.com/\n",
"msg_date": "Thu, 07 Jun 2001 09:40:40 -0500",
"msg_from": "Mark Stosberg <mark@summersault.com>",
"msg_from_op": true,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards"
},
{
"msg_contents": "Interesting - my experience is that Access, at least, generally treats\nNULL's correctly:\n\n(This was done under Access 2000):\ncreate table foo (name text(20))\ninsert into foo values (\"bar\");\ninsert into foo values (\"bar\");\ninsert into foo values (\"bar\");\ninsert into foo values (\"bar\");\ninsert into foo values (NULL);\ninsert into foo values (NULL);\ninsert into foo values (NULL);\ninsert into foo values (NULL);\n\n\nselect count(*) from foo where name=NULL;\nreturns 0\n\nselect count(*) from foo where name is null;\nreturns 4\n\nselect count(*) from foo where name <> \"bar\";\nreturns 0\n\nCheers,\nAndy\n\n---------------------------------------------------------\n Andrew J. Perrin - Assistant Professor of Sociology\n University of North Carolina, Chapel Hill\n269 Hamilton Hall CB#3210, Chapel Hill, NC 27599-3210 USA\n andrew_perrin@unc.edu - http://www.unc.edu/~aperrin\n\nOn Thu, 7 Jun 2001, Mark Stosberg wrote:\n\n> Stephan Szabo wrote:\n> > \n> > On Wed, 6 Jun 2001, Tom Lane wrote:\n> > \n> > > Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:\n> > > > Yes, column = NULL should *never* return true according to the spec (it\n> > > > should always return NULL in fact as stated). The reason for breaking\n> > > > with the spec is AFAIK to work with broken microsoft clients that seem to\n> > > > think that =NULL is a meaningful test and generate queries using that.\n> \n> > I'd rather have the default be the spec correct behavior\n> > and let people configure their server to follow the misinterpretation.\n> \n> I like that idea as well. Someone like me who didn't know that this\n> feature was in there for M$ could have assumed it _was_ standard\n> behavior, and started using it as a habit. Then when I started porting\n> my code to another database, I'd have an extra surprise in for me. :) \n> \n> Rather than being an option targeted at just this piece of grammer,\n> perhaps it could a piece of a potentially larger option of \"stricter\n> standards compliance.\" I realize there are a number of useful extensions\n> to the SQL standard in Postgres (which I like and use.), but it seems\n> like there would be uses for minimizing non-standard behavior, as well. \n> \n> Thank you all for your contributions to Postgres-- I use it everyday. :) \n> \n> -mark\n> \n> http://mark.stosberg.com/\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 3: if posting/reading through Usenet, please send an appropriate\n> subscribe-nomail command to majordomo@postgresql.org so that your\n> message can get through to the mailing list cleanly\n> \n\n",
"msg_date": "Thu, 7 Jun 2001 10:59:06 -0400 (EDT)",
"msg_from": "ANDREW PERRIN <aperrin@email.unc.edu>",
"msg_from_op": false,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards"
},
{
"msg_contents": "Tom,\n\n>Microsoft Access is the guilty party, IIRC. I recently tried to stir\n> up\n> some interest in changing this behavior back to the standard, but\n> apparently there are still too many people using broken versions of\n> Access.\n\nWhich verison? I work with MSAccess 97 a lot, and the supported syntax\nis \"IS NULL\".\n\n> A compromise answer might be to offer a SET variable that selects the\n> Microsoft-compatible misimplementation. Would that fly?\n\nSounds good to me. By default, I'd like to see \"=NULL\" turned OFF, as\nI've been writing my SQL on the idea that \"=NULL\" will return NULL, and\nif \"=NULL\" starts returning a value it's going to screw several things\nup ...\n\n-Josh\n\n\n______AGLIO DATABASE SOLUTIONS___________________________\n Josh Berkus\n Complete information technology josh@agliodbs.com\n and data management solutions (415) 565-7293\n for law firms, small businesses fax 621-2533\n and non-profit organizations. San Francisco\n",
"msg_date": "Thu, 07 Jun 2001 08:53:21 -0700",
"msg_from": "\"Josh Berkus\" <josh@agliodbs.com>",
"msg_from_op": false,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards "
},
{
"msg_contents": "Tom Lane <tgl@sss.pgh.pa.us> writes:\n\n> A compromise answer might be to offer a SET variable that selects the\n> Microsoft-compatible misimplementation. Would that fly?\n\nI'd say that's the best way to handle stuff like this. If you\nimplement something that breaks the standard, to be compatible with\narrogant programmers at Microsoft who feel that they are above such\nthings, you're encouraging users to develop bad habits. Better to\nmake them go \"SET MICROSOFT BUG COMPATIBILITY ON\" first.\n\nTo see the effect of leniency in re standards, just try to browse\naround the web with a browser that rejects incorrect HTML! :-)\n\n-tih\n-- \nThe basic difference is this: hackers build things, crackers break them.\n",
"msg_date": "07 Jun 2001 21:17:40 +0200",
"msg_from": "Tom Ivar Helbekkmo <tih@kpnQwest.no>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: behavior of ' = NULL' vs. MySQL vs. Standards"
},
{
"msg_contents": "\"Josh Berkus\" <josh@agliodbs.com> writes:\n>> Microsoft Access is the guilty party, IIRC.\n\n> Which verison? I work with MSAccess 97 a lot, and the supported syntax\n> is \"IS NULL\".\n\nIn our last go-round on this (pghackers around 14 Jan 2001),\nMike Mascari wrote:\n\n: I don't have Office 2000, but I can confirm Access 97 generates such \n: queries. The query-builder doesn't generate the 'key = NULL' query, but the\n: use of the Forms interface does.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 10:53:05 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards "
},
{
"msg_contents": "Tom, Mike:\n\n> In our last go-round on this (pghackers around 14 Jan 2001),\n> Mike Mascari wrote:\n> \n> : I don't have Office 2000, but I can confirm Access 97 generates\n> such \n> : queries. The query-builder doesn't generate the 'key = NULL' query,\n> but the\n> : use of the Forms interface does.\n\nAs someone who develops professionally for MSAccess<->ODBC Servers\n(PostgreSQL and MS SQL Server) I'd say that we can ignore this. There\nare a *lot* of circumstances where the \"Filter by Form\" interface breaks\ndown; I don't think that it works properly with MS SQL Server 7.0,\neither.\n\nAt most, rather than modifying the query parser and building extra\ncompile-time options, how about talking to the Great bridge folks about\nmodifying PgODBC? That seems like the appropriate place to tell the\nsystem that \"= NULL\" is equivalent to \"IS NULL\" -- if anywhere.\n\n-Josh Berkus\n\n\n______AGLIO DATABASE SOLUTIONS___________________________\n Josh Berkus\n Complete information technology josh@agliodbs.com\n and data management solutions (415) 565-7293\n for law firms, small businesses fax 621-2533\n and non-profit organizations. San Francisco\n",
"msg_date": "Fri, 08 Jun 2001 08:33:07 -0700",
"msg_from": "\"Josh Berkus\" <josh@agliodbs.com>",
"msg_from_op": false,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards "
},
{
"msg_contents": "\"Josh Berkus\" <josh@agliodbs.com> writes:\n>> : I don't have Office 2000, but I can confirm Access 97 generates such \n>> : queries. The query-builder doesn't generate the 'key = NULL' query,\n>> : but the use of the Forms interface does.\n\n> As someone who develops professionally for MSAccess<->ODBC Servers\n> (PostgreSQL and MS SQL Server) I'd say that we can ignore this. There\n> are a *lot* of circumstances where the \"Filter by Form\" interface breaks\n> down; I don't think that it works properly with MS SQL Server 7.0,\n> either.\n\nThis is an interesting comment. Does anyone else want to confirm or\nrefute it? If Access' forms interface is so badly broken that few\npeople use it anyway, then I'd say that we should not break standards\ncompatibility just to support it.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 18:01:41 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: behavior of ' = NULL' vs. MySQL vs. Standards "
}
] |
[
{
"msg_contents": "Hi,\n\nIs there any plans for making RPM's for 7.1.2 ?\n\nI'm particularily interested in RPM's for RH 6.2 as I have \nonly a few sites running RH 7.x and can do the usual \nconfigure-make-make install on these.\n\n------------------\nHannu\n",
"msg_date": "Thu, 07 Jun 2001 08:43:36 +0500",
"msg_from": "Hannu Krosing <hannu@tm.ee>",
"msg_from_op": true,
"msg_subject": "Any time estimates for 7.1.2 RPM's ?"
},
{
"msg_contents": "On Thu, Jun 07, 2001 at 08:43:36AM +0500, Hannu Krosing wrote:\n> Hi,\n> Is there any plans for making RPM's for 7.1.2 ?\n> \n> I'm particularily interested in RPM's for RH 6.2 as I have \n> only a few sites running RH 7.x and can do the usual \n> configure-make-make install on these.\n> \n> ------------------\n> Hannu\n\n<BLATANT_SELF_PROMOTION>\n\nWe already have 7.1.2 RPM's for Conectiva Linux\n(snapshot.conectiva.com for more details), and you can apt-get them\n(if you are using Conectiva, that is).\n\nThe only drawback of this packages is that they have pltcl and plperl\nflagged off.\n\n</BLATANT_SELF_PROMOTION>\n\n\nSergio Bruder\n\n-- \n ( \t\t\n )) (tm)\thttp://sergio.bruder.net\n|\"\"|-. \t\thttp://pontobr.org\n|__|-' \t\tbruder@conectiva.com.br, sergio@bruder.net\n------------------------------------------------------------------------------\npub 1024D/0C7D9F49 2000-05-26 Sergio Devojno Bruder <bruder@conectiva.com.br>\n Key fingerprint = 983F DBDF FB53 FE55 87DF 71CA 6B01 5E44 0C7D 9F49\nsub 1024g/138DF93D 2000-05-26\n",
"msg_date": "Thu, 7 Jun 2001 09:53:04 -0300",
"msg_from": "Sergio Bruder <bruder@conectiva.com.br>",
"msg_from_op": false,
"msg_subject": "Re: Any time estimates for 7.1.2 RPM's ?"
},
{
"msg_contents": "\nIf you are in a real big hurry - you can always look at RedHat's\nrawhide (the devel tree) and pick up those postgresql rpms. However, you\nneed to pull the SRPM and compile for the proper release of of the system\nyou are running.\n\nbtw, the normal configure-make-makeinstall method doesn't work on RedHat\n6.2? Weird ... works for me (tm).\n\nOn Thu, 7 Jun 2001, Hannu Krosing wrote:\n\n> Hi,\n>\n> Is there any plans for making RPM's for 7.1.2 ?\n>\n> I'm particularily interested in RPM's for RH 6.2 as I have\n> only a few sites running RH 7.x and can do the usual\n> configure-make-make install on these.\n>\n> ------------------\n> Hannu\n\n-- \n//========================================================\\\\\n|| D. Hageman <dhageman@dracken.com> ||\n\\\\========================================================//\n\n",
"msg_date": "Thu, 7 Jun 2001 08:50:14 -0500 (CDT)",
"msg_from": "\"D. Hageman\" <dhageman@dracken.com>",
"msg_from_op": false,
"msg_subject": "Re: Any time estimates for 7.1.2 RPM's ?"
},
{
"msg_contents": "\"D. Hageman\" wrote:\n> \n> If you are in a real big hurry - you can always look at RedHat's\n> rawhide (the devel tree) and pick up those postgresql rpms. However, you\n> need to pull the SRPM and compile for the proper release of of the system\n> you are running.\n \nThanks! downloading it now.\n\n> btw, the normal configure-make-makeinstall method doesn't work on RedHat\n> 6.2? Weird ... works for me (tm).\n\nIt works for me too, just that I have quite many installations some of\nwhich \ndon't even have a compiler installed. It does not work without gcc ;)\n\n-------------\nHannu\n",
"msg_date": "Thu, 07 Jun 2001 16:43:50 +0200",
"msg_from": "Hannu Krosing <hannu@tm.ee>",
"msg_from_op": true,
"msg_subject": "Re: Any time estimates for 7.1.2 RPM's ?"
},
{
"msg_contents": "-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn Wednesday 06 June 2001 23:43, Hannu Krosing wrote:\n> Is there any plans for making RPM's for 7.1.2 ?\n\nYes. But the best-laid plans of mice and men.....\n\n> I'm particularily interested in RPM's for RH 6.2 as I have\n> only a few sites running RH 7.x and can do the usual\n> configure-make-make install on these.\n\nRedHat 6.2 is one of the systems I currently build on.\n\nMy apologies to the whole group for my tardiness in this. Suffice to say \nthat my week started busy and just got worse.\n\nSaturday morning I will have another air-shift here, and I'm _not_ planning \nany computer surgery this time! (argh for D-Link's DFE-530TX being \nincompatible with an ABit KT7A motherboard! Double ARGH for the ATA-100 data \ncorruption it caused -- to 180GB of data (our broadcast music library on hard \ndrive) AND another ARGH for VIA's ATA-100 bugs AND yet another for one \ncranky Maxtor 60GB drive.....). So I fully expect to release RPM's for 7.1.2 \nby noon Saturday.\n\nWhile the advice to pick up the Rawhide 7.1.2 source RPM is sound for a user \nof RedHat 7.x, unless you have updated to RPM 3.0.5 or greater on your 6.2 \nboxen you won't be able to install the source RPM from Rawhide, since it was \nwritten in RPM4 format.\n- --\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.0.4 (GNU/Linux)\nComment: For info see http://www.gnupg.org\n\niD8DBQE7H5Pn5kGGI8vV9eERAjJmAKCXEnmz+cQ9XyQGrLc3SNAqxgRFKwCgme8i\n36+rrwPFCYXZLeKYHFQKel0=\n=WwZP\n-----END PGP SIGNATURE-----\n",
"msg_date": "Thu, 7 Jun 2001 10:47:00 -0400",
"msg_from": "Lamar Owen <lamar.owen@wgcr.org>",
"msg_from_op": false,
"msg_subject": "Re: Any time estimates for 7.1.2 RPM's ?"
},
{
"msg_contents": "-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn Thursday 07 June 2001 10:43, Hannu Krosing wrote:\n> It works for me too, just that I have quite many installations some of\n> which\n> don't even have a compiler installed. It does not work without gcc ;)\n\nI'm glad I'mnot the only one who does that on database servers :-)\n- --\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.0.4 (GNU/Linux)\nComment: For info see http://www.gnupg.org\n\niD8DBQE7H5Qg5kGGI8vV9eERAhkOAKDQ/lr33BnM8Xca5/yf28lMlLowqACeMYe+\nK/b3vYmMy8WQmD+RNbmDAog=\n=Q7SW\n-----END PGP SIGNATURE-----\n",
"msg_date": "Thu, 7 Jun 2001 10:47:57 -0400",
"msg_from": "Lamar Owen <lamar.owen@wgcr.org>",
"msg_from_op": false,
"msg_subject": "Re: Any time estimates for 7.1.2 RPM's ?"
},
{
"msg_contents": "Hannu Krosing <hannu@tm.ee> writes:\n\n> > btw, the normal configure-make-makeinstall method doesn't work on RedHat\n> > 6.2? Weird ... works for me (tm).\n> \n> It works for me too, just that I have quite many installations some\n> of which don't even have a compiler installed. It does not work\n> without gcc ;)\n\nI've found that doing conf/make/make install on a dev system, and then \ncopying the resulting /usr/local/pgsql tree to production systems,\nworks fine. Not quite as clean as RPM, but quite usable--I was doing\nthis with 7.1pre before 7.1 came out. Of course, your library\nversions and all that have to match reasonably closely...\n\n-Doug\n-- \nThe rain man gave me two cures; he said jump right in,\nThe first was Texas medicine--the second was just railroad gin,\nAnd like a fool I mixed them, and it strangled up my mind,\nNow people just get uglier, and I got no sense of time... --Dylan\n",
"msg_date": "07 Jun 2001 11:06:49 -0400",
"msg_from": "Doug McNaught <doug@wireboard.com>",
"msg_from_op": false,
"msg_subject": "Re: Any time estimates for 7.1.2 RPM's ?"
},
{
"msg_contents": "Lamar Owen wrote:\n> \n> Saturday morning I will have another air-shift here, and I'm _not_ planning\n> any computer surgery this time! (argh for D-Link's DFE-530TX being\n> incompatible with an ABit KT7A motherboard! Double ARGH for the ATA-100 data\n> corruption it caused -- to 180GB of data (our broadcast music library on hard\n> drive) AND another ARGH for VIA's ATA-100 bugs AND yet another for one\n> cranky Maxtor 60GB drive.....). So I fully expect to release RPM's for 7.1.2\n> by noon Saturday.\n\nThat would be great \n\n> While the advice to pick up the Rawhide 7.1.2 source RPM is sound for a user\n> of RedHat 7.x, unless you have updated to RPM 3.0.5 or greater on your 6.2\n> boxen you won't be able to install the source RPM from Rawhide, since it was\n> written in RPM4 format.\n\nThanks for this info. I had just completed a --rebuild on RH 7.1 and\nplanned to \ndo the same on 6.2, but I guess I'd rather wait a few days. \n\nI have had bad experience upgrading rpm package a few times (the rpm\ndatabase \ngetting whacked and all subsequent installs claiming some packages to be\nmissing)\nso I'd rather avoid upgrading unless I absolutely have to.\n\n-------------\nHannu\n",
"msg_date": "Thu, 07 Jun 2001 17:24:13 +0200",
"msg_from": "Hannu Krosing <hannu@tm.ee>",
"msg_from_op": true,
"msg_subject": "Re: Any time estimates for 7.1.2 RPM's ?"
},
{
"msg_contents": "Hannu Krosing <hannu@tm.ee> writes:\n\n> Lamar Owen wrote:\n> > \n> > While the advice to pick up the Rawhide 7.1.2 source RPM is sound for a user\n> > of RedHat 7.x, unless you have updated to RPM 3.0.5 or greater on your 6.2\n> > boxen you won't be able to install the source RPM from Rawhide, since it was\n> > written in RPM4 format.\n> \n> Thanks for this info. I had just completed a --rebuild on RH 7.1 and\n> planned to do the same on 6.2, but I guess I'd rather wait a few\n> days. \n\nNote that most 6.2 systems already have a new version, as both 3.0.5\nand 4.0.2 have been released at erratas at different times.\n\n-- \nTrond Eivind Glomsr�d\nRed Hat, Inc.\n",
"msg_date": "07 Jun 2001 11:33:15 -0400",
"msg_from": "teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)",
"msg_from_op": false,
"msg_subject": "Re: Any time estimates for 7.1.2 RPM's ?"
},
{
"msg_contents": "-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn Thursday 07 June 2001 11:24, Hannu Krosing wrote:\n> I have had bad experience upgrading rpm package a few times (the rpm\n> database\n> getting whacked and all subsequent installs claiming some packages to be\n> missing)\n> so I'd rather avoid upgrading unless I absolutely have to.\n\nWell,the upgrade to 3.0.5 isn't a problem. Personally, I won't upgrade my \n6.2 box to RPM4 -- but that is a personal choice having a lot to do with the \nRPM release of PostgreSQL built on this machine.\n\nUpgrading to 3.0.5 should be completely painless. You do need the new \n'rpm-build' package, though, or you won't be able to rebuild.\n- --\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.0.4 (GNU/Linux)\nComment: For info see http://www.gnupg.org\n\niD8DBQE7H6Bi5kGGI8vV9eERAveXAJ9gmYsSYas4/CGVucJdl+BYEKEUjACeOCNW\n47lMVY1Hjv5SFW0tp4MMBqg=\n=kTbh\n-----END PGP SIGNATURE-----\n",
"msg_date": "Thu, 7 Jun 2001 11:40:15 -0400",
"msg_from": "Lamar Owen <lamar.owen@wgcr.org>",
"msg_from_op": false,
"msg_subject": "Re: Any time estimates for 7.1.2 RPM's ?"
}
] |
[
{
"msg_contents": "I have a report from BSD/OS developers that 'make check' fails during\nthe initdb stage. Any ideas?\n\n/bin/sh ./pg_regress --temp-install --top-builddir=../../.. --schedule=./parallel_schedule --multibyte=\n============== removing existing temp installation ==============\n============== creating temporary installation ==============\n============== initializing database system ==============\n============== starting postmaster ==============\nrunning on port 65432 with pid 14870\n============== creating database \"regression\" ==============\npsql: connectDBStart() -- connect() failed: No such file or directory\n Is the postmaster running locally\n and accepting connections on Unix socket '/tmp/.s.PGSQL.65432'?\ncreatedb: database creation failed\npg_regress: createdb failed\nkill: 14870: No such process\ngmake[2]: Leaving directory `/usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/test/regress'\ngmake[1]: Leaving directory `/usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/test'\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 7 Jun 2001 01:00:55 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "make check fails"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> I have a report from BSD/OS developers that 'make check' fails during\n> the initdb stage. Any ideas?\n\nWhat's left in the logfiles, particularly the postmaster log?\n(See src/test/regress/log/)\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 18:24:32 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: make check fails "
},
{
"msg_contents": "> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > I have a report from BSD/OS developers that 'make check' fails during\n> > the initdb stage. Any ideas?\n> \n> What's left in the logfiles, particularly the postmaster log?\n> (See src/test/regress/log/)\n\nI had him test it on BSD/OS 4.2 and it worked fine. Seems it is a bug\nin BSD/OS 4.3 alpha/beta.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Fri, 8 Jun 2001 18:28:08 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: make check fails"
}
] |
[
{
"msg_contents": "Here's an idea. Allow (escaped) wildcards in pg_dump's -t switch.\n\nie.\n\nbash#> pg_dump -d -t diary_\\* testdb > diary.sql\n\nIs that an easy thing or a hard thing?\n\nChris\n\n",
"msg_date": "Thu, 7 Jun 2001 14:50:13 +0800",
"msg_from": "\"Christopher Kings-Lynne\" <chriskl@familyhealth.com.au>",
"msg_from_op": true,
"msg_subject": "Wildcards in pg_dump"
}
] |
[
{
"msg_contents": "I tried another group without success, so....\n\nThe documents do not explain clearly enough, and here are no examples\nshowing how to connect (via TCP/IP) to pg on another host.\n\nI need to supply user, password and database/\n\nHere are examples that do not work:\n // exec sql connect \"tcp:postgresql://192.168.1.1/cucumbers user \ncucumbereater/blackjack\";\n exec sql connect :sharetrader;\n\nDoes someone have code that works?\n\nIf you wish to email me, remove the cucumber component above;-)\n",
"msg_date": "Thu, 07 Jun 2001 15:04:51 +0800",
"msg_from": "\"J\" <summer@cucumber.os2.ami.com.au>",
"msg_from_op": true,
"msg_subject": "Using imbedded SQL, how do I connect tp Postgresql on a remote host?"
}
] |
[
{
"msg_contents": "\n> > Yes, column = NULL should *never* return true according to the spec (it\n> > should always return NULL in fact as stated). The reason for breaking\n> > with the spec is AFAIK to work with broken microsoft clients that seem to\n> > think that =NULL is a meaningful test and generate queries using that.\n> \n> Microsoft Access is the guilty party, IIRC. I recently tried to stir up\n> some interest in changing this behavior back to the standard, but\n> apparently there are still too many people using broken versions of\n> Access.\n\nActually I am not sure whether the column = NULL syntax is even defined \nor allowed in SQL92 (e.g. Informix interprets the NULL as column name in \nthis context and errs out).\nIf not it would simply be an extension to the standard with the defined\nbehavior of beeing identical to \"column is null\".\n\nAndreas\n",
"msg_date": "Thu, 7 Jun 2001 10:08:55 +0200 ",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand\n\tards"
},
{
"msg_contents": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:\n\n> Actually I am not sure whether the column = NULL syntax is even defined \n> or allowed in SQL92 (e.g. Informix interprets the NULL as column name in \n> this context and errs out).\n\nI don't have the standard handy, but I do have Joe Celko's book, \"Data\n& Databases: Concepts in Practice\". He says (in section 8.2, under\nthe heading \"Multivalued Logic\"):\n\n A NULL cannot be compared to another NULL or to a value\n with what Dr. Codd called a theta operator and what\n programmers call a comparison operator (equal, not equal,\n less than, greater than, and so forth). This results in\n a three-valued logic, which has an UNKNOWN in addition\n to TRUE and FALSE. [...] UNKNOWN is a logical value and\n not the same as a NULL, which is a data value. That is\n why you have to say X IS [NOT] NULL in SQL and not use\n X = NULL instead. Theta operators are expressions of the\n form X <comp op> Y; when X or Y or both are NULL, theta\n operators will return an UNKNOWN and not a NULL.\n\nHe goes on to explain three-valued logic in more detail, showing truth\ntables according to Jan Lukasiewicz (the inventor of RPN), and says,\nof SQL-92, that it \"is comforting to see that [it has] the same truth\ntables as the three-valued system of Lukasiewicz\". Further, he says:\n\n SQL-92 added a new predicate of the form\n\n <search condition> IS [NOT] TRUE | FALSE | UNKNOWN\n\n which will let you map any combination of three-valued\n logic to the two Boolean values.\n\nA quick test run with psql shows that PostgreSQL does not properly\nimplement three-valued logic: it does not recognize the UNKNOWN\nkeyword alongside TRUE and FALSE, in any situation. It will also\nreturn boolean truth values for comparisons with NULL values, using\nthem as \"real\" data values in the comparison. Worse (IMHO), this is\nnot consistent: while a test for \"column = NULL\" will return rows\nwhere that is true, and a test for \"not column = NULL\" will return the\nrest, \"column <> NULL\" returns no rows! This means that the theta\noperators are not all treated the same way, which is surely wrong!\n\nIt seems to me that the idea of NULL as an unkown data value and\nUNKNOWN as the corresponding truth value, combined with the rules for\npropagation of NULL in mathematical operations, of UNKNOWN in truth\noperations, and from NULL to UNKNOWN by theta operators, is a very\nclean, intuitive way of handling these issues. It feels right! :-)\n\n-tih\n-- \nThe basic difference is this: hackers build things, crackers break them.\n",
"msg_date": "07 Jun 2001 12:30:20 +0200",
"msg_from": "Tom Ivar Helbekkmo <tih@kpnQwest.no>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards"
},
{
"msg_contents": "Zeugswetter Andreas SB writes:\n\n> Actually I am not sure whether the column = NULL syntax is even defined\n> or allowed in SQL92\n\nI think you're right.\n\n> (e.g. Informix interprets the NULL as column name in this context and\n> errs out).\n\nNULL is a reserved word, so this would be wrong.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Thu, 7 Jun 2001 16:34:33 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs.\n Stand ards"
},
{
"msg_contents": "On 7 Jun 2001, Tom Ivar Helbekkmo wrote:\n\n> Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:\n> \n> > Actually I am not sure whether the column = NULL syntax is even defined \n> > or allowed in SQL92 (e.g. Informix interprets the NULL as column name in \n> > this context and errs out).\n> \n> He goes on to explain three-valued logic in more detail, showing truth\n> tables according to Jan Lukasiewicz (the inventor of RPN), and says,\n> of SQL-92, that it \"is comforting to see that [it has] the same truth\n> tables as the three-valued system of Lukasiewicz\". Further, he says:\n> \n> SQL-92 added a new predicate of the form\n> \n> <search condition> IS [NOT] TRUE | FALSE | UNKNOWN\n> \n> which will let you map any combination of three-valued\n> logic to the two Boolean values.\n> \n> A quick test run with psql shows that PostgreSQL does not properly\n> implement three-valued logic: it does not recognize the UNKNOWN\n> keyword alongside TRUE and FALSE, in any situation. It will also\n> return boolean truth values for comparisons with NULL values, using\n> them as \"real\" data values in the comparison. Worse (IMHO), this is\n> not consistent: while a test for \"column = NULL\" will return rows\n> where that is true, and a test for \"not column = NULL\" will return the\n> rest, \"column <> NULL\" returns no rows! This means that the theta\n> operators are not all treated the same way, which is surely wrong!\n\nThat's the nature of the hack we're talking about. It's a grammar level\nhack to turn a specific sequence of tokens (= NULL) into IS NULL due\nto a client's generated queries. If you're comparing something other\nthan the constant NULL, it should do what is expected (ie, a comparison\nbetween a NULL in a table or even CAST(NULL as INT4) does the \"right\"\nthing).\n\nI think adding IS UNKNOWN would probably be trivial (I think the code is\nbasically there in IS NULL.)\n\n\n",
"msg_date": "Thu, 7 Jun 2001 09:35:06 -0700 (PDT)",
"msg_from": "Stephan Szabo <sszabo@megazone23.bigpanda.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs.\n Stand ards"
},
{
"msg_contents": "Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:\n\n> That's the nature of the hack we're talking about. It's a grammar\n> level hack to turn a specific sequence of tokens (= NULL) into IS\n> NULL due to a client's generated queries.\n\nAha! Sorry -- I jumped in late in the discussion without checking\nback to see how it started...\n\nOK, I've already said that I like the cleanliness and orthogonality of\nNULL is a missing data value, UNKNOWN is a missing truth value, both\npropagate in expressions, comparisons with NULL generate UNKNOWN, and\nyou can use the special comparisons IS [NOT] NULL and IS [NOT] UNKNOWN\nto get plain, two-valued Boolean truth values out of them.\n\nThe Microsoft compatibility hack is ugly, and should be either a)\nremoved, b) expanded to include the other comparison operators and\ndocumented as a PostgreSQL proprietary extension, or c) made into a\nspecial feature that's turned on at will by a SET command. I would\napplaud a), approve of c), and be dismayed by b).\n\n> I think adding IS UNKNOWN would probably be trivial (I think the\n> code is basically there in IS NULL.)\n\nBut if it's implemented, shouldn't the code also differentiate between\nUNKNOWN and NULL, by not (as now) using the latter to represent the\nformer? Or do I misunderstand how it's handled now?\n\n-tih\n-- \nThe basic difference is this: hackers build things, crackers break them.\n",
"msg_date": "07 Jun 2001 21:37:50 +0200",
"msg_from": "Tom Ivar Helbekkmo <tih@kpnQwest.no>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards"
},
{
"msg_contents": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:\n\n> Actually I am not sure whether the column = NULL syntax is even\n> defined or allowed in SQL92\n\nI've just checked, by reading the relevant paragraphs and studying the\nBNF, and the standard says that any comparison of the form X <comp op>\nY is unknown if X or Y (or both) is NULL, including the case where\nNULL is given as an explicit constant. So, SQL92 clearly demands that\n\"column = NULL\" is UNKNOWN, never TRUE or FALSE.\n\n-tih\n-- \nThe basic difference is this: hackers build things, crackers break them.\n",
"msg_date": "07 Jun 2001 22:28:16 +0200",
"msg_from": "Tom Ivar Helbekkmo <tih@kpnQwest.no>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards"
},
{
"msg_contents": "On 7 Jun 2001, Tom Ivar Helbekkmo wrote:\n\n> Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:\n> \n> > That's the nature of the hack we're talking about. It's a grammar\n> > level hack to turn a specific sequence of tokens (= NULL) into IS\n> > NULL due to a client's generated queries.\n> \n> Aha! Sorry -- I jumped in late in the discussion without checking\n> back to see how it started...\n> \n> OK, I've already said that I like the cleanliness and orthogonality of\n> NULL is a missing data value, UNKNOWN is a missing truth value, both\n> propagate in expressions, comparisons with NULL generate UNKNOWN, and\n> you can use the special comparisons IS [NOT] NULL and IS [NOT] UNKNOWN\n> to get plain, two-valued Boolean truth values out of them.\n>\n> The Microsoft compatibility hack is ugly, and should be either a)\n> removed, b) expanded to include the other comparison operators and\n> documented as a PostgreSQL proprietary extension, or c) made into a\n> special feature that's turned on at will by a SET command. I would\n> applaud a), approve of c), and be dismayed by b).\n\nc is the most likely thing to happen probably.\n\n> > I think adding IS UNKNOWN would probably be trivial (I think the\n> > code is basically there in IS NULL.)\n> \n> But if it's implemented, shouldn't the code also differentiate between\n> UNKNOWN and NULL, by not (as now) using the latter to represent the\n> former? Or do I misunderstand how it's handled now?\n\nWithin what's there (using null as unknown), the two tests are nearly\nidentical and would probably be just a grammar change. Creating a\nseparate unknown would be more difficult, and I'm not sure it's necessary\nto make the distinction. NULL is an unknown value, I'm not sure that\nyou'd need a separate unknown value specifically for booleans.\n\n",
"msg_date": "Thu, 7 Jun 2001 14:20:31 -0700 (PDT)",
"msg_from": "Stephan Szabo <sszabo@megazone23.bigpanda.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs.\n Stand ards"
},
{
"msg_contents": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:\n> Actually I am not sure whether the column = NULL syntax is even defined \n> or allowed in SQL92 (e.g. Informix interprets the NULL as column name in \n> this context and errs out).\n\nStrictly speaking, SQL92 would require you to write\n\tfoo = CAST (NULL AS type-of-foo)\nHowever, we allow unadorned NULL in other contexts as a shorthand for\nthe CAST notation, so it's inconsistent of us to say that in this\ncontext it means something different.\n\nThe real problem with accepting this Microsoftism is that it's a trap\nfor unwary programmers. Case 1: someone who's not studied SQL in detail\nmight experiment with examples involving \"foo = NULL\" and jump to\nreasonable but entirely incorrect conclusions about how comparisons\ninvolving NULL operate. Case 2: someone who *has* studied SQL, and is\nalso aware that we accept unadorned NULLs, will also draw the wrong\nconclusions about what this construct will do. Bottom line: this kluge\nsurprises everyone except those who already know it exists. I don't\nlike systems that surprise their users in inconsistent ways.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 10:17:05 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "Tom Ivar Helbekkmo <tih@kpnQwest.no> quotes:\n> ... This results in\n> a three-valued logic, which has an UNKNOWN in addition\n> to TRUE and FALSE. [...] UNKNOWN is a logical value and\n> not the same as a NULL, which is a data value.\n\nSQL92 is not very clear about whether NULL and UNKNOWN are distinct,\nbut it is worth noticing that their truth tables for comparison\noperators, and/or/not, etc, only mention unknown --- never null ---\nas a possible value of a boolean condition. SQL99 clarifies the\nintent:\n\n The data type boolean comprises the distinct truth values true and\n false. Unless prohibited by a NOT NULL constraint, the boolean\n data type also supports the unknown truth value as the null value.\n This specification does not make a distinction between the null\n value of the boolean data type and the unknown truth value that is\n the result of an SQL <predicate>, <search condition>, or <boolean\n value expression>; they may be used interchangeably to mean exactly\n the same thing.\n\nWhich in fact is what Postgres does.\n\n> A quick test run with psql shows that PostgreSQL does not properly\n> implement three-valued logic: it does not recognize the UNKNOWN\n> keyword alongside TRUE and FALSE, in any situation.\n\nWe do not currently have correct implementations of IS TRUE, IS FALSE,\nor IS UNKNOWN (IS TRUE/FALSE are in there but give the wrong result\nfor null inputs). This is on my to-do list to fix; not sure if the\nmaster TODO list mentions it or not. Actually it'd be a good project\nfor a newbie hacker who wants to learn about the backend's\nexpression-handling machinery. Anyone want to take it on?\n\nIt's also worth noticing that our implementation of IS NULL isn't really\nup to speed: the spec allows the argument to be a row value constructor,\nnot just a scalar. But we mostly don't have support for row-value-\nconstructor expressions anyway (it's not an Entry SQL feature).\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 10:34:22 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "> We do not currently have correct implementations of IS TRUE, IS FALSE,\n> or IS UNKNOWN (IS TRUE/FALSE are in there but give the wrong result\n> for null inputs). This is on my to-do list to fix; not sure if the\n> master TODO list mentions it or not. Actually it'd be a good project\n> for a newbie hacker who wants to learn about the backend's\n> expression-handling machinery. Anyone want to take it on?\n>\n\nI'd like to finish up the has_table_privilege function over the next week or\nso and then take this on. Can you point me in a direction to start looking?\n\nThanks,\n\nJoe\n\n\n",
"msg_date": "Fri, 8 Jun 2001 08:01:49 -0700",
"msg_from": "\"Joe Conway\" <joe@conway-family.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "> The real problem with accepting this Microsoftism is that it's a trap\n> for unwary programmers. Case 1: someone who's not studied SQL in detail\n> might experiment with examples involving \"foo = NULL\" and jump to\n> reasonable but entirely incorrect conclusions about how comparisons\n> involving NULL operate. Case 2: someone who *has* studied SQL, and is\n> also aware that we accept unadorned NULLs, will also draw the wrong\n> conclusions about what this construct will do. Bottom line: this kluge\n> surprises everyone except those who already know it exists. I don't\n> like systems that surprise their users in inconsistent ways.\n\nThese were all points that were brought up and discussed when the hack\nwas implemented. At the time, the trade between implementing a construct\nwhich is *not allowed* in SQL9x vs enabling the M$Access community to\nmigrate to PostgreSQL was hashed over and a consensus was reached that\nthe benefits to allowing it outweighed the drawbacks.\n\nI was of the initial opinion that we should not support M$ pathelogical\nnon-standard constructs (jeez, they should know better, and probably do,\nso it is likely a pathetic attempt to lock in users). But since the\nconstruct is not allowed (or useless), why would anyone feel they need\nto use it?\n\nClearly it is not the case that \"this kluge surprises everyone except\nthose who already know it exists.\" We have had a strong consensus that\nSQL9x standard constructs should be the norm for PostgreSQL, so no need\nto rehash that. The issue boils down to, as it did when it first came\nup, whether we will make it easier for M$Access users to start migrating\nto PostgreSQL. If newer versions of Access emit standard constructs,\nthen it would be even easier to say that we should jettison the\nconstruct. But if not, istm that we are killing a usability feature on\nprinciple, not from need, and it may be premature to do that.\n\nUsing a \"SET xxx\" switch is not a step in the right direction istm since\nit requires an extra PostgreSQL-specific command to get things working\nwith Access. We aren't teaching SQL, we are trying to let people get to\ntheir data.\n\nbtw, I *was* suprised to see the \"IS UNKNOWN\" construct. It's been\nlurking in my reference books for years. afaict it is very uncommonly\nused, since most RDBMSes accept IS NULL as an equivalent. But is is\ntrivial to add to the grammar.\n\n - Thomas\n",
"msg_date": "Fri, 08 Jun 2001 15:10:18 +0000",
"msg_from": "Thomas Lockhart <lockhart@fourpalms.org>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards"
},
{
"msg_contents": "\"Joe Conway\" <joe@conway-family.com> writes:\n>> We do not currently have correct implementations of IS TRUE, IS FALSE,\n>> or IS UNKNOWN (IS TRUE/FALSE are in there but give the wrong result\n>> for null inputs). This is on my to-do list to fix; not sure if the\n>> master TODO list mentions it or not. Actually it'd be a good project\n>> for a newbie hacker who wants to learn about the backend's\n>> expression-handling machinery. Anyone want to take it on?\n\n> I'd like to finish up the has_table_privilege function over the next week or\n> so and then take this on. Can you point me in a direction to start looking?\n\nThe way things currently work is that gram.y translates \"x IS TRUE\" etc\nto \"x = true\" etc. This is wrong because it does the wrong thing for\nnull input. Another objection is that it's impossible for ruleutils.c\nto reverse-list the expression tree in its original form.\n\nIS [NOT] NULL is handled a little differently: gram.y generates a\nspecialized Expr node, which parse_expr.c translates to a function call\non the specialized functions nullvalue() and nonnullvalue()\nrespectively. I don't much care for this implementation either, again\npartly because ruleutils.c has to be uglified to deal with it, but\npartly because the optimizer can't cheaply recognize IS NULL tests\neither.\n\nI'd like to see all eight of these guys translated into a specialized\nkind of expression node, called perhaps BooleanTest. Actually, it'd\nprobably be wise to keep IS NULL separate from the six boolean tests,\nwith an eye to the future when it will need to support nonscalar\narguments. So maybe BooleanTest and NullTest node types, each with a\nfield showing exactly which test is wanted.\n\nAdding a new expression node type is a straightforward but rather\ntedious exercise in teaching some dozens of places what to do with it.\nA grep for existing expression node types, such as CaseExpr or\nFieldSelect or RelabelType, will give you a good idea what needs to be\ndone.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 11:25:45 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "> The way things currently work is that gram.y translates \"x IS TRUE\" etc\n> to \"x = true\" etc. This is wrong because it does the wrong thing for\n> null input. Another objection is that it's impossible for ruleutils.c\n> to reverse-list the expression tree in its original form.\n\nfyi, in case it helps: we used to have gram.y translate these into\nfunction calls, rather than the operator expression. But that precluded\nthe optimizer from ever having a shot at optimizing out \"const = const\"\nkinds of expressions and other fluff.\n\nIf we go to a specialized node in the parse tree, then the optimizer\ncould be taught to handle that, which is better than the original\nstraight function call which would have masked things too much.\n\n - Thomas\n",
"msg_date": "Fri, 08 Jun 2001 16:27:37 +0000",
"msg_from": "Thomas Lockhart <lockhart@fourpalms.org>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards"
},
{
"msg_contents": "Thomas Lockhart <lockhart@fourpalms.org> writes:\n\n> But since the construct is not allowed (or useless), why would\n> anyone feel they need to use it?\n\nBecause it isn't entirely useless, actually. I agree that no\nprogrammer in his right mind would write, by hand, a comparison\ninvolving NULL, knowing that the truth value of that comparison is\nrequired by the standard to be UNKNOWN (i.e. NULL). However, I'm\nlooking at using machine generated SQL code (generated on the fly in\nan interactive application) to implement a dynamically adapting set of\ntables, rules/triggers and their supporting stored procedures, and\nit's just a matter of time before the first \"= NULL\" happens to show\nup in code generated like that. I'd like it to behave according to\nthe standard when that situation occurs, and the standard says that\nany comparison with NULL, even \"NULL = NULL\", is UNKNOWN.\n\n-tih\n-- \nThe basic difference is this: hackers build things, crackers break them.\n",
"msg_date": "08 Jun 2001 23:06:52 +0200",
"msg_from": "Tom Ivar Helbekkmo <tih@kpnQwest.no>",
"msg_from_op": false,
"msg_subject": "Re: Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards"
},
{
"msg_contents": "Thomas Lockhart <lockhart@fourpalms.org> writes:\n> Clearly it is not the case that \"this kluge surprises everyone except\n> those who already know it exists.\"\n\nHow can you argue that, when the topic comes up again every couple of\nmonths?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 18:14:54 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "> > Clearly it is not the case that \"this kluge surprises everyone except\n> > those who already know it exists.\"\n> How can you argue that, when the topic comes up again every couple of\n> months?\n\nI'm not looking for an argument. But the statement is not factually\ntrue: \"suprises everyone\" (most folks don't notice, and don't care much)\nand \"every couple of months\" (??) stray far enough from facts that we\nshould get back on topic. Whatever the facts, the messages that we do\n*not* get are just as significant: a relatively large portion of\nfeedback from users of both Access and PostgreSQL at the time the\n\"feature\" was added indicated that it was a significant stumbling block\nfor those users, and those messages will start up anew without adequate\nplanning and implementation.\n\nSince back then, we have some additional clarification that it occurs\nonly for users of Access/Forms, and that others are worried that it will\nlead to difficulties for others under different circumstances (please\nremember, or note if it is too long ago, that at the time I argued\nagainst adding the \"feature\", but tried to listen to those who would\nfind it useful). I'm not ignoring those worries, but in the battle\nbetween purity and usefulness we shouldn't always line up with the\nstrongest or loudest voice(s) that day, but try to respect and keep in\nmind the others who have contributed to the discussion in the past.\n\nThat said, the issues should be broken down into managable chunks, but\nimho forcing the last step (removal of the \"= NULL\" accomodation) first\nis premature. How about phasing this so that we can accomodate the\nlong-standing issue of M$ interoperability (via ODBC improvements to\nmake it transparent) before ripping out the current workaround?\n\n From Andreas' comments, it seems that for his application he would like\na different behavior, but frankly I'm not certain why the current\nbehavior would be detrimental in the use case he mentioned. If SQL92\nrequires that any query with \"= NULL\" be rejected as illegal (my books\naren't nearby at the moment), he might still want to have code at the\napplication level for some graceful handling of illegal values.\n\n - Thomas\n",
"msg_date": "Sat, 09 Jun 2001 02:26:59 +0000",
"msg_from": "Thomas Lockhart <lockhart@alumni.caltech.edu>",
"msg_from_op": false,
"msg_subject": "Re: Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards"
},
{
"msg_contents": "> IS [NOT] NULL is handled a little differently: gram.y generates a\n> specialized Expr node, which parse_expr.c translates to a function call\n> on the specialized functions nullvalue() and nonnullvalue()\n> respectively. I don't much care for this implementation either, again\n> partly because ruleutils.c has to be uglified to deal with it, but\n> partly because the optimizer can't cheaply recognize IS NULL tests\n> either.\n>\n> I'd like to see all eight of these guys translated into a specialized\n> kind of expression node, called perhaps BooleanTest. Actually, it'd\n> probably be wise to keep IS NULL separate from the six boolean tests,\n> with an eye to the future when it will need to support nonscalar\n> arguments. So maybe BooleanTest and NullTest node types, each with a\n> field showing exactly which test is wanted.\n>\n\nAttached is a patch for a new NullTest node type for review and comment.\nSince it didn't seem like there was consensus regarding removal of the \"a =\nnull\" conversion to \"a is null\" behavior, I left it in. It is worth\nmentioning, however, that neither Oracle 8.1.6 or MSSQL 7 seem to support\nthis -- see below:\n\nOracle:\n****************************************\nSQL> select f1,f2 from foo where f2 = null;\n\nno rows selected\n\nMSSQL 7\n****************************************\nselect f1,f2 from foo where f2 = null\nf1 f2\n----------- --------------------------------------------------\n\n(0 row(s) affected)\n\nPostgreSQL\n****************************************\ntest=# select f1,f2 from foo where f2 = null;\n f1 | f2\n----+----\n 1 |\n 4 |\n(2 rows)\n\nIn all 3 cases table foo has 4 rows, 2 of which have null values for f2.\nBased on this, should support for the converting \"a = null\" to \"a is null\"\nbe dropped?\n\nI also noticed that in PostgreSQL I can do the following (both before and\nafter this patch):\n select f2 is null from foo;\nwhereas in both Oracle and MSSQL it causes a syntax error. Any thoughts on\nthis?\n\nThanks,\n\n-- Joe",
"msg_date": "Mon, 18 Jun 2001 11:04:49 -0700",
"msg_from": "\"Joe Conway\" <joseph.conway@home.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "\"Joe Conway\" <joseph.conway@home.com> writes:\n> Attached is a patch for a new NullTest node type for review and comment.\n\nI assume you are just looking for review at this point; I would not\nrecommend applying to CVS until the BooleanTest part is done too.\n(Since parsetree changes affect stored rules, the change really should\ninclude a catversion.h increment, and thus it's best to bunch this sort\nof change together to avoid forcing extra initdbs on other hackers.)\nI'll look through the code later, but...\n\n> Based on this, should support for the converting \"a = null\" to \"a is null\"\n> be dropped?\n\nMy opinion on that is already on record ;-)\n\n> I also noticed that in PostgreSQL I can do the following (both before and\n> after this patch):\n> select f2 is null from foo;\n> whereas in both Oracle and MSSQL it causes a syntax error. Any thoughts on\n> this?\n\nCurious; I'd have said that that is clearly within the spec. Can anyone\ncheck it on some other engines?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 18 Jun 2001 14:33:21 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "> I assume you are just looking for review at this point; I would not\n> recommend applying to CVS until the BooleanTest part is done too.\n> (Since parsetree changes affect stored rules, the change really should\n> include a catversion.h increment, and thus it's best to bunch this sort\n> of change together to avoid forcing extra initdbs on other hackers.)\n> I'll look through the code later, but...\n\nOK -- I'll get started on BooleanTest in the next day or two.\n\n-- Joe\n\n",
"msg_date": "Mon, 18 Jun 2001 13:06:40 -0700",
"msg_from": "\"Joe Conway\" <joseph.conway@home.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "\"Joe Conway\" <joseph.conway@home.com> writes:\n> I also noticed that in PostgreSQL I can do the following (both before and\n> after this patch):\n> select f2 is null from foo;\n> whereas in both Oracle and MSSQL it causes a syntax error. Any thoughts on\n> this?\n\nI dug into this further and discovered that indeed it is not SQL92\n... but it is SQL99. Amazingly enough, SQL92 doesn't allow boolean\nexpressions as a possible type of general expression:\n\n <value expression> ::=\n <numeric value expression>\n | <string value expression>\n | <datetime value expression>\n | <interval value expression>\n\nIt only allows them as <search condition>s, which is to say WHERE,\nHAVING, CASE WHEN, CHECK, and one or two other places.\n\nBut SQL99 gets it right:\n\n <value expression> ::=\n <numeric value expression>\n | <string value expression>\n | <datetime value expression>\n | <interval value expression>\n | <boolean value expression>\n | <user-defined type value expression>\n | <row value expression>\n | <reference value expression>\n | <collection value expression>\n\nLooks like we're ahead of the curve here...\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 18 Jun 2001 16:26:09 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "> > I assume you are just looking for review at this point; I would not\n> > recommend applying to CVS until the BooleanTest part is done too.\n> > (Since parsetree changes affect stored rules, the change really should\n> > include a catversion.h increment, and thus it's best to bunch this sort\n> > of change together to avoid forcing extra initdbs on other hackers.)\n> > I'll look through the code later, but...\n>\n\nOK -- here's the full patch for review. It includes two new expression node\ntypes: NullTest and BooleanTest. I have a couple of questions/comments\nremaining WRT this:\n\n-- Should I increment catversion.h as part of the patch (I didn't in this\npatch), or is that usually centrally controlled by Bruce (or whomever\ncommits the change)?\n\n-- IMHO, if we are going to keep the (a = null) to (a is null) conversion,\nthen there should also be a similar conversion from (a != null) to (a is not\nnull). Otherwise the two operations which may be expected to be\ncomplimentary (as evidenced by at least one recent post) are not.\n\n-- If I have interpreted SQL92 correctly UNKNOWN IS TRUE should return\nFALSE, and UNKNOWN IS NOT TRUE is equivalent to NOT (UNKNOWN IS TRUE) ==>\nTRUE. Is this correct?\n\nThanks,\n\n-- Joe",
"msg_date": "Mon, 18 Jun 2001 23:21:38 -0700",
"msg_from": "\"Joe Conway\" <joseph.conway@home.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "\"Joe Conway\" <joseph.conway@home.com> writes:\n> -- Should I increment catversion.h as part of the patch (I didn't in this\n> patch), or is that usually centrally controlled by Bruce (or whomever\n> commits the change)?\n\nIt's good to put the catversion bump into the patch, else the committer\nmight forget to do it.\n\n> -- IMHO, if we are going to keep the (a = null) to (a is null) conversion,\n> then there should also be a similar conversion from (a != null) to (a is not\n> null). Otherwise the two operations which may be expected to be\n> complimentary (as evidenced by at least one recent post) are not.\n\nI'd resist this. The only reason the =NULL hack is in there at all is\nto support Access97. We shouldn't extend the deviation from standards\nfurther than the minimum needed to do that. The hack is fundamentally\ninconsistent anyway, and breaking our standards compliance further in\npursuit of bogus consistency seems misguided.\n\nPersonally I'd rather take out the =NULL conversion anyway...\n\n> -- If I have interpreted SQL92 correctly UNKNOWN IS TRUE should return\n> FALSE, and UNKNOWN IS NOT TRUE is equivalent to NOT (UNKNOWN IS TRUE) ==>\n> TRUE. Is this correct?\n\nYes. Table 15 is pretty illegible in the ASCII draft copies of SQL92\nand SQL99, but the PDF version of SQL99 is okay, and it makes clear\nwhat you'd expect:\n\n\tinput\t\tIS TRUE\t\tIS FALSE\tIS UNKNOWN\n\n\ttrue\t\ttrue\t\tfalse\t\tfalse\n\tfalse\t\tfalse\t\ttrue\t\tfalse\n\tunknown\t\tfalse\t\tfalse\t\ttrue\n\nand then the NOT variants are defined as\n\n\tx IS NOT foo\t==\tNOT (x IS foo)\n\n\nI'll try to look over and commit the patch later today.\n\nFor extra credit ;-) ... if you'd like to learn a little bit about the\noptimizer, think about teaching clause_selectivity() in\noptimizer/path/clausesel.c how to estimate the selectivity of these new\nexpression nodes. In the case where the argument is a boolean column\nthat we have statistics for, it should be possible to derive the correct\nanswer (including accounting for NULLs). If the argument is more\ncomplex than that, you probably can't do anything really intelligent,\nbut you could handwave away NULLs and then compute the appropriate\nfunction of the clause_selectivity() of the argument.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 19 Jun 2001 11:40:57 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "> > -- Should I increment catversion.h as part of the patch (I didn't in\nthis\n> > patch), or is that usually centrally controlled by Bruce (or whomever\n> > commits the change)?\n>\n> It's good to put the catversion bump into the patch, else the committer\n> might forget to do it.\n>\n OK -- will do next time.\n\n> further than the minimum needed to do that. The hack is fundamentally\n> inconsistent anyway, and breaking our standards compliance further in\n> pursuit of bogus consistency seems misguided.\n>\n> Personally I'd rather take out the =NULL conversion anyway...\n\nI'd second that.\n\n\n> Yes. Table 15 is pretty illegible in the ASCII draft copies of SQL92\n> and SQL99, but the PDF version of SQL99 is okay, and it makes clear\n> what you'd expect:\n>\n\nOT -- I need to buy a copy of SQL99, but it seems to be split into several\nparts (that didn't exist for SQL92). Which one (or more) are the most useful\nfor PostgreSQL hacking?\n\n\n> For extra credit ;-) ... if you'd like to learn a little bit about the\n> optimizer, think about teaching clause_selectivity() in\n> optimizer/path/clausesel.c how to estimate the selectivity of these new\n> expression nodes. In the case where the argument is a boolean column\n> that we have statistics for, it should be possible to derive the correct\n> answer (including accounting for NULLs). If the argument is more\n> complex than that, you probably can't do anything really intelligent,\n> but you could handwave away NULLs and then compute the appropriate\n> function of the clause_selectivity() of the argument.\n\nSure, I love a challenge ;) -- I'll take a look.\n\nOne issue I noticed this morning with this patch is that 't' and 'f' are no\nlonger being implicitly cast into boolean, i.e. test=# select 't' is true;\n ?column?\n----------\n f\n(1 row)\n\ntest=# select 't'::bool is true;\n ?column?\n----------\n t\n(1 row)\n\nAny thoughts on where look to fix this?\n\nThanks,\n\n-- Joe\n\n\n",
"msg_date": "Tue, 19 Jun 2001 09:07:07 -0700",
"msg_from": "\"Joe Conway\" <joseph.conway@home.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "\"Joe Conway\" <joseph.conway@home.com> writes:\n> OT -- I need to buy a copy of SQL99, but it seems to be split into several\n> parts (that didn't exist for SQL92). Which one (or more) are the most useful\n> for PostgreSQL hacking?\n\nI find that Part 2 is almost the only one I ever look at. I'm not even\nsure what's in the other parts ...\n\n> One issue I noticed this morning with this patch is that 't' and 'f' are no\n> longer being implicitly cast into boolean, i.e. test=# select 't' is true;\n> ?column?\n> ----------\n> f\n> (1 row)\n\nNow that you mention it, it looks like all of our constructs that expect\nboolean fail to coerce unknown-type literals into bools. The rest of\nthem raise errors, eg:\n\n\tregression=# select not 't';\n\tERROR: argument to NOT is type 'unknown', not 'bool'\n\nbut this is pretty bogus. ISTM all these places should try to coerce\ntheir inputs to bool before they complain. This involves calling\ncan_coerce_type and then coerce_type; it's tedious enough that it'd be\nworth setting up a subroutine to do it. I'll add something for that,\nand fix the other places too.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 19 Jun 2001 14:58:05 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "> For extra credit ;-) ... if you'd like to learn a little bit about the\n> optimizer, think about teaching clause_selectivity() in\n> optimizer/path/clausesel.c how to estimate the selectivity of these new\n> expression nodes. In the case where the argument is a boolean column\n> that we have statistics for, it should be possible to derive the correct\n> answer (including accounting for NULLs). If the argument is more\n> complex than that, you probably can't do anything really intelligent,\n> but you could handwave away NULLs and then compute the appropriate\n> function of the clause_selectivity() of the argument.\n\nAttached is my initial attempt to teach clause_selectivity about BooleanTest\nnodes, for review and comment. Please let me know if I'm headed in the right\ndirection.\n\nThanks,\n\nJoe",
"msg_date": "Sat, 23 Jun 2001 12:11:37 -0700",
"msg_from": "\"Joe Conway\" <joseph.conway@home.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "\"Joe Conway\" <joseph.conway@home.com> writes:\n> Attached is my initial attempt to teach clause_selectivity about BooleanTest\n> nodes, for review and comment. Please let me know if I'm headed in the right\n> direction.\n\nLooks like you're headed the right way. A few comments ---\n\n1. Don't forget to add a routine for NullTest nodes, too. These can be\nsimpler, since you know that all you care about is the stanullfrac; no\nneed to look at common values.\n\n2. I don't see any real good reason to force booltestsel() (likewise\nnulltestsel(), when you add it) to have the same call signature as the\nvarious operator selectivity routines. Those have to be looked up in a\ntable and called via fmgr, but there's no reason to think that\nbooltestsel will ever be called in the same way. We could certainly\nlose the useless \"operator\" argument. I'd be inclined to declare\nbooltestsel as\n\n\tSelectivity booltestsel(Query *root,\n\t BooleanTest *clause,\n\t int varRelid);\n\nand skip *all* the fmgr notational cruft. The only trouble with this is\nwe'd not want to put such a declaration into builtins.h, because it'd\nforce including a bunch more .h files into builtins.h, which is ugly\nand might even cause some circularity problems. There are already some\nselectivity-related things in builtins.h that don't really belong there.\nI am starting to think that selfuncs.c deserves its own header file\nseparate from builtins.h, so that it doesn't clutter builtins.h with a\nbunch of selectivity-specific stuff. (Comments anyone?)\n\n3. You should be using tests like \"if (DatumGetBool(values[i]))\" or\n\"if (!DatumGetBool(values[i]))\" to examine the MCV-list values, not\n\"if (values[i] == true)\". The latter is a type cheat: it assumes that\nDatum can be implicitly converted to bool, which is only sort-of true at\nthe moment and might be not-at-all-true in the future. You could write\n\"if (DatumGetBool(values[i]) == true)\" and satisfy the strict-typing\npart of this concern, but there's also a more stylistic thing here.\nPersonally I find \"if (boolean == true)\" or \"if (boolean == false)\"\nto be poor style, it should be just \"if (boolean)\" or \"if (!boolean)\".\nThis gets back to whether you consider boolean to be a logically\ndistinct type from int, I suppose. Feel free to ignore that part\nif you strongly disagree.\n\n4. I don't think that DEFAULT_EQ_SEL is an appropriate default result\nfor this routine. Arguably, it should elog(ERROR) if not passed a\nBooleanTest node, so the first one or two occurrences are nonissues\nanyway. However, if you find a non-Var argument or a Var that you\ncan't get statistics for, you do need to return some sort of reasonable\ndefault, and that I think is not the best. In any case the default should\ntake the test type into account. For IS_NULL and IS_UNKNOWN, I'd think\nthe default assumption should be small but not zero (0.01 maybe? Any\nthoughts out there?). IS_NOT_NULL/UNKNOWN should obviously yield one\nminus whatever we use for IS_NULL. It seems reasonable to use 0.5\nas default for IS_TRUE and the other three BooleanTests.\n\n5. Actually, for IS_TRUE and the other three BooleanTests, what you\nshould probably do with a non-Var input is ignore the possibility of a\nNULL value and just try to estimate the probability of TRUE vs FALSE,\nwhich you can do by recursing back to clause_selectivity() on the\nargument (note this would be invalid for NullTest where the argument\nisn't necessarily boolean, but it's legit for BooleanTests). Then\nyou use either that result or one minus that result, depending on\nwhich BooleanTest you're dealing with.\n\n6. The way you are working with the MCV values seems unnecessarily\ncomplicated. I had a hard time seeing whether it was generating the\nright answer (actually, it demonstrably isn't, since for example you\nproduce the same result for IS_TRUE and IS_NOT_FALSE, which ought to\ndiffer by the stanullfrac amount; but it's too complex anyway).\nI'd be inclined to do this in one of two ways:\n\t1. Scan the MCV array to find the entry for \"true\", and work\n\t with its frequency and the stanullfrac frequency to derive\n\t the appropriate answer depending on the test type.\n\t2. Always use the first (most common val's) frequency. This\n\t value is either true or false, so adjust accordingly.\n\t The simplest way would be to derive true's frequency as\n\t either freq[0] or 1 - freq[0] - stanullfrac, and then\n\t proceed as in #1.\n#2 is a little more robust, since it would still work if for some reason\nthe MCV list contains only an entry for true or only an entry for false.\n(I believe that could happen, if the column contains only one value and\npossibly some nulls.)\n\n\nYou're off to an excellent start though; you seem to be finding your\nway through the code very well.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sat, 23 Jun 2001 16:58:37 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
},
{
"msg_contents": "Thanks for your thorough review and comments, Tom.\n\nHere's a new patch for review. Summary of changes/response to earlier\ncomments:\n- add a routine for NullTest nodes -- done.\n- declare selectivity functions without fmgr notation -- done.\n- create selfuncs.h for declarations -- done, but I didn't move anything\nelse out of builtins.h\n- use DatumGetBool() and adjust style -- done\n- create better default selectivities -- done:\n - DEFAULT_UNK_SEL = 0.005\n - DEFAULT_NOT_UNK_SEL = 1 - DEFAULT_UNK_SEL\n - DEFAULT_BOOL_SEL = 0.5\n- recurse clause_selectivity() for non-Var input -- done\n- simplify MCV logic -- done, used 2nd approach (always use the first most\ncommon val's frequency)\n\nQuestions:\n- I added a debug define (BOOLTESTDEBUG) to selfuncs.h, and a corresponding\nifdef/elog NOTICE to clause_selectivity(). This was to help me debug/verify\nthe calculations. Should this be left in the code when I create a patch (it\nis in this one), and if so, is there a preferred \"standard\" approach to this\ntype of debug code?\n- Using the debug code mentioned above, I noted that clause_selectivity()\ndid not seem to get called at all for clauses like \"where myfield = 0\" or\n\"where myfield > 0\". I haven't looked too closely at it yet, but I was\nwondering if this is expected behavior?\n\nThanks,\n\n-- Joe",
"msg_date": "Sat, 23 Jun 2001 23:57:07 -0700",
"msg_from": "\"Joe Conway\" <joseph.conway@home.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards "
}
] |
[
{
"msg_contents": "> What if I rename the get_seq_name function and move it to\n> backend/utils/adt/name.c (and of course change the references to it in\n> sequence.c)? Actually, now I'm wondering why nameout doesn't \n> downcase and\n> truncate.\n\nBecause identifiers can be double quoted if you feel like preserving case.\n\nselect * from \"My fuNKy Table Name\";\n\nSQL is only case insensitive when identifiers are not quoted.\n\nAndreas\n",
"msg_date": "Thu, 7 Jun 2001 10:17:08 +0200 ",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: Re: [PATCHES] Fw: Isn't pg_statistic a security hol\n\te - Solution Proposal"
}
] |
[
{
"msg_contents": "\n> \tERROR: blah blah\n> \tCODE: 12345\n> \tLOCATION: some/file.c line NNN\n\nIt might be handy to have the LOCATION in the postmaster log,\nor make it something that needs to be explicitly switched on.\nI do not think it is of general interest to users (most errors \nwill result from normal operation, and not bugs that need to be tracked).\n\nSince access to SQLSTATE will become a hot path once savepoints \nare available I think that having SQLSTATE up front would be\nmore convenient.\n\nexec sql insert into blabla values ....;\nif (strncmp(sqlca.sqlstate, \"23\", 2) == 0)\t// duplicate key value\n\texec sql update blabla set ... ;\n\nAndreas\n",
"msg_date": "Thu, 7 Jun 2001 11:40:22 +0200 ",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: Can the backend return more than one error message per PQexec? "
}
] |
[
{
"msg_contents": "\n> > Actually I am not sure whether the column = NULL syntax is even defined \n> > or allowed in SQL92 (e.g. Informix interprets the NULL as column name in \n> > this context and errs out).\n> \n> I don't have the standard handy, but I do have Joe Celko's book, \"Data\n> & Databases: Concepts in Practice\". He says (in section 8.2, under\n> the heading \"Multivalued Logic\"):\n> \n> A NULL cannot be compared to another NULL or to a value\n\nI mean that I am not sure NULL is a valid constant in a where clause \ncomparison.\nThus it could be, that NULL in \"where column = NULL\" is not defined \nto have a special meaning according to SQL92.\n\nNULL is probably only defined in a special context, like:\n\tIS NULL\n\tIS NOT NULL\n\nAndreas\n",
"msg_date": "Thu, 7 Jun 2001 13:38:46 +0200 ",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. S\n\ttand ards"
},
{
"msg_contents": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:\n\n> Thus it could be, that NULL in \"where column = NULL\" is not defined \n> to have a special meaning according to SQL92.\n\nThe way I interpret Celko's interpretation of SQL92, that specific\nconstruct has a meaning; it evaluates to UNKNOWN, thus not to TRUE,\nand the WHERE clause becomes useless, as does any other combination of\na theta operator and the explicit constant 'NULL'. This is almost,\nbut not quite, an argument for allowing \"= NULL\" for \"IS NULL\". ;-)\n\nDoes anyone out there have the actual text of the standard?\n\n-tih\n-- \nThe basic difference is this: hackers build things, crackers break them.\n",
"msg_date": "07 Jun 2001 14:46:50 +0200",
"msg_from": "Tom Ivar Helbekkmo <tih@kpnQwest.no>",
"msg_from_op": false,
"msg_subject": "Re: AW: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. S tand ards"
},
{
"msg_contents": "On Thu, Jun 07, 2001 at 02:46:50PM +0200, Tom Ivar Helbekkmo wrote:\n> Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:\n> \n> > Thus it could be, that NULL in \"where column = NULL\" is not defined \n> > to have a special meaning according to SQL92.\n> \n> The way I interpret Celko's interpretation of SQL92, that specific\n> construct has a meaning; it evaluates to UNKNOWN, thus not to TRUE,\n> and the WHERE clause becomes useless, as does any other combination of\n> a theta operator and the explicit constant 'NULL'. This is almost,\n> but not quite, an argument for allowing \"= NULL\" for \"IS NULL\". ;-)\n> \n> Does anyone out there have the actual text of the standard?\n> \n> -tih\n\nI dont know the standard for that, but to add an experience in another\nserver (Interbase), '= null' has no meaning in Interbase, ie, doesnt\nworks as 'IS NULL'.\n\nSergio Bruder\n\n-- \n ( \t\t\n )) (tm)\thttp://sergio.bruder.net\n|\"\"|-. \t\thttp://pontobr.org\n|__|-' \t\tbruder@conectiva.com.br, sergio@bruder.net\n------------------------------------------------------------------------------\npub 1024D/0C7D9F49 2000-05-26 Sergio Devojno Bruder <bruder@conectiva.com.br>\n Key fingerprint = 983F DBDF FB53 FE55 87DF 71CA 6B01 5E44 0C7D 9F49\nsub 1024g/138DF93D 2000-05-26\n",
"msg_date": "Thu, 7 Jun 2001 09:57:50 -0300",
"msg_from": "Sergio Bruder <bruder@conectiva.com.br>",
"msg_from_op": false,
"msg_subject": "Re: AW: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. S tand ards"
}
] |
[
{
"msg_contents": "I get this a lot and it keeps me from backing up the database.\n\nThis database is still 7.0.3. Anyone knows what cases it and how to correct it,\nbecause I can't dump to a new database.\n",
"msg_date": "Thu, 07 Jun 2001 08:36:48 -0400",
"msg_from": "mlw <markw@mohawksoft.com>",
"msg_from_op": true,
"msg_subject": "PQgetvalue: ERROR! tuple number 0 is out of range 0..-1"
},
{
"msg_contents": "On Thu, Jun 07, 2001 at 08:36:48AM -0400, mlw wrote:\n> I get this a lot and it keeps me from backing up the database.\n> \n> This database is still 7.0.3. Anyone knows what cases it and how to correct\n> it, because I can't dump to a new database.\n\nis this coming from one of your applications?\n\"PQgetvalue: ERROR! tuple number 0 is out of range 0..-1\"\n\nif so, the it is possible that the application is doing a select, which\nreturns 0 rows.\n\nand your application is attempting to access the value of a non-existant row.\n\n-- \n[ Jim Mercer jim@reptiles.org +1 416 410-5633 ]\n[ Now with more and longer words for your reading enjoyment. ]\n",
"msg_date": "Thu, 7 Jun 2001 08:39:47 -0400",
"msg_from": "Jim Mercer <jim@reptiles.org>",
"msg_from_op": false,
"msg_subject": "Re: PQgetvalue: ERROR! tuple number 0 is out of range 0..-1"
}
] |
[
{
"msg_contents": "\n> > Thus it could be, that NULL in \"where column = NULL\" is not defined \n> > to have a special meaning according to SQL92.\n> \n> The way I interpret Celko's interpretation of SQL92, that specific\n> construct has a meaning; it evaluates to UNKNOWN, thus not to TRUE,\n\nImho the text refers to a content of a particular column of one particular row.\n\nwhere table1.col1 = table2.col1\n\nthe content of table2.col1 is null --> comparison evaluates to UNKNOWN.\nIt does not state whether NULL is a valid constant expression.\n\nAndreas\n",
"msg_date": "Thu, 7 Jun 2001 15:21:22 +0200 ",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: AW: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL v s. S tand\n ards"
}
] |
[
{
"msg_contents": "OK, I think I found a bug related with privileges, views and rules.\n\nI have a bunch of tables, owned by martin, and some views with the related \nrules for inserts, updates and deletes, all owned by martin.\n\nI also have some other users that are in a group webunl_admin. This group is \ngranted full access (ALL) to the views I mentioned above.\n\nWhen a user from that group tries to insert data to the view he gets an error \nsaying that he can't execute nextval('carrera_id_curso_seq').\n\nNow, the manuales say that the rules are executed with the privileges of the \nowner of the view and not the user that is executing the query on the view. \nSo why isn't this working?\n\nShould I fill a bug report?\n\nSaludos.... :-)\n\nP.D.: If you need some output, feel free to ask for it.\n\n-- \nCualquiera administra un NT.\nEse es el problema, que cualquiera administre.\n-----------------------------------------------------------------\nMartin Marques | mmarques@unl.edu.ar\nProgramador, Administrador | Centro de Telematica\n Universidad Nacional\n del Litoral\n-----------------------------------------------------------------\n",
"msg_date": "Thu, 7 Jun 2001 16:56:29 +0300",
"msg_from": "=?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= <martin@bugs.unl.edu.ar>",
"msg_from_op": true,
"msg_subject": "Rules and permissions on 7.1.2 (bug)"
}
] |
[
{
"msg_contents": "\nIn process of converting a bunch of scripts from sybase to postgresql\nI see something that doesn't make much sense..\n\nI can grant a series of privileges (comma separated) on a series of\nobjects (comma separated) to either a user, group or public NOT a\ncomma separated list of users or groups. Yet at the bottom of the\nman page for grant\n\n http://www.postgresql.org/idocs/index.php?sql-grant.html\n\nit says it's allowed in SQL92. How is it this isn't allowed in\npostgresql, is it a real pain to implement or was it just never\nneeded?\n\nI'm trying to come up with a way to do this:\n\ngrant all on xydata09 to vwonly,mngmnt,remusr,supusr,dbmngr,schdlr,intusr\n\non about 500 tables on the fly. Not all of them are the same permissions\nper table but each file that creates a table has this and a couple of\nrevoke lines in it.\n\nWorkarounds?\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net\n 56K Nationwide Dialup from $16.00/mo at Pop4 Networking\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n",
"msg_date": "Thu, 7 Jun 2001 10:23:51 -0400 (EDT)",
"msg_from": "Vince Vielhaber <vev@michvhf.com>",
"msg_from_op": true,
"msg_subject": "grant and SQL92"
},
{
"msg_contents": "Vince Vielhaber writes:\n\n> I can grant a series of privileges (comma separated) on a series of\n> objects (comma separated) to either a user, group or public NOT a\n> comma separated list of users or groups. Yet at the bottom of the\n> man page for grant\n>\n> http://www.postgresql.org/idocs/index.php?sql-grant.html\n>\n> it says it's allowed in SQL92. How is it this isn't allowed in\n> postgresql, is it a real pain to implement or was it just never\n> needed?\n\nThere is insufficient internal representation of the GRANT parse tree,\nwhich makes this cumbersome to implement. Not terribly hard to fix, but\nsomeone needs to do it. (Where were those PostgreSQL hacker newbies?)\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Thu, 7 Jun 2001 16:44:53 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "On Thu, 7 Jun 2001, Peter Eisentraut wrote:\n\n> Vince Vielhaber writes:\n>\n> > I can grant a series of privileges (comma separated) on a series of\n> > objects (comma separated) to either a user, group or public NOT a\n> > comma separated list of users or groups. Yet at the bottom of the\n> > man page for grant\n> >\n> > http://www.postgresql.org/idocs/index.php?sql-grant.html\n> >\n> > it says it's allowed in SQL92. How is it this isn't allowed in\n> > postgresql, is it a real pain to implement or was it just never\n> > needed?\n>\n> There is insufficient internal representation of the GRANT parse tree,\n> which makes this cumbersome to implement. Not terribly hard to fix, but\n> someone needs to do it. (Where were those PostgreSQL hacker newbies?)\n\nI figure it'll be easier to fix than to try and redo the scripts. Have\na direction you can point me in?\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net\n 56K Nationwide Dialup from $16.00/mo at Pop4 Networking\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n",
"msg_date": "Thu, 7 Jun 2001 10:50:54 -0400 (EDT)",
"msg_from": "Vince Vielhaber <vev@michvhf.com>",
"msg_from_op": true,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "Vince Vielhaber writes:\n\n> I can grant a series of privileges (comma separated) on a series of\n> objects (comma separated) to either a user, group or public NOT a\n> comma separated list of users or groups.\n\nI should have this finished today to tomorrow.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Sat, 9 Jun 2001 18:44:23 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "On Sat, 9 Jun 2001, Peter Eisentraut wrote:\n\n> Vince Vielhaber writes:\n>\n> > I can grant a series of privileges (comma separated) on a series of\n> > objects (comma separated) to either a user, group or public NOT a\n> > comma separated list of users or groups.\n>\n> I should have this finished today to tomorrow.\n\nI looked at it but it looked too much like it involved gram.y which I'm\ngoing to happily stay away from for now :)\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net\n 56K Nationwide Dialup from $16.00/mo at Pop4 Networking\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n",
"msg_date": "Sat, 9 Jun 2001 14:42:36 -0400 (EDT)",
"msg_from": "Vince Vielhaber <vev@michvhf.com>",
"msg_from_op": true,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "> On Sat, 9 Jun 2001, Peter Eisentraut wrote:\n> \n> > Vince Vielhaber writes:\n> >\n> > > I can grant a series of privileges (comma separated) on a series of\n> > > objects (comma separated) to either a user, group or public NOT a\n> > > comma separated list of users or groups.\n> >\n> > I should have this finished today to tomorrow.\n> \n> I looked at it but it looked too much like it involved gram.y which I'm\n> going to happily stay away from for now :)\n\nAdded to TODO:\n\n\t* Allow GRANT/REVOKE to handle multiple user/group names\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 9 Jul 2001 15:57:19 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "On Mon, 9 Jul 2001, Bruce Momjian wrote:\n\n> > On Sat, 9 Jun 2001, Peter Eisentraut wrote:\n> >\n> > > Vince Vielhaber writes:\n> > >\n> > > > I can grant a series of privileges (comma separated) on a series of\n> > > > objects (comma separated) to either a user, group or public NOT a\n> > > > comma separated list of users or groups.\n> > >\n> > > I should have this finished today to tomorrow.\n> >\n> > I looked at it but it looked too much like it involved gram.y which I'm\n> > going to happily stay away from for now :)\n>\n> Added to TODO:\n>\n> \t* Allow GRANT/REVOKE to handle multiple user/group names\n\nI'm guessing Peter got sidetracked? If it's still open after I submit\na create user patch (with the help of Tom Lane I'm no longer uncomfortable\nwith gram.y) I'll take a look at this.\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net\n 56K Nationwide Dialup from $16.00/mo at Pop4 Networking\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n",
"msg_date": "Mon, 9 Jul 2001 16:20:47 -0400 (EDT)",
"msg_from": "Vince Vielhaber <vev@michvhf.com>",
"msg_from_op": true,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "Bruce Momjian writes:\n\n> > On Sat, 9 Jun 2001, Peter Eisentraut wrote:\n> >\n> > > Vince Vielhaber writes:\n> > >\n> > > > I can grant a series of privileges (comma separated) on a series of\n> > > > objects (comma separated) to either a user, group or public NOT a\n> > > > comma separated list of users or groups.\n> > >\n> > > I should have this finished today to tomorrow.\n> >\n> > I looked at it but it looked too much like it involved gram.y which I'm\n> > going to happily stay away from for now :)\n>\n> Added to TODO:\n>\n> \t* Allow GRANT/REVOKE to handle multiple user/group names\n\nYou must have missed the part about tomorrow.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Mon, 9 Jul 2001 22:59:10 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "On Mon, 9 Jul 2001, Peter Eisentraut wrote:\n\n> Bruce Momjian writes:\n>\n> > > On Sat, 9 Jun 2001, Peter Eisentraut wrote:\n> > >\n> > > > Vince Vielhaber writes:\n> > > >\n> > > > > I can grant a series of privileges (comma separated) on a series of\n> > > > > objects (comma separated) to either a user, group or public NOT a\n> > > > > comma separated list of users or groups.\n> > > >\n> > > > I should have this finished today to tomorrow.\n> > >\n> > > I looked at it but it looked too much like it involved gram.y which I'm\n> > > going to happily stay away from for now :)\n> >\n> > Added to TODO:\n> >\n> > \t* Allow GRANT/REVOKE to handle multiple user/group names\n>\n> You must have missed the part about tomorrow.\n\nDid you already commit? I was watching for it but could very well\nhave missed it.\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net\n 56K Nationwide Dialup from $16.00/mo at Pop4 Networking\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n",
"msg_date": "Tue, 10 Jul 2001 16:34:16 -0400 (EDT)",
"msg_from": "Vince Vielhaber <vev@michvhf.com>",
"msg_from_op": true,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "> On Mon, 9 Jul 2001, Peter Eisentraut wrote:\n> \n> > Bruce Momjian writes:\n> >\n> > > > On Sat, 9 Jun 2001, Peter Eisentraut wrote:\n> > > >\n> > > > > Vince Vielhaber writes:\n> > > > >\n> > > > > > I can grant a series of privileges (comma separated) on a series of\n> > > > > > objects (comma separated) to either a user, group or public NOT a\n> > > > > > comma separated list of users or groups.\n> > > > >\n> > > > > I should have this finished today to tomorrow.\n> > > >\n> > > > I looked at it but it looked too much like it involved gram.y which I'm\n> > > > going to happily stay away from for now :)\n> > >\n> > > Added to TODO:\n> > >\n> > > \t* Allow GRANT/REVOKE to handle multiple user/group names\n> >\n> > You must have missed the part about tomorrow.\n> \n> Did you already commit? I was watching for it but could very well\n> have missed it.\n\nI don't see it. The tomorrow Vince was talking about was quite a few\nweeks ago. Also, I thought he said he was going to skip it because it\ndealt with gram.y. I do have a pending patch from him that arrived\ntoday that deals with the CREATEDB/CREATEUSER ordering. I have not\napplied it because it hasn't appeared on patches yet for people to\ncomment.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Tue, 10 Jul 2001 17:15:06 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "On Tue, 10 Jul 2001, Bruce Momjian wrote:\n\n> > On Mon, 9 Jul 2001, Peter Eisentraut wrote:\n> >\n> > > Bruce Momjian writes:\n> > >\n> > > > > On Sat, 9 Jun 2001, Peter Eisentraut wrote:\n> > > > >\n> > > > > > Vince Vielhaber writes:\n> > > > > >\n> > > > > > > I can grant a series of privileges (comma separated) on a series of\n> > > > > > > objects (comma separated) to either a user, group or public NOT a\n> > > > > > > comma separated list of users or groups.\n> > > > > >\n> > > > > > I should have this finished today to tomorrow.\n> > > > >\n> > > > > I looked at it but it looked too much like it involved gram.y which I'm\n> > > > > going to happily stay away from for now :)\n> > > >\n> > > > Added to TODO:\n> > > >\n> > > > \t* Allow GRANT/REVOKE to handle multiple user/group names\n> > >\n> > > You must have missed the part about tomorrow.\n> >\n> > Did you already commit? I was watching for it but could very well\n> > have missed it.\n>\n> I don't see it. The tomorrow Vince was talking about was quite a few\n> weeks ago. Also, I thought he said he was going to skip it because it\n> dealt with gram.y. I do have a pending patch from him that arrived\n> today that deals with the CREATEDB/CREATEUSER ordering. I have not\n> applied it because it hasn't appeared on patches yet for people to\n> comment.\n\nThat was Peter saying he was going to have it finished 'today or\ntomorrow'. gram.y wasn't as bad as it at first looked as evidenced\nby the patch I submitted today.\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net\n 56K Nationwide Dialup from $16.00/mo at Pop4 Networking\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n",
"msg_date": "Tue, 10 Jul 2001 17:31:32 -0400 (EDT)",
"msg_from": "Vince Vielhaber <vev@michvhf.com>",
"msg_from_op": true,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "> > > > > Added to TODO:\n> > > > >\n> > > > > \t* Allow GRANT/REVOKE to handle multiple user/group names\n> > > >\n> > > > You must have missed the part about tomorrow.\n> > >\n> > > Did you already commit? I was watching for it but could very well\n> > > have missed it.\n> >\n> > I don't see it. The tomorrow Vince was talking about was quite a few\n> > weeks ago. Also, I thought he said he was going to skip it because it\n> > dealt with gram.y. I do have a pending patch from him that arrived\n> > today that deals with the CREATEDB/CREATEUSER ordering. I have not\n> > applied it because it hasn't appeared on patches yet for people to\n> > comment.\n> \n> That was Peter saying he was going to have it finished 'today or\n> tomorrow'. gram.y wasn't as bad as it at first looked as evidenced\n> by the patch I submitted today.\n\nOh, sorry. OK.\n\nYes, that was a sizable patch!\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Tue, 10 Jul 2001 17:33:12 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "On Tue, 10 Jul 2001, Bruce Momjian wrote:\n\n> > > > > > Added to TODO:\n> > > > > >\n> > > > > > \t* Allow GRANT/REVOKE to handle multiple user/group names\n> > > > >\n> > > > > You must have missed the part about tomorrow.\n> > > >\n> > > > Did you already commit? I was watching for it but could very well\n> > > > have missed it.\n> > >\n> > > I don't see it. The tomorrow Vince was talking about was quite a few\n> > > weeks ago. Also, I thought he said he was going to skip it because it\n> > > dealt with gram.y. I do have a pending patch from him that arrived\n> > > today that deals with the CREATEDB/CREATEUSER ordering. I have not\n> > > applied it because it hasn't appeared on patches yet for people to\n> > > comment.\n> >\n> > That was Peter saying he was going to have it finished 'today or\n> > tomorrow'. gram.y wasn't as bad as it at first looked as evidenced\n> > by the patch I submitted today.\n>\n> Oh, sorry. OK.\n>\n> Yes, that was a sizable patch!\n\nIt's a sizable change :)\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net\n 56K Nationwide Dialup from $16.00/mo at Pop4 Networking\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n",
"msg_date": "Tue, 10 Jul 2001 17:33:56 -0400 (EDT)",
"msg_from": "Vince Vielhaber <vev@michvhf.com>",
"msg_from_op": true,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> I do have a pending patch from him that arrived\n> today that deals with the CREATEDB/CREATEUSER ordering. I have not\n> applied it because it hasn't appeared on patches yet for people to\n> comment.\n\nI already applied his CREATE/ALTER USER patch, because he'd passed it by\nme for review several times previously (I forget if any of that mail was\ncc'd to the lists). I had some other changes to make in the same files\nand figured it might as well go in all at once instead of risking merge\nproblems.\n\nAFAIK, no one has touched the GRANT/REVOKE issue yet.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 10 Jul 2001 18:47:13 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92 "
},
{
"msg_contents": "Bruce Momjian writes:\n\n> > On Sat, 9 Jun 2001, Peter Eisentraut wrote:\n> >\n> > > Vince Vielhaber writes:\n> > >\n> > > > I can grant a series of privileges (comma separated) on a series of\n> > > > objects (comma separated) to either a user, group or public NOT a\n> > > > comma separated list of users or groups.\n> > >\n> > > I should have this finished today to tomorrow.\n> >\n> > I looked at it but it looked too much like it involved gram.y which I'm\n> > going to happily stay away from for now :)\n>\n> Added to TODO:\n>\n> \t* Allow GRANT/REVOKE to handle multiple user/group names\n\nYou're still not getting that part about tomorrow. ;-)\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Fri, 13 Jul 2001 18:27:46 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "> Bruce Momjian writes:\n> \n> > > On Sat, 9 Jun 2001, Peter Eisentraut wrote:\n> > >\n> > > > Vince Vielhaber writes:\n> > > >\n> > > > > I can grant a series of privileges (comma separated) on a series of\n> > > > > objects (comma separated) to either a user, group or public NOT a\n> > > > > comma separated list of users or groups.\n> > > >\n> > > > I should have this finished today to tomorrow.\n> > >\n> > > I looked at it but it looked too much like it involved gram.y which I'm\n> > > going to happily stay away from for now :)\n> >\n> > Added to TODO:\n> >\n> > \t* Allow GRANT/REVOKE to handle multiple user/group names\n> \n> You're still not getting that part about tomorrow. ;-)\n\nCan't I keep it on the TODO until it is done? And wasn't yesterday\ntomorrow? :-)\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Fri, 13 Jul 2001 12:37:55 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "> Bruce Momjian writes:\n> \n> > Can't I keep it on the TODO until it is done? And wasn't yesterday\n> > tomorrow? :-)\n> \n> No, tomorrow was the day after June 9th.\n\nAre you saying you did it already? I see it in CVS now. TODO updated.\n\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Fri, 13 Jul 2001 14:21:53 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92"
},
{
"msg_contents": "Bruce Momjian writes:\n\n> Can't I keep it on the TODO until it is done? And wasn't yesterday\n> tomorrow? :-)\n\nNo, tomorrow was the day after June 9th.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Fri, 13 Jul 2001 20:22:55 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: grant and SQL92"
}
] |
[
{
"msg_contents": "But beforwarned that if you build the package on rpm 3.0.5, the machines\nwith previous versions of RPM will not be able to install that RPM. So you\nwill have to upgrade all of your machines (and also install a couple of\nlibraries, ie. popt and something else or the other). (correct me if I'm\nwrong here...)\n\n-rchit\n\n-----Original Message-----\nFrom: Lamar Owen [mailto:lamar.owen@wgcr.org]\nSent: Thursday, June 07, 2001 8:40 AM\nTo: Hannu Krosing\nCc: pgsql-hackers@postgresql.org\nSubject: Re: [HACKERS] Any time estimates for 7.1.2 RPM's ?\n\n\n-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn Thursday 07 June 2001 11:24, Hannu Krosing wrote:\n> I have had bad experience upgrading rpm package a few times (the rpm\n> database\n> getting whacked and all subsequent installs claiming some packages to be\n> missing)\n> so I'd rather avoid upgrading unless I absolutely have to.\n\nWell,the upgrade to 3.0.5 isn't a problem. Personally, I won't upgrade my \n6.2 box to RPM4 -- but that is a personal choice having a lot to do with the\n\nRPM release of PostgreSQL built on this machine.\n\nUpgrading to 3.0.5 should be completely painless. You do need the new \n'rpm-build' package, though, or you won't be able to rebuild.\n- --\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.0.4 (GNU/Linux)\nComment: For info see http://www.gnupg.org\n\niD8DBQE7H6Bi5kGGI8vV9eERAveXAJ9gmYsSYas4/CGVucJdl+BYEKEUjACeOCNW\n47lMVY1Hjv5SFW0tp4MMBqg=\n=kTbh\n-----END PGP SIGNATURE-----\n\n---------------------------(end of broadcast)---------------------------\nTIP 4: Don't 'kill -9' the postmaster\n",
"msg_date": "Thu, 7 Jun 2001 12:29:00 -0700 ",
"msg_from": "Rachit Siamwalla <rachit@ensim.com>",
"msg_from_op": true,
"msg_subject": "RE: Any time estimates for 7.1.2 RPM's ?"
}
] |
[
{
"msg_contents": "And in addition,\n\nIf you submitted the query:\n\nSELECT * FROM addresses WHERE state = 'OH'\nAND areacode = '614'\n\nThen, with bitmap indexes, the bitmaps are just logically ANDed \ntogether, and the final bitmap determines the matching rows.\n\nMike Mascari\nmascarm@mascari.com\n\n-----Original Message-----\nFrom:\tmlw [SMTP:markw@mohawksoft.com]\n\nBruce Momjian wrote:\n\n> > Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> >\n> > > Here is a small list of big TODO items. I was wondering which \nones\n> > > people were thinking about for 7.2?\n> >\n> > A friend of mine wants to use PostgreSQL instead of Oracle for a \nlarge\n> > application, but has run into a snag when speed comparisons \nlooked\n> > good until the Oracle folks added a couple of BITMAP indexes. I \ncan't\n> > recall seeing any discussion about that here -- are there any \nplans?\n>\n> It is not on our list and I am not sure what they do.\n\nDo you have access to any Oracle Documentation? There is a good \nexplanation\nof them.\n\nHowever, I will try to explain.\n\nIf you have a table, locations. It has 1,000,000 records.\n\nIn oracle you do this:\n\ncreate bitmap index bitmap_foo on locations (state) ;\n\nFor each unique value of 'state' oracle will create a bitmap with \n1,000,000\nbits in it. With a one representing a match and a zero representing \nno\nmatch. Record '0' in the table is represented by bit '0' in the \nbitmap,\nrecord '1' is represented by bit '1', record two by bit '2' and so \non.\n\nIn a table where comparatively few different values are to be indexed \nin a\nlarge table, a bitmap index can be quite small and not suffer the N * \nlog(N)\ndisk I/O most tree based indexes suffer. If the bitmap is fairly \nsparse or\ndense (or have periods of denseness and sparseness), it can be \ncompressed\nvery efficiently as well.\n\nWhen the statement:\n\nselect * from locations where state = 'MA';\n\nIs executed, the bitmap is read into memory in very few disk \noperations.\n(Perhaps even as few as one or two). It is a simple operation of \nrifling\nthrough the bitmap for '1's that indicate the record has the \nproperty,\n'state' = 'MA';\n\n\n",
"msg_date": "Thu, 7 Jun 2001 15:34:17 -0400",
"msg_from": "Mike Mascari <mascarm@mascari.com>",
"msg_from_op": true,
"msg_subject": "RE: Re: 7.2 items"
},
{
"msg_contents": "> And in addition,\n> \n> If you submitted the query:\n> \n> SELECT * FROM addresses WHERE state = 'OH'\n> AND areacode = '614'\n> \n> Then, with bitmap indexes, the bitmaps are just logically ANDed \n> together, and the final bitmap determines the matching rows.\n\nMessage added to TODO.detail. The use of AND seems like a very nice\noptimization possible with bitmap indexes. Thanks.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 7 Jun 2001 16:05:19 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Re: 7.2 items"
}
] |
[
{
"msg_contents": "The best solution would be to have the ODBC translate instances of '= \nNULL' into IS NULL before submitting the query to PostgreSQL. I'm \nsure this is how other vendors, like Oracle handle the issue. Well, \nprobably sure... :-)\n\nMike Mascari\nmascarm@mascari.com\n\n-----Original Message-----\nFrom:\tTom Ivar Helbekkmo [SMTP:tih@kpnQwest.no]\nSent:\tThursday, June 07, 2001 3:18 PM\nTo:\tTom Lane\nCc:\tStephan Szabo; Mark Stosberg; pgsql-sql@postgresql.org; \npgsql-hackers@postgresql.org\nSubject:\tRe: [HACKERS] Re: [SQL] behavior of ' = NULL' vs. MySQL vs. \nStandards\n\nTom Lane <tgl@sss.pgh.pa.us> writes:\n\n> A compromise answer might be to offer a SET variable that selects \nthe\n> Microsoft-compatible misimplementation. Would that fly?\n\nI'd say that's the best way to handle stuff like this. If you\nimplement something that breaks the standard, to be compatible with\narrogant programmers at Microsoft who feel that they are above such\nthings, you're encouraging users to develop bad habits. Better to\nmake them go \"SET MICROSOFT BUG COMPATIBILITY ON\" first.\n\nTo see the effect of leniency in re standards, just try to browse\naround the web with a browser that rejects incorrect HTML! :-)\n\n",
"msg_date": "Thu, 7 Jun 2001 15:36:20 -0400",
"msg_from": "Mike Mascari <mascarm@mascari.com>",
"msg_from_op": true,
"msg_subject": "RE: [HACKERS] Re: behavior of ' = NULL' vs. MySQL vs. Standards"
},
{
"msg_contents": "Mike Mascari <mascarm@mascari.com> writes:\n\n> The best solution would be to have the ODBC translate instances of '= \n> NULL' into IS NULL before submitting the query to PostgreSQL. I'm \n> sure this is how other vendors, like Oracle handle the issue. Well, \n> probably sure... :-)\n\n<applause>\n\nThat's the intelligent solution, of course.\n\n-tih\n-- \nThe basic difference is this: hackers build things, crackers break them.\n",
"msg_date": "07 Jun 2001 21:42:32 +0200",
"msg_from": "Tom Ivar Helbekkmo <tih@kpnQwest.no>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: behavior of ' = NULL' vs. MySQL vs. Standards"
},
{
"msg_contents": "Mike Mascari <mascarm@mascari.com> writes:\n> The best solution would be to have the ODBC translate instances of '= \n> NULL' into IS NULL before submitting the query to PostgreSQL.\n\nDoes Access only talk to Postgres via ODBC? (Seems plausible, but I\ndon't know.) What about people copying-and-pasting queries generated\nby Access; is it even possible?\n\nI doubt that this'd really help much, in any case; it merely moves the\nnecessary switch from the backend to ODBC.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 11:04:26 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: behavior of ' = NULL' vs. MySQL vs. Standards "
},
{
"msg_contents": "Tom,\n\n> Does Access only talk to Postgres via ODBC? (Seems plausible, but I\n> don't know.) \n\n\tYes.\n\n What about people copying-and-pasting queries generated\n> by Access; is it even possible?\n\nYes, but MS Access uses some much non-standard SQL that \"= Null\" would\nhardly be the only problem (try to build an UPDATE ... FROM in Access)\n\n> I doubt that this'd really help much, in any case; it merely moves\n> the\n> necessary switch from the backend to ODBC.\n\nYes, but it does avoid cluttering up the PgSQL source with switches that\nare only useful to a handful of users.\n\n-Josh\n\n\n______AGLIO DATABASE SOLUTIONS___________________________\n Josh Berkus\n Complete information technology josh@agliodbs.com\n and data management solutions (415) 565-7293\n for law firms, small businesses fax 621-2533\n and non-profit organizations. San Francisco\n",
"msg_date": "Fri, 08 Jun 2001 09:53:16 -0700",
"msg_from": "\"Josh Berkus\" <josh@agliodbs.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: behavior of ' = NULL' vs. MySQL vs. Standards "
}
] |
[
{
"msg_contents": "Hi all,\n\nI've been using PostgreSQL for a couple of high performance projects\nrecently and have been extremely impressed - much kudos to all involved in\nbringing it this far. One thing that is limiting is the lack of fault\ntolerance and load balancing.\n\nAnyway, I've recently started lurking on the hackers mailing list and I'm\nquite captivated by the addition of replication to PostgreSQL and note that\nit is an urgent action item on the to-do list.\n\nThere is a lot of information out there on algorithms and approaches, and\nI'm wondering who is leading this effort and how I can help. I've got quite\na few ideas on how to attack the problem, such as:\n\n* defining the type of replication we are after (hot swap / consistent,\nread-only clones, delayed etc). I'd be after the first - a hot swap cluster\nwith load balancing so a read (SELECT) can be serviced by any machine and an\nmodification (DELETE/UPDATE/INSERT) is propagated through the cluster\nimmediately. This would make PostgreSQL a viable alternative to that other\nEnterprise level offering *cough* Oracle *cough*\n\n* establishing the propagation process when initialising the replication\n\n* implementing the propagation algorithm for modification queries\n\nI'm currently employed as a C/C++/Java programmer, so I'm comfortable with\nunderstanding and writing solid and clean C/C++ code.\n\nI'm happy to whip up a document outlining my ideas...or post them to the\nmailing list, or whatever really. Just want to help :)\n\nCheers,\n\nMark\n\n",
"msg_date": "Fri, 8 Jun 2001 14:35:31 +1000",
"msg_from": "\"Mark Pritchard\" <mark@tangent.net.au>",
"msg_from_op": true,
"msg_subject": "PostgreSQL and replication"
},
{
"msg_contents": ">\n> I've been using PostgreSQL for a couple of high performance projects\n> recently and have been extremely impressed - much kudos to all involved in\n> bringing it this far. One thing that is limiting is the lack of fault\n> tolerance and load balancing.\n\nwebadmin (Bruce?): You may want to make a link (from the TODO list) to\n\nhttp://www.greatbridge.org/project/pgreplication/projdisplay.php\n\nThis is where most of the replication talk is being done and projects are\nbeing worked on.\n\n- Brandon\n\n----------------------------------------------------------------------------\n b. palmer, bpalmer@crimelabs.net pgp:crimelabs.net/bpalmer.pgp5\n\n",
"msg_date": "Fri, 8 Jun 2001 00:57:29 -0400 (EDT)",
"msg_from": "bpalmer <bpalmer@crimelabs.net>",
"msg_from_op": false,
"msg_subject": "Re: PostgreSQL and replication"
},
{
"msg_contents": "Mark,\n\nthere is interesting project DBBalancer\n(http://www.sourceforge.net/projects/dbbalancer)\nwhich claims:\n\nDBBalancer is some sort of middleware that would sit in between of database\nclients, like C, C++, TCL, Java JDBC, Perl DBI, and a database server.\nCurrently the only server supported is Postgres, but the architecture is open\nto embrace more servers in a future. One of his strongest (IMHO ;-)) points is\nthat it can be tried or used without changing a line of the existing code,\nbecause the balancing is done at Postgres protocol level.\n\nDBBalancer can do different things.\n\n * It's a connection pool...\n * ... a load balancer,\n * .. and a database replicator.\n\nAnd can be used any combination of these things at the same time.\n\nI just compiled it but didn't run yet. I think if this project has a\ngood architectural design and idea it would be nice to have it\nworks as a postgresql companion project. Why do we need yet another\nreplication hack instead of join efforts.\n\n\tOleg\nOn Fri, 8 Jun 2001, Mark Pritchard wrote:\n\n> Hi all,\n>\n> I've been using PostgreSQL for a couple of high performance projects\n> recently and have been extremely impressed - much kudos to all involved in\n> bringing it this far. One thing that is limiting is the lack of fault\n> tolerance and load balancing.\n>\n> Anyway, I've recently started lurking on the hackers mailing list and I'm\n> quite captivated by the addition of replication to PostgreSQL and note that\n> it is an urgent action item on the to-do list.\n>\n> There is a lot of information out there on algorithms and approaches, and\n> I'm wondering who is leading this effort and how I can help. I've got quite\n> a few ideas on how to attack the problem, such as:\n>\n> * defining the type of replication we are after (hot swap / consistent,\n> read-only clones, delayed etc). I'd be after the first - a hot swap cluster\n> with load balancing so a read (SELECT) can be serviced by any machine and an\n> modification (DELETE/UPDATE/INSERT) is propagated through the cluster\n> immediately. This would make PostgreSQL a viable alternative to that other\n> Enterprise level offering *cough* Oracle *cough*\n>\n> * establishing the propagation process when initialising the replication\n>\n> * implementing the propagation algorithm for modification queries\n>\n> I'm currently employed as a C/C++/Java programmer, so I'm comfortable with\n> understanding and writing solid and clean C/C++ code.\n>\n> I'm happy to whip up a document outlining my ideas...or post them to the\n> mailing list, or whatever really. Just want to help :)\n>\n> Cheers,\n>\n> Mark\n>\n>\n> ---------------------------(end of broadcast)---------------------------\n> TIP 2: you can get off all lists at once with the unregister command\n> (send \"unregister YourEmailAddressHere\" to majordomo@postgresql.org)\n>\n\n\tRegards,\n\t\tOleg\n_____________________________________________________________\nOleg Bartunov, sci.researcher, hostmaster of AstroNet,\nSternberg Astronomical Institute, Moscow University (Russia)\nInternet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/\nphone: +007(095)939-16-83, +007(095)939-23-83\n\n",
"msg_date": "Fri, 8 Jun 2001 17:47:18 +0300 (GMT)",
"msg_from": "Oleg Bartunov <oleg@sai.msu.su>",
"msg_from_op": false,
"msg_subject": "Re: PostgreSQL and replication"
}
] |
[
{
"msg_contents": "I saw someone else also saw this error. I am seeing it in 7.1.2 and I\nthink I may have tracked it down. It's after a different operation but\nperhaps it is related.\n\nI have written a trigger. It dies with that error when I make the\nfollowing call.\n\nSPI_modifytuple (rel,rettuple,1,&targ_att,&newval,NULL)\n\nI created targ_att as follows.\n\ntarg_att = SPI_fnumber (tupdesc, args[0]\n\nThis returns 23 in my case which is the correct field that I want to\nmodify. The existing value for that field is NULL. I looked at the\nlength of that fields with rel->rd_att->attrs[23]->attlen and it is -1.\nI assume that that is OK for a NULL value.\n\nI eventually followed this call to heaptuple.c. In heap_formtuple()\nthere is a call to ComputeDataSize() with the existing tuple, the value\nI am changing to and the nulls. In that function the length (-1) is\nadded to the total length. This causes the problem I am seeing.\n\nAm I misunderstanding the call? I thought that the nulls parameter was\nto map out which values you were changing to were NULL. It appears\nto be the value of the existing value. Why would I care about that value?\nIs it up to me to find all the NULLS in an existing tuple before calling SPI\nfunctions?\n\nI called this function that way in an earlier version with no problem.\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.\n\n",
"msg_date": "Fri, 8 Jun 2001 09:07:05 -0400 (EDT)",
"msg_from": "darcy@druid.net (D'Arcy J.M. Cain)",
"msg_from_op": true,
"msg_subject": "ERROR: Memory exhausted in AllocSetAlloc(909324558)"
},
{
"msg_contents": "darcy@druid.net (D'Arcy J.M. Cain) writes:\n> Am I misunderstanding the call? I thought that the nulls parameter was\n> to map out which values you were changing to were NULL.\n\nheap_formtuple is for constructing a tuple from scratch. It sounds like\nyou should be using heap_modifytuple instead.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 15:37:34 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: ERROR: Memory exhausted in AllocSetAlloc(909324558) "
},
{
"msg_contents": "Thus spake Tom Lane\n> darcy@druid.net (D'Arcy J.M. Cain) writes:\n> > Am I misunderstanding the call? I thought that the nulls parameter was\n> > to map out which values you were changing to were NULL.\n> \n> heap_formtuple is for constructing a tuple from scratch. It sounds like\n> you should be using heap_modifytuple instead.\n\nBut I am using SPI_modifytuple(). The rest came from tracing that\nfunction.\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Fri, 8 Jun 2001 19:44:42 -0400 (EDT)",
"msg_from": "darcy@druid.net (D'Arcy J.M. Cain)",
"msg_from_op": true,
"msg_subject": "Re: ERROR: Memory exhausted in AllocSetAlloc(909324558)"
},
{
"msg_contents": "darcy@druid.net (D'Arcy J.M. Cain) writes:\n>> heap_formtuple is for constructing a tuple from scratch. It sounds like\n>> you should be using heap_modifytuple instead.\n\n> But I am using SPI_modifytuple(). The rest came from tracing that\n> function.\n\nHm. Looks like the author of SPI_modifytuple didn't realize he could\nuse heap_modifytuple :-(. But he is correctly extracting the old data.\nI don't see anything wrong there, assuming that you are passing a\nrelation descriptor that matches the original tuple.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 20:20:28 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: ERROR: Memory exhausted in AllocSetAlloc(909324558) "
},
{
"msg_contents": "Thus spake Tom Lane\n> darcy@druid.net (D'Arcy J.M. Cain) writes:\n> >> heap_formtuple is for constructing a tuple from scratch. It sounds like\n> >> you should be using heap_modifytuple instead.\n> \n> > But I am using SPI_modifytuple(). The rest came from tracing that\n> > function.\n> \n> Hm. Looks like the author of SPI_modifytuple didn't realize he could\n> use heap_modifytuple :-(. But he is correctly extracting the old data.\n> I don't see anything wrong there, assuming that you are passing a\n> relation descriptor that matches the original tuple.\n\nWell, let's see.\n\n SPI_modifytuple (rel,rettuple,1,&targ_att,&newval,NULL)\n\nHere are (I think) the relevant lines that get me the data for that call.\n\nDatum\nmk_cardnum(PG_FUNCTION_ARGS)\n{\n TriggerData *trigdata = (TriggerData *) fcinfo->context;\n int nargs; /* # of arguments */\n Datum newval; /* new value of column */\n char **args; /* arguments */\n char *relname; /* triggered relation name */\n Relation rel; /* triggered relation */\n HeapTuple rettuple = NULL;\n int targ_att;\n bool isnull;\n char cardnum[48];\n...\n /* assume full error checking - leaving out for clarity */\n rel = trigdata->tg_relation;\n relname = SPI_getrelname(rel);\n targ_att = SPI_fnumber (tupdesc, args[0]);\n newval = CStringGetDatum(cardnum);\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Sat, 9 Jun 2001 07:12:35 -0400 (EDT)",
"msg_from": "darcy@druid.net (D'Arcy J.M. Cain)",
"msg_from_op": true,
"msg_subject": "Re: ERROR: Memory exhausted in AllocSetAlloc(909324558)"
},
{
"msg_contents": "darcy@druid.net (D'Arcy J.M. Cain) writes:\n> char cardnum[48];\n> ...\n> newval = CStringGetDatum(cardnum);\n\nAnd you are trying to assign this datum to what kind of column?\n(Hint: there isn't any kind for which a plain C string is valid data.)\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sat, 09 Jun 2001 12:50:23 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: ERROR: Memory exhausted in AllocSetAlloc(909324558) "
},
{
"msg_contents": "Thus spake Tom Lane\n> darcy@druid.net (D'Arcy J.M. Cain) writes:\n> > char cardnum[48];\n> > ...\n> > newval = CStringGetDatum(cardnum);\n> \n> And you are trying to assign this datum to what kind of column?\n> (Hint: there isn't any kind for which a plain C string is valid data.)\n\nRight. That was just my latest try. I did notice that CStringGetDatum was\njust defined as PointerGetDatum. I tried to find something specific for\ntext but nothing seemed to fit the bill. I saw DatumGetTextP but that\ndetoasts a toasted object. There were the various PG_RETURNxxx macros\nbut this is a user created strting, not an argument.\n\nDo I have to manually create a varlena? I'll try that next.\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Sat, 9 Jun 2001 13:47:39 -0400 (EDT)",
"msg_from": "darcy@druid.net (D'Arcy J.M. Cain)",
"msg_from_op": true,
"msg_subject": "Re: ERROR: Memory exhausted in AllocSetAlloc(909324558)"
},
{
"msg_contents": "darcy@druid.net (D'Arcy J.M. Cain) writes:\n> Do I have to manually create a varlena? I'll try that next.\n\nThe best way to get from a C string to a valid datum is to invoke the\ndatatype's input conversion routine. If you know you want text,\nyou could do\n\n#define _textin(str) DirectFunctionCall1(textin, CStringGetDatum(str))\n\nto produce a datum from a C string.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sat, 09 Jun 2001 14:36:50 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: ERROR: Memory exhausted in AllocSetAlloc(909324558) "
},
{
"msg_contents": "Thus spake Tom Lane\n> darcy@druid.net (D'Arcy J.M. Cain) writes:\n> > Do I have to manually create a varlena? I'll try that next.\n> \n> The best way to get from a C string to a valid datum is to invoke the\n> datatype's input conversion routine. If you know you want text,\n> you could do\n> \n> #define _textin(str) DirectFunctionCall1(textin, CStringGetDatum(str))\n> \n> to produce a datum from a C string.\n\nAh, that was it. I had done a similar thing in another trigger with a\ndate type. I should have thought of that.\n\nHmm. Does this suggest more macros in fmgr.h or postgres.h?\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Sun, 10 Jun 2001 03:27:46 -0400 (EDT)",
"msg_from": "darcy@druid.net (D'Arcy J.M. Cain)",
"msg_from_op": true,
"msg_subject": "Re: ERROR: Memory exhausted in AllocSetAlloc(909324558)"
}
] |
[
{
"msg_contents": "\nI created a Foreign Key (REFERENCES) constraint on\na table like this (some columns ommited) :\nCREATE TABLE tablename (\n id_tablename\t INTEGER DEFAULT nextval('id_tablename_seq'),\n tablename_parent INTEGER CONSTRAINT tablename_parent_fk\n REFERENCES tablename (id_tablename),\n CONSTRAINT tablename_pk PRIMARY KEY (id_tablename)\n);\n\nWhen I pg_dump, I can see three triggers :\nThe first calls RI_FKey_check_ins AFTER INSERT OR UPDATE,\nthe second one calls RI_FKey_noaction_del AFTER DELETE,\nthe third one calls RI_FKey_noaction_upd AFTER UPDATE.\n\nAll the triggers and procedure calls have the same parameters.\n\n\nI browsed the docs, looked at :\nhttp://techdocs.postgresql.org/techdocs/hackingreferentialintegrity.php\n\nand asked pgsql-docs but I couldn't find what they\nreally do. Can someone give me information about\nthose Triggers created for FKey RI ?\n\n\nBest Regards,\n\nJean-Francois Leveque\n\n\n______________________________________________________________________\nSur WebMailS.com, mon adresse de courrier �lectronique gratuite.\nService multilingue, s�r, et permanent. http://www.webmails.com/\n",
"msg_date": "Fri, 8 Jun 2001 14:21:56 +0100",
"msg_from": "\"Jean-Francois Leveque\" <leveque@webmails.com>",
"msg_from_op": true,
"msg_subject": "Need information about Foreign Key created Triggers"
},
{
"msg_contents": "On Fri, 8 Jun 2001, Jean-Francois Leveque wrote:\n\n> \n> I created a Foreign Key (REFERENCES) constraint on\n> a table like this (some columns ommited) :\n> CREATE TABLE tablename (\n> id_tablename\t INTEGER DEFAULT nextval('id_tablename_seq'),\n> tablename_parent INTEGER CONSTRAINT tablename_parent_fk\n> REFERENCES tablename (id_tablename),\n> CONSTRAINT tablename_pk PRIMARY KEY (id_tablename)\n> );\n> \n> When I pg_dump, I can see three triggers :\n> The first calls RI_FKey_check_ins AFTER INSERT OR UPDATE,\n> the second one calls RI_FKey_noaction_del AFTER DELETE,\n> the third one calls RI_FKey_noaction_upd AFTER UPDATE.\n> \n> All the triggers and procedure calls have the same parameters.\n> \n> \n> I browsed the docs, looked at :\n> http://techdocs.postgresql.org/techdocs/hackingreferentialintegrity.php\n> \n> and asked pgsql-docs but I couldn't find what they\n> really do. Can someone give me information about\n> those Triggers created for FKey RI ?\n\nIt's in the archives somewhere, but...\n\nThe functions take the same args, but the name of the functions says\nwhat it's going to do and the table that the trigger and the action\n(AFTER ?) tells you when it does it.\n\nRI_FKey_check_ins checks a newly inserted or updated row in the FK\n table against the PK table rows.\nRI_FKey_<something>_del does the referential action <something>,\n in your case no action, when a row is deleted from the PK table.\nRI_FKey_<something>_upd does the referential action <something>,\n in your case no action, when a row is updated in the PK table.\n\nIIRC, The arguments are \n name of constraint, fk table, pk table, match type,\n fk col 1, pk col1, ... fk col n, pk col n\n\n\n\n\n",
"msg_date": "Fri, 8 Jun 2001 08:09:40 -0700 (PDT)",
"msg_from": "Stephan Szabo <sszabo@megazone23.bigpanda.com>",
"msg_from_op": false,
"msg_subject": "Re: Need information about Foreign Key created Triggers"
}
] |
[
{
"msg_contents": "\n I built my own binary RPMs with rpm -bb and this spec file. I compiled\nand \"installed\" postgres using the instructions in comments in the %build\nsection because I haven't bothered to figure out how %build works. This\ninstallation is roughly based on the RedHat 6.0 SPEC file and probably has\na couple of file assignments wrong (server -vs- client -vs- devel).\n\n I have to say that ANT chaps my ass. What ever happened to \n\njavac x.java; jar cf blah.jar `cat find . -name '*.class' -print` \n\n ? Make is obsolete, but nothing real has stepped forward to replace it.\n\n\nSummary: Postgres 7.1 client\nName: postgres\nVersion: 7.1.2\nRelease: 1\nGroup: Applications/Databases\nBuildRoot: /tmp/build\nAutoreqprov: no\nProvides: plenty-of-hate libpq.so.2\n\n%description\n\nThis is postgres 7.1.2.\n\nIt includes the utilities any database client will need\n\n%package server\nSummary: Postgres 7.1 server\nGroup: Applications/Databases\n\n%description server\n\nThis is postgres 7.1.2.\n\nIt includes the server binaries and anything else you need to run a\ndatabase.\n\n%package jdbc\nSummary: Postgres 7.1 JDBC\nGroup: Applications/Databases\n\n%description jdbc\n\nThis is JDBC for postgres 7.1.2.\n\n%package perl\nSummary: Postgres 7.1 perl DBD\nGroup: Applications/Databases\n\n%description perl\n\nThis is the perl DBD for postgres 7.1.2.\n\n%package devel\nSummary: Postgres 7.1 development libraries\nGroup: Applications/Databases\n\n%description devel\n\nThese are libraries used to develop binaries that use postgres.\n\n\n\n\n\n%build\n\n# x=/tmp/build\n# ./configure --prefix=$x/usr --with-odbc --with-perl --with-java --with-includes=/usr/include/readline\n# time make -j 2 install\n# mkdir -p $x/var/lib/pgsql\n# mkdir -p $x/usr/lib/pgsql; mv $x/usr/share/postgresql/java/postgresql.jar $x/usr/lib/pgsql/jdbc7.0-1.2.jar\n# ( cd src/interfaces/perl5/ && make PREFIX=$x/usr/ -f Makefile install )\n\n#\n\n\n\n%files devel\n/usr/lib/*.a\n/usr/lib/*.so\n/usr/include/postgresql\n/usr/bin/ecpg\n\n/usr/man/man1/ecpg.1\n\n\n%files server\n%defattr(-,root,root)\n\n%dir %attr(-,postgres,postgres) /var/lib/pgsql\n\n/usr/bin/initdb\n/usr/bin/initlocation\n/usr/bin/ipcclean\n/usr/bin/pg_config\n/usr/bin/pg_ctl\n/usr/bin/pg_passwd\n#/usr/bin/pg_upgrade\n#/usr/bin/pg_version\n/usr/bin/pg_restore\n/usr/bin/postgres\n/usr/bin/postmaster\n\n/usr/man/man1/initdb.1\n/usr/man/man1/initlocation.1\n/usr/man/man1/ipcclean.1\n/usr/man/man1/pg_config.1\n/usr/man/man1/pg_ctl.1\n/usr/man/man1/pg_passwd.1\n/usr/man/man1/pg_restore.1\n#/usr/man/man1/pg_upgrade.1\n\n/usr/man/man1/pgaccess.1\n#/usr/man/man1/pgadmin.1\n/usr/man/man1/postgres.1\n/usr/man/man1/postmaster.1\n\n#%attr(755,root,root) /usr/lib/pgsql/plpgsql.so\n/usr/share/postgresql/global.bki\n/usr/share/postgresql/global.description\n/usr/share/postgresql/template1.bki\n/usr/share/postgresql/template1.description\n/usr/share/postgresql/pg_hba.conf.sample\n/usr/share/postgresql/pg_ident.conf.sample\n#/usr/share/postgresql/pg_geqo.sample\n#/usr/share/postgresql/pg_options.sample\n/usr/share/postgresql/postgresql.conf.sample\n/usr/etc/postgresql/odbcinst.ini\n/usr/share/postgresql/odbc.sql\n\n#/usr/lib/pgsql/postmaster.opts.default.sample\n\n%pre server\nuseradd -M -o -r -d /var/lib/pgsql -s /bin/bash -c \"Postgres owner\" -u 40 postgres\n\n%preun server\nif [ $1 = 0 ] ; then\n chkconfig --del postgresql\nfi\n\n%postun server\n\n/sbin/ldconfig\nif [ $1 = 0 ] ; then\n userdel postgres >/dev/null 2>&1 || : \nfi\n\n\n\n\n\n\n%files\n%defattr(-,root,root)\n\n/usr/bin/createdb\n/usr/bin/createlang\n/usr/bin/createuser\n/usr/bin/dropdb\n/usr/bin/droplang\n/usr/bin/dropuser\n\n/usr/bin/pg_dump\n/usr/bin/pg_dumpall\n/usr/bin/pg_id\n/usr/bin/psql\n/usr/bin/vacuumdb\n\n%attr(755,root,root) /usr/lib/libpq.so.2.1\n%attr(755,root,root) /usr/lib/libecpg.so.3.2.0\n#%attr(755,root,root) /usr/lib/libpq++.so.3.1\n%attr(755,root,root) /usr/lib/libpgeasy.so.2.1\n%attr(755,root,root) /usr/lib/libpsqlodbc.so.0.26\n\n/usr/man/man1/createdb.1\n/usr/man/man1/createlang.1\n/usr/man/man1/createuser.1\n/usr/man/man1/dropdb.1\n/usr/man/man1/droplang.1\n/usr/man/man1/dropuser.1\n\n/usr/man/man1/pg_dump.1\n/usr/man/man1/pg_dumpall.1\n/usr/man/man1/psql.1\n/usr/man/man1/vacuumdb.1\n\n/usr/man/man1/pgtclsh.1\n/usr/man/man1/pgtksh.1\n\n/usr/man/manl/abort.l\n/usr/man/manl/alter_group.l\n/usr/man/manl/alter_table.l\n/usr/man/manl/alter_user.l\n/usr/man/manl/begin.l\n/usr/man/manl/checkpoint.l\n/usr/man/manl/close.l\n/usr/man/manl/cluster.l\n/usr/man/manl/comment.l\n/usr/man/manl/commit.l\n/usr/man/manl/copy.l\n/usr/man/manl/create_aggregate.l\n/usr/man/manl/create_constraint_trigger.l\n/usr/man/manl/create_database.l\n/usr/man/manl/create_function.l\n/usr/man/manl/create_group.l\n/usr/man/manl/create_index.l\n/usr/man/manl/create_language.l\n/usr/man/manl/create_operator.l\n/usr/man/manl/create_rule.l\n/usr/man/manl/create_sequence.l\n/usr/man/manl/create_table.l\n/usr/man/manl/create_table_as.l\n/usr/man/manl/create_trigger.l\n/usr/man/manl/create_type.l\n/usr/man/manl/create_user.l\n/usr/man/manl/create_view.l\n/usr/man/manl/declare.l\n/usr/man/manl/delete.l\n/usr/man/manl/drop_aggregate.l\n/usr/man/manl/drop_database.l\n/usr/man/manl/drop_function.l\n/usr/man/manl/drop_group.l\n/usr/man/manl/drop_index.l\n/usr/man/manl/drop_language.l\n/usr/man/manl/drop_operator.l\n/usr/man/manl/drop_rule.l\n/usr/man/manl/drop_sequence.l\n/usr/man/manl/drop_table.l\n/usr/man/manl/drop_trigger.l\n/usr/man/manl/drop_type.l\n/usr/man/manl/drop_user.l\n/usr/man/manl/drop_view.l\n/usr/man/manl/end.l\n/usr/man/manl/explain.l\n/usr/man/manl/fetch.l\n/usr/man/manl/grant.l\n/usr/man/manl/insert.l\n/usr/man/manl/listen.l\n/usr/man/manl/load.l\n/usr/man/manl/lock.l\n/usr/man/manl/move.l\n/usr/man/manl/notify.l\n/usr/man/manl/reindex.l\n/usr/man/manl/reset.l\n/usr/man/manl/revoke.l\n/usr/man/manl/rollback.l\n/usr/man/manl/select.l\n/usr/man/manl/select_into.l\n/usr/man/manl/set_constraints.l\n/usr/man/manl/set.l\n/usr/man/manl/set_transaction.l\n/usr/man/manl/show.l\n/usr/man/manl/truncate.l\n/usr/man/manl/unlisten.l\n/usr/man/manl/update.l\n/usr/man/manl/vacuum.l\n\n%post\n/sbin/ldconfig\n\n%postun\n/sbin/ldconfig\n\n\n\n\n\n\n\n\n%files perl\n%defattr(-,root,root)\n\n/usr/lib/perl5/site_perl/5.005/i386-linux/auto/Pg\n/usr/lib/perl5/site_perl/5.005/i386-linux/Pg.pm\n/usr/lib/perl5/man/man3/Pg.3\n\n\n\n\n\n\n\n%files jdbc\n%defattr(-,root,root)\n\n/usr/lib/pgsql/jdbc7.0-1.2.jar\n/usr/share/postgresql/java/postgresql-examples.jar\n/usr/share/postgresql/java/retepTools.jar\n\n",
"msg_date": "Fri, 08 Jun 2001 10:52:37 -0400",
"msg_from": "Robert Forsman <thoth@purplefrog.com>",
"msg_from_op": true,
"msg_subject": "7.1.2 RPMs"
}
] |
[
{
"msg_contents": "\nHI\n\nI am having trouble with a 7.1rc4 database filling up my disks. What I do\nis put a large number of \"small\" large objects of seismic data into the\ndatabase in one process and use another process to unlink them after they\nreach a certain age to form a buffer. The unlink seems to be working, and\nsome disk space is reclaimed, but the size of the database continues to\ngrow until the disk fills and the postgres backend dies. I have tried\nvacuuming, but that doesn't help.\n\nI poked around in the database directory and found a file named 16948 that\nis 960Mb or almost all of the space on my partition. If the unlinks were\ncompletely cleaning up, then my 8 days data buffer should be about 150Mb.\nIs there a way to tell what this file is? I guess it is all the large\nobjects dumped in together??? Does anyone know why my unlinks wouldn't be\ncompletely freeing the disk space?\n \nlgelg pg> ls -l 16948\n-rw------- 1 postgres postgres 959438848 Jun 8 14:31 16948\nlgelg pg> pwd\n/home/postgres/data/base/18721\nlgelg pg> \n\nI have put some more info below, if it helps. But basically I think that\nthe messages are all related to the disk filing, but don't explain why it\nfilled.\n\nthanks,\nPhilip\n\n\nHere is a snippet of the java code fo my unlink, and I am using autocommit\noff:\n lobj = ((org.postgresql.Connection)conn).getLargeObjectAPI();\n...snip...\n\n logger.debug(\"before large object delete\");\n // loop over all large objects, deleting them\n it = oid.iterator();\n while (it.hasNext()) {\n Integer nextId = (Integer)it.next();\n \n logger.debug(\"Deleting large object \"+nextId);\n // delete large object data\n lobj.delete(nextId.intValue());\n }\n it = null;\n\n // commit changes\n logger.debug(\"Commiting...\");\n jdbcDataChunk.commit();\n conn.commit(); \n logger.info(\"Commiting done.\");\n\n\nHere is the java exception I get:\nAn I/O error has occured while flushing the output - Exception:\njava.io.IOException: Broken pipe\nStack Trace:\n\njava.io.IOException: Broken pipe\n at java.net.SocketOutputStream.socketWrite(Native Method)\n at java.net.SocketOutputStream.write(SocketOutputStream.java,\nCompiled Code)\n at\njava.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java,\nCompiled Code)\n at java.io.BufferedOutputStream.flush(BufferedOutputStream.java,\nCompiled Code)\n at org.postgresql.PG_Stream.flush(PG_Stream.java, Compiled Code)\n at org.postgresql.Connection.ExecSQL(Connection.java, Compiled\nCode)\n at org.postgresql.jdbc2.Statement.execute(Statement.java, Compiled\nCode)\n at org.postgresql.jdbc2.Statement.executeQuery(Statement.java,\nCompiled Code)\n at\norg.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.java,\nCompile\nd Code)\n at\nedu.sc.seis.anhinga.database.JDBCChannelId.getDBId(JDBCChannelId.java,\nCompiled Cod\ne)\n at\nedu.sc.seis.anhinga.database.JDBCDataChunk.put(JDBCDataChunk.java,\nCompiled Code)\n at edu.sc.seis.anhinga.symres.Par4ToDB.run(Par4ToDB.java, Compiled\nCode)\nEnd of Stack Trace\n\n\nHere are the messages in the serverlog:\nDEBUG: MoveOfflineLogs: remove 00000000000000D7\nDEBUG: MoveOfflineLogs: remove 00000000000000D8\nDEBUG: MoveOfflineLogs: remove 00000000000000D9\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nERROR: Write to hashjoin temp file failed\nDEBUG: MoveOfflineLogs: remove 00000000000000DA\nFATAL 2: ZeroFill(/home/postgres/data/pg_xlog/xlogtemp.19371) failed: No\nsuch file or directo\nry\nERROR: Write to hashjoin temp file failed\nServer process (pid 19371) exited with status 512 at Thu Jun 7 03:32:52\n2001\nTerminating any active server processes...\nNOTICE: Message from PostgreSQL backend:\n The Postmaster has informed me that some other backend died\nabnormally and possibly c\norrupted shared memory.\n I have rolled back the current transaction and am going to\nterminate your databa\nse system connection and exit.\n Please reconnect to the database system and repeat your query.\nNOTICE: Message from PostgreSQL backend:\n The Postmaster has informed me that some other backend died\nabnormally and possibly c\norrupted shared memory.\n I have rolled back the current transaction and am going to\nterminate your databa\nse system connection and exit.\n Please reconnect to the database system and repeat your query.\nNOTICE: Message from PostgreSQL backend:\n The Postmaster has informed me that some other backend died\nabnormally and possibly c\norrupted shared memory.\n I have rolled back the current transaction and am going to\nterminate your databa\nse system connection and exit.\n Please reconnect to the database system and repeat your query.\nNOTICE: Message from PostgreSQL backend:\n The Postmaster has informed me that some other backend died\nabnormally and possibly c\norrupted shared memory.\n I have rolled back the current transaction and am going to\nterminate your databa\nse system connection and exit.\n Please reconnect to the database system and repeat your query.\nNOTICE: Message from PostgreSQL backend:\n The Postmaster has informed me that some other backend died\nabnormally and possibly c\norrupted shared memory.\n I have rolled back the current transaction and am going to\nterminate your databa\nse system connection and exit.\n Please reconnect to the database system and repeat your query.\nServer processes were terminated at Thu Jun 7 03:32:53 2001\nReinitializing shared memory and semaphores\nDEBUG: database system was interrupted at 2001-06-07 03:32:47 UTC\nDEBUG: CheckPoint record at (0, 3686817652)\nDEBUG: Redo record at (0, 3686817652); Undo record at (0, 0); Shutdown\nFALSE\nDEBUG: NextTransactionId: 9905192; NextOid: 846112\nDEBUG: database system was not properly shut down; automatic recovery in\nprogress...\nDEBUG: ReadRecord: record with zero len at (0, 3686817716)\nDEBUG: redo is not required\nDEBUG: database system is in production state\n\n\n",
"msg_date": "Fri, 8 Jun 2001 10:55:45 -0400 (EDT)",
"msg_from": "Philip Crotwell <crotwell@seis.sc.edu>",
"msg_from_op": true,
"msg_subject": "unlink large objects"
},
{
"msg_contents": "Philip Crotwell <crotwell@seis.sc.edu> writes:\n> I poked around in the database directory and found a file named 16948 that\n> is 960Mb or almost all of the space on my partition.\n\nThat is pg_largeobject. Vacuuming should recover the lost space; are\nyou sure you've vacuumed it?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 13:45:48 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: unlink large objects "
},
{
"msg_contents": "\nHi\n\nI was vacuuming, but as the owner of the database. When I do that there\nare messages that should have clued me in, lke\n\nNOTICE: Skipping \"pg_largeobject\" --- only table owner can VACUUM it\n\n From now on I will vacuum as user postgres, but I wonder if there is a\nneed for individual users to be able to vacuum large obects by themselves.\nI assume that is problimatic since all large objects are in the same file?\n\nAlso, when the disk is nearly full, I am seeing the database crash while\ntrying to vacuum. \ntimbr pg> vacuumdb scepp\nFATAL 2: ZeroFill(/home/postgres/data/pg_xlog/xlogtemp.7922) failed: No\nspace left on device\npqReadData() -- backend closed the channel unexpectedly.\n This probably means the backend terminated abnormally\n before or while processing the request.\nconnection to server was lost\nvacuumdb: vacuum scepp failed\ntimbr pg> df -k\nFilesystem 1k-blocks Used Available Use% Mounted on\n/dev/hda5 298663 232362 50881 82% /\n/dev/hda1 17534 2482 14147 15% /boot\n/dev/hda7 1111176 1039436 15296 99% /home\ntimbr pg> vacuumdb scepp\npsql: connectDBStart() -- connect() failed: Connection refused\n Is the postmaster running locally\n and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?\nvacuumdb: vacuum scepp failed\n\nAfter this I went to another on of our stations that hasn't been running\nvery long and tried. Now instead of getting smaller the size went up by\n50%!!!\n\n myrtl> df -k\nFilesystem 1k-blocks Used Available Use% Mounted on\n/dev/hda5 417743 320216 75958 81% /\n/dev/hda1 17534 2482 14147 15% /boot\n/dev/hda7 1458400 277884 1106432 20% /home\nmyrtl> su - postgres \nPassword: \ntest> vacuumdb scepp\nVACUUM\ntest> df -k\nFilesystem 1k-blocks Used Available Use% Mounted on\n/dev/hda5 417743 320216 75958 81% /\n/dev/hda1 17534 2482 14147 15% /boot\n/dev/hda7 1458400 419660 964656 30% /home\n\nLooking into the db directory, it seems that the space is in the xlog.\nWhen does this get flushed?\n\ntest> du -sk *\n4 PG_VERSION\n153680 base\n616 global\n8 pg_hba.conf\n4 pg_ident.conf\n262468 pg_xlog\n4 postgresql.conf\n4 postmaster.opts\n4 postmaster.pid\n24 serverlog\n\nI tried to vacuum again, and the space went down to 23% of disk. But still\nworse than before vacuuming.\ntest> vacuumdb scepp\nVACUUM\ntest> df -k\nFilesystem 1k-blocks Used Available Use% Mounted on\n/dev/hda5 417743 320216 75958 81% /\n/dev/hda1 17534 2482 14147 15% /boot\n/dev/hda7 1458400 320804 1063512 23% /home\n\nAny suggestions?\n\nthanks for you help,\nPhilip\n\nOn Fri, 8 Jun 2001, Tom Lane wrote:\n\n> Philip Crotwell <crotwell@seis.sc.edu> writes:\n> > I poked around in the database directory and found a file named 16948 that\n> > is 960Mb or almost all of the space on my partition.\n> \n> That is pg_largeobject. Vacuuming should recover the lost space; are\n> you sure you've vacuumed it?\n> \n> \t\t\tregards, tom lane\n> \n\n\n\n\n\n",
"msg_date": "Sat, 9 Jun 2001 10:13:26 -0400 (EDT)",
"msg_from": "Philip Crotwell <crotwell@seis.sc.edu>",
"msg_from_op": true,
"msg_subject": "Re: unlink large objects "
},
{
"msg_contents": "Philip Crotwell <crotwell@seis.sc.edu> writes:\n> I was vacuuming, but as the owner of the database. When I do that there\n> are messages that should have clued me in, lke\n> NOTICE: Skipping \"pg_largeobject\" --- only table owner can VACUUM it\n\n> From now on I will vacuum as user postgres, but I wonder if there is a\n> need for individual users to be able to vacuum large obects by themselves.\n\nGood point. More generally, it seems like it might be a good idea to\nallow the owner of an individual database to vacuum all the system\ncatalogs in it, even if he's not the superuser. Comments anyone?\n\n> Also, when the disk is nearly full, I am seeing the database crash while\n> trying to vacuum. \n\n From WAL log overflow, no doubt. If you look in the pgsql-patches\narchives from the last week or two, there is a patch to alleviate the\ngrowth of the log.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sat, 09 Jun 2001 12:59:58 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [JDBC] unlink large objects "
},
{
"msg_contents": "> Philip Crotwell <crotwell@seis.sc.edu> writes:\n> > I was vacuuming, but as the owner of the database. When I do that there\n> > are messages that should have clued me in, lke\n> > NOTICE: Skipping \"pg_largeobject\" --- only table owner can VACUUM it\n> \n> > From now on I will vacuum as user postgres, but I wonder if there is a\n> > need for individual users to be able to vacuum large obects by themselves.\n> \n> Good point. More generally, it seems like it might be a good idea to\n> allow the owner of an individual database to vacuum all the system\n> catalogs in it, even if he's not the superuser. Comments anyone?\n\nSeems db owner should be able to do whatever they want to the non-global\nsystem tables.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Sat, 9 Jun 2001 16:32:46 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Re: [JDBC] unlink large objects"
},
{
"msg_contents": "On Sat, 9 Jun 2001, Bruce Momjian wrote:\n\n> > Philip Crotwell <crotwell@seis.sc.edu> writes:\n> > > I was vacuuming, but as the owner of the database. When I do that there\n> > > are messages that should have clued me in, lke\n> > > NOTICE: Skipping \"pg_largeobject\" --- only table owner can VACUUM it\n> > \n> > > From now on I will vacuum as user postgres, but I wonder if there is a\n> > > need for individual users to be able to vacuum large obects by themselves.\n> > \n> > Good point. More generally, it seems like it might be a good idea to\n> > allow the owner of an individual database to vacuum all the system\n> > catalogs in it, even if he's not the superuser. Comments anyone?\n> \n> Seems db owner should be able to do whatever they want to the non-global\n> system tables.\n\nI would suppose that this has already been thought of, but it would be\nreally nice, IMHO, if the \"vacuuming\" could be done continuously by a low\npriority backend thread, like garbabge collection in java. Easier said\nthen done I am sure, but this would mean that it could be done by the\nbackend without having to worry about ownership of system tables.\n\nOn a similar idea, has there been any thought to allowing regular backend\nprocessess to run at lower priority? Either by adopting the callers\npriority if it is local, or by having some way to set a priority. I have\nsome db cleanup tasks that I would like to run as low level background\ntasks, but the backend does all the work at the default top priority.\n\nJust some thoughts,\nthanks,\nPhilip\n\n\n",
"msg_date": "Mon, 11 Jun 2001 22:24:17 -0400 (EDT)",
"msg_from": "Philip Crotwell <crotwell@seis.sc.edu>",
"msg_from_op": true,
"msg_subject": "Re: Re: [JDBC] unlink large objects"
},
{
"msg_contents": "Philip Crotwell <crotwell@seis.sc.edu> writes:\n> On a similar idea, has there been any thought to allowing regular backend\n> processess to run at lower priority?\n\nPeople suggest that from time to time, but it's not an easy thing to do.\nThe problem is priority inversion: low-priority process acquires a lock,\nthen some high-priority process starts to run and wants that lock.\nPresto, high-priority process is now a low-priority waiter.\n\nDetecting priority inversion situations would be difficult, and doing\nanything about them would be even more difficult...\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 12 Jun 2001 19:07:03 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Re: [JDBC] unlink large objects "
}
] |
[
{
"msg_contents": "\n> > The best solution would be to have the ODBC translate instances \nof '=\n> > NULL' into IS NULL before submitting the query to PostgreSQL.\n\nTom Lane wrote:\n\n> Does Access only talk to Postgres via ODBC? (Seems plausible, but \nI\n> don't know.) What about people copying-and-pasting queries \ngenerated\n> by Access; is it even possible?\n\n1. Yes, Access only talkes to Postgres via ODBC.\n\n2. The queries generate by Access which use the '= NULL' vs. 'IS \nNULL' language are only generated through the use of Access Forms, \nwhen some attempts to fetch a record through the forms interface \nwhere the key of the linked table is an empty edit control. When \naccess generates queries, it correctly generates 'IS NULL' language. \nIt is a *very specific problem* WRT the user of Access Forms.\n\n> I doubt that this'd really help much, in any case; it merely moves \nthe\n> necessary switch from the backend to ODBC.\n\nIt seems to me that is where it belongs. The ODBC driver is already \ndoing translation of some Access functions not found in PostgreSQL \nsuch as LCASE->lower, etc. The kludge isn't found in any other RDBMS \nof which I am aware (certainly not Oracle), and yet Access works fine \nwith them,\n\nJust MHO of course,\n\nMike Mascari\nmascarm@mascari.com\n\n\n\t\t\t\n",
"msg_date": "Fri, 8 Jun 2001 11:24:10 -0400",
"msg_from": "Mike Mascari <mascarm@mascari.com>",
"msg_from_op": true,
"msg_subject": "RE: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Standards "
},
{
"msg_contents": "Mike Mascari wrote:\n> \n> > > The best solution would be to have the ODBC translate instances\n> of '=\n> > > NULL' into IS NULL before submitting the query to PostgreSQL.\n> \n> Tom Lane wrote:\n> \n> > Does Access only talk to Postgres via ODBC? (Seems plausible, but\n> I\n> > don't know.) What about people copying-and-pasting queries\n> generated\n> > by Access; is it even possible?\n> \n> 1. Yes, Access only talkes to Postgres via ODBC.\n> \n> 2. The queries generate by Access which use the '= NULL' vs. 'IS\n> NULL' language are only generated through the use of Access Forms,\n> when some attempts to fetch a record through the forms interface\n> where the key of the linked table is an empty edit control. When\n> access generates queries, it correctly generates 'IS NULL' language.\n> It is a *very specific problem* WRT the user of Access Forms.\n> \n\nCould you send me an example using Access Forms ?\nDAO seems to translate '= NULL' into 'IS NULL' properly.\nHmm parameter bindings( expr = ? ) could be the cause.\n\n> > I doubt that this'd really help much, in any case; it merely moves\n> the\n> > necessary switch from the backend to ODBC.\n> \n> It seems to me that is where it belongs. The ODBC driver is already\n> doing translation of some Access functions not found in PostgreSQL\n> such as LCASE->lower, etc.\n\nIt doesn't seem that easy.\nDetecting '= NULL' isn't sufficient.\n'SET .. expr = NULL' mustn't be tranlated into\n'SET .. expr IS NULL'. The '= NULL' must be inside\na where clause.\nUnfortunately the current psqlodbc driver parses\nlittle.\n\nregards,\nHiroshi Inoue\n",
"msg_date": "Thu, 14 Jun 2001 17:01:00 +0900",
"msg_from": "Hiroshi Inoue <Inoue@tpf.co.jp>",
"msg_from_op": false,
"msg_subject": "Re: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Standards"
}
] |
[
{
"msg_contents": "If one runs Postgresql with fsync turned off in order to get better\nperformance, is there a risk that the database internals will be\ndamaged by a system crash? I realize that database discrepancies are\npossible, but I am referring to a failure where storage allocation\ngets messed up, or critical internal pointers get mangled, or\nsomething like that.\n\nWhat I have been able to find so far only addresses data\ndiscrepancies, which are something that we can live with (IF WE REALLY\nHAVE TO).\n\nAlso, if one uses raw disk instead of files, will Postgresql work\nbetter with or without fsync?\n\nFor that matter, how does Postgresql with fsync turned on compare\nperformance/wise to Informix/Oracle for typical OLTP (95% read 5%\nwrite) work?\n\nThanks in advance\n\nJohn Moore\n\nnewsNOSPAM@tinyvital.com\n\n\n",
"msg_date": "Fri, 08 Jun 2001 16:48:01 GMT",
"msg_from": "\"earthlink\" <NOSPAMnews@tinyvital.com>",
"msg_from_op": true,
"msg_subject": "Internal pointers clobbered on system crash without fsync???"
}
] |
[
{
"msg_contents": "Frequently one wants a data set returned in the same order as the\nindex used in the query. Informix (at least) has implicit order-by,\nwhich means that the data will be returned in collating order if the\nquery forces use of the appropriate index.\n\nDoes Postgresql do this?\n\nIf not, does an Order-by force a sort even if an index has the correct\norder to satisfy the order-by?\n\nThanks\n\nJohn Moore\nnewsNOSPAM@tinyvital.com\n\n\n",
"msg_date": "Fri, 08 Jun 2001 16:49:13 GMT",
"msg_from": "\"earthlink\" <NOSPAMnews@tinyvital.com>",
"msg_from_op": true,
"msg_subject": "Implicit order-by in Postgresql?"
},
{
"msg_contents": "earthlink wrote:\n> \n> Frequently one wants a data set returned in the same order as the\n> index used in the query. Informix (at least) has implicit order-by,\n> which means that the data will be returned in collating order if the\n> query forces use of the appropriate index.\n> \n> Does Postgresql do this?\n\nIf data is fetched by walking an index, then , yes it produces an \nimplicit order. Just don't count on it to stay that way - the use of a \nparticular index depends on too many things.\n\n> If not, does an Order-by force a sort even if an index has the correct\n> order to satisfy the order-by?\n\nDropping unneeded sort node from a query tree was one of the earliest \noptimisations in postgresql.\n\n---------------\nHannu\n",
"msg_date": "Tue, 12 Jun 2001 22:50:06 +0500",
"msg_from": "Hannu Krosing <hannu@tm.ee>",
"msg_from_op": false,
"msg_subject": "Re: Implicit order-by in Postgresql?"
}
] |
[
{
"msg_contents": "Hi people,\n\nI've found that some two functions in /src/backend/optimizer/plan/planner.c\nhave side effects.\n\nFirst, I've added two pprints before and after line 89-90 like this.\n\n\n\npprint(parse->rtable);\n\n/* primary planning entry point (may recurse for subqueries) */\nresult_plan = subquery_planner(parse, -1.0 /* default case */);\n\npprint(parse->rtable);\n\n\n\nThen I ran the query \"select * from F1 where fk6 > 50;\" and get this on the\nlog (I put \"<<<<<<\" to highlite the differences)\n\nDEBUG: query: select * from F1 where fk6 > 50;\n(\n { RTE\n :relname f1\n :relid 782787\n :subquery <>\n :alias <>\n :eref\n { ATTR\n :relname f1\n :attrs ( \"pk\" \"fk1\" \"fk2\" \"fk3\" \"fk4\" \"fk5\" \"fk6\" \"valu\n e\" )\n }\n\n :inh true <<<<<<\n :inFromCl true\n :checkForRead true\n :checkForWrite false\n :checkAsUser 0\n }\n)\n(\n { RTE\n :relname f1\n :relid 782787\n :subquery <>\n :alias <>\n :eref\n { ATTR\n :relname f1\n :attrs ( \"pk\" \"fk1\" \"fk2\" \"fk3\" \"fk4\" \"fk5\" \"fk6\" \"valu\n e\" )\n }\n\n :inh false <<<<<<\n :inFromCl true\n :checkForRead true\n :checkForWrite false\n :checkAsUser 0\n }\n)\n\nSo, parse->rtable->inh changes. In the same way I've tested\n\"set_plan_references\" (lines 97-98)\n\n\npprint(parse->jointree);\n\n/* final cleanup of the plan */\nset_plan_references(result_plan);\n\npprint(parse->jointree);\n\n\n\nAgain I ran the query \"select * from F1 where fk6 > 50;\" and get this on the\nlog (I put \"<<<<<<\" to highlite the differences)\n\nDEBUG: query: select * from F1 where fk6 > 50;\n{ FROMEXPR\n :fromlist (\n { RANGETBLREF 1\n }\n )\n\n :quals (\n { EXPR\n :typeOid 16\n :opType op\n :oper\n { OPER\n :opno 521\n :opid 0 <<<<<<<<<<<<<\n :opresulttype 16\n }\n ...\n\n{ FROMEXPR\n :fromlist (\n { RANGETBLREF 1\n }\n )\n\n :quals (\n { EXPR\n :typeOid 16\n :opType op\n :oper\n { OPER\n :opno 521\n :opid 147 <<<<<<<<<<<<<\n :opresulttype 16\n }\n\n\nNow, parse->jointre->opid changes. The odd thing is that\n\"set_plan_references\" does not have \"parse\" as a parameter (!).\n\nI need help to check this again to see if these are actual bugs. Can someone\nhelp me with this? BTW, I'm using the 7.1.1 sources.\n\nSaludos,\nRoberto\n\n---------------------\nA \"No\" uttered from deepest conviction is better and greater than a \"Yes\"\nmerely uttered to please, or what is worse, to avoid trouble. -- Mahatma\nGandhi\n\n\n\n",
"msg_date": "Fri, 8 Jun 2001 17:19:43 -0300",
"msg_from": "\"Roberto Abalde\" <roberto.abalde@galego21.org>",
"msg_from_op": true,
"msg_subject": "Is this a bug?"
},
{
"msg_contents": "\"Roberto Abalde\" <roberto.abalde@galego21.org> writes:\n> I've found that some two functions in /src/backend/optimizer/plan/planner.c\n> have side effects.\n\nNo kidding ;-). The planner is full of side-effects on data structures.\nBoth of the changes you mention are intentional.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 17:55:14 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Is this a bug? "
}
] |
[
{
"msg_contents": "Robert Bruccoleri (bruc@stone.congen.com) wrote:\n> It's not clear to me why the spinlock needs be grabbed at the\n> beginning of RelationGetBufferWithBuffer,\n\nI believe you are right: the spinlock doesn't need to be grabbed,\nbecause if a valid buffer is passed in, it must already be pinned\n(since the returned buffer is expected to be pinned). Hence the check\nfor same-buffer could be done without first grabbing the spinlock.\n\nIn fact, closer analysis reveals a lot of silliness here. There is an\ninherent error in RelationGetBufferWithBuffer: if it allocates a fresh\nbuffer then that buffer gets pinned, but if it returns the passed-in\nbuffer then no extra pin is added. Since the caller does not know which\ncase applies, there must be either a leaked pin or a bogus pin count\ndecrement later on. The reason we see no failure is that the only use\nof this routine is from heapgettup, and it turns out that the passed\nbuffer is *always* either invalid or the target buffer. (I have run the\nregression tests with Asserts in place that confirm this deduction.)\nWhat's more, heapgettup conveniently forgets to decrement the pin count\nof the buffer it passes, thus cancelling out\nRelationGetBufferWithBuffer's failure to increment the pin count. If\nthe target page were ever different from the passed buffer, these errors\nwould not cancel out and we'd have a buffer leak.\n\nI think that we ought to get rid of RelationGetBufferWithBuffer\nentirely, since it is really a broken variant of ReleaseAndReadBuffer.\nWe should add a test to ReleaseAndReadBuffer to short-circuit the work\nif the passed buffer is the same as the requested page, and change the\ncalls in heapgettup to call ReleaseAndReadBuffer instead, which makes\nthe heapam.c code correct not to do its own decrements of the pin count.\n(The handwaving comments in heap_getnext's calls of heapgettup could\nthen be fixed.)\n\nWhile I'm looking at this, I can't help noticing that heapam.c goes to a\nlarge amount of trouble to maintain \"previous\" and \"next\" tuple pointers\nand pins in a seqscan, not only \"current\". These pointers are useless\nexcept in the very unusual case where one steps forward and then back\nin a sequential scan (for example, \"FETCH 1; FETCH BACKWARD 1;\" in a\ncursor). It seems to me that this is wrongheaded. We could simplify\nand speed up the normal case by maintaining only a \"current\" pointer,\nwhich would be well worth the extra work in the forward/back step case.\n\nComments, objections?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 08 Jun 2001 17:35:08 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": true,
"msg_subject": "Various silliness in heap_getnext and related routines"
},
{
"msg_contents": "Dear Tom,\n> \n> \n> Robert Bruccoleri (bruc@stone.congen.com) wrote:\n> > It's not clear to me why the spinlock needs be grabbed at the\n> > beginning of RelationGetBufferWithBuffer,\n> \n> I believe you are right: the spinlock doesn't need to be grabbed,\n> because if a valid buffer is passed in, it must already be pinned\n> (since the returned buffer is expected to be pinned). Hence the check\n> for same-buffer could be done without first grabbing the spinlock.\n\nFor my immediate problem, would removing the spinlock acquisition\nbe OK?\n\nThanks for looking into this problem.\n\nSincerely,\nBob\n\n+----------------------------------+------------------------------------+\n| Robert E. Bruccoleri, Ph.D. | Phone: 609 737 6383 |\n| President, Congenomics, Inc. | Fax: 609 737 7528 |\n| 114 W Franklin Ave, Suite K1,4,5 | email: bruc@acm.org |\n| P.O. Box 314 | URL: http://www.congen.com/~bruc |\n| Pennington, NJ 08534 | |\n+----------------------------------+------------------------------------+\n",
"msg_date": "Sat, 9 Jun 2001 12:28:53 -0400 (EDT)",
"msg_from": "bruc@stone.congenomics.com (Robert E. Bruccoleri)",
"msg_from_op": false,
"msg_subject": "Re: Various silliness in heap_getnext and related routines"
},
{
"msg_contents": "bruc@stone.congenomics.com (Robert E. Bruccoleri) writes:\n> For my immediate problem, would removing the spinlock acquisition\n> be OK?\n\nIt'd be interesting to remove the marked lines:\n\n\t bufHdr = &BufferDescriptors[buffer - 1];\n-\t SpinAcquire(BufMgrLock);\n\t if (bufHdr->tag.blockNum == blockNumber &&\n\t RelFileNodeEquals(bufHdr->tag.rnode, relation->rd_node))\n\t {\n-\t SpinRelease(BufMgrLock);\n\t return buffer;\n\t }\n-\t return ReadBufferWithBufferLock(relation, blockNumber, true);\n\nand see how that affects your performance issue, if at all.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sat, 09 Jun 2001 12:53:28 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Various silliness in heap_getnext and related routines "
},
{
"msg_contents": "Dear Tom,\n> \n> \n> bruc@stone.congenomics.com (Robert E. Bruccoleri) writes:\n> > For my immediate problem, would removing the spinlock acquisition\n> > be OK?\n> \n> It'd be interesting to remove the marked lines:\n> \n> \t bufHdr = &BufferDescriptors[buffer - 1];\n> -\t SpinAcquire(BufMgrLock);\n> \t if (bufHdr->tag.blockNum == blockNumber &&\n> \t RelFileNodeEquals(bufHdr->tag.rnode, relation->rd_node))\n> \t {\n> -\t SpinRelease(BufMgrLock);\n> \t return buffer;\n> \t }\n> -\t return ReadBufferWithBufferLock(relation, blockNumber, true);\n> \n> and see how that affects your performance issue, if at all.\n> \n\nI have made those changes, ran the regression tests, and then issued\neight simultaneous retrieval jobs against the database. Performance is\nnow greatly improved with all the jobs making quick progress through\nthe sequential query and completing in very reasonable times.\n\nThanks very much for your help.\n\nBTW, given the high level of support that you provide to the PostgreSQL\ncommunity, it's very accurate to state that support for PostgreSQL\nis far superior to that of Oracle, especially for SGI systems.\n\nSincerely,\nBob\n\n+----------------------------------+------------------------------------+\n| Robert E. Bruccoleri, Ph.D. | Phone: 609 737 6383 |\n| President, Congenomics, Inc. | Fax: 609 737 7528 |\n| 114 W Franklin Ave, Suite K1,4,5 | email: bruc@acm.org |\n| P.O. Box 314 | URL: http://www.congen.com/~bruc |\n| Pennington, NJ 08534 | |\n+----------------------------------+------------------------------------+\n",
"msg_date": "Mon, 11 Jun 2001 12:04:05 -0400 (EDT)",
"msg_from": "bruc@stone.congenomics.com (Robert E. Bruccoleri)",
"msg_from_op": false,
"msg_subject": "Re: Various silliness in heap_getnext and related routines"
},
{
"msg_contents": "bruc@stone.congenomics.com (Robert E. Bruccoleri) writes:\n> BTW, given the high level of support that you provide to the PostgreSQL\n> community, it's very accurate to state that support for PostgreSQL\n> is far superior to that of Oracle, especially for SGI systems.\n\nIt's all about having the source code available, I think. After all,\nit was you who identified the location of the problem...\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 11 Jun 2001 12:06:32 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Various silliness in heap_getnext and related routines "
},
{
"msg_contents": "Dear Tom,\n> \n> \n> bruc@stone.congenomics.com (Robert E. Bruccoleri) writes:\n> > BTW, given the high level of support that you provide to the PostgreSQL\n> > community, it's very accurate to state that support for PostgreSQL\n> > is far superior to that of Oracle, especially for SGI systems.\n> \n> It's all about having the source code available, I think. After all,\n> it was you who identified the location of the problem...\n\nYes, but it's not just having the source code. Although I could see\na potential problem, it was your knowledge of the source code to recommend\na patch that worked immediately, and your willingness to help\nthat together makes PostgreSQL support so good. The same knowledge and\nhelpful attitude applies to all the PostgreSQL developers.\n\nThanks. --Bob\n\n+----------------------------------+------------------------------------+\n| Robert E. Bruccoleri, Ph.D. | Phone: 609 737 6383 |\n| President, Congenomics, Inc. | Fax: 609 737 7528 |\n| 114 W Franklin Ave, Suite K1,4,5 | email: bruc@acm.org |\n| P.O. Box 314 | URL: http://www.congen.com/~bruc |\n| Pennington, NJ 08534 | |\n+----------------------------------+------------------------------------+\n",
"msg_date": "Mon, 11 Jun 2001 12:21:56 -0400 (EDT)",
"msg_from": "bruc@stone.congenomics.com (Robert E. Bruccoleri)",
"msg_from_op": false,
"msg_subject": "Re: Various silliness in heap_getnext and related routines"
},
{
"msg_contents": "On Mon, Jun 11, 2001 at 12:21:56PM -0400, Robert E. Bruccoleri wrote:\n> Dear Tom,\n> > \n> > \n> > bruc@stone.congenomics.com (Robert E. Bruccoleri) writes:\n> > > BTW, given the high level of support that you provide to the PostgreSQL\n> > > community, it's very accurate to state that support for PostgreSQL\n> > > is far superior to that of Oracle, especially for SGI systems.\n> > \n> > It's all about having the source code available, I think. After all,\n> > it was you who identified the location of the problem...\n> \n> Yes, but it's not just having the source code. Although I could see\n> a potential problem, it was your knowledge of the source code to recommend\n> a patch that worked immediately, and your willingness to help\n> that together makes PostgreSQL support so good. The same knowledge and\n> helpful attitude applies to all the PostgreSQL developers.\n\nGee, guys, I'm tearing up here. ;-)\n\nsniff - \n\nRoss\n\n",
"msg_date": "Mon, 18 Jun 2001 19:28:41 -0500",
"msg_from": "\"Ross J. Reedstrom\" <reedstrm@rice.edu>",
"msg_from_op": false,
"msg_subject": "Re: Re: Various silliness in heap_getnext and related routines"
},
{
"msg_contents": "> > Yes, but it's not just having the source code. Although I could see\n> > a potential problem, it was your knowledge of the source code to recommend\n> > a patch that worked immediately, and your willingness to help\n> > that together makes PostgreSQL support so good. The same knowledge and\n> > helpful attitude applies to all the PostgreSQL developers.\n> \n> Gee, guys, I'm tearing up here. ;-)\n> \n> sniff - \n\nLet's have a group hug...\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 18 Jun 2001 21:11:06 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Re: Various silliness in heap_getnext and related routines"
}
] |
[
{
"msg_contents": "\tI'm running into some strange behavior with foreign keys which are a\ntuple of primary keys.\n\n\nI have a parent table sector, and a child of that is cell_area table and a\nchild of that is unit table.\n\nThe cell_area table has a foreign key parent_sector_index referencing same\nname in parent table sector.\n\nThe unit table has a foreign key, parent_cell_area_index, and\nparent_sector_index referencing same names in its parent sector and\ncell_area.\n\nThe primary key of each table is the composite of the foreign keys as well\nas it's own index, therefore it's possible to have, for example, in the\ncell-area table, to have several entries of the same index, say 1, as long\nas the parent_sector_index is different for each. So we could have for the\ncell_area table (1,1) (1,2) (1,3), as the primary key tuple.\n\nThe same thing applies to the lowest level table, the unit table, which is a\n3 tuple of its own index, plus the parent_cell_area_index, plus the\nparent_sector_index.\n\nCascading deletes are turned off, and I have implemented my own trigger that\nwill delete the children, say for example when the cell_area is deleted, my\ntrigger will delete the children in the unit table, that have the same\nparent_sector_index, and that have that specific cell_area as its\nparent_cell_area.\n\n\tHere's the problem. If there are more than one entry in the\ncell_area table with the same index, then I receive a referential integrity\nviolation when I try to remove the cell_area of (1,1), even though, based\nupon the primary key tuple as explained above, there are no children that\nreference it.\n\tFor example, if I have in the cell_area table (cell_area_index,\nparent_sector_index) and the values are (1,1) (1,2) (1,3), and have in its\nchild table which is the unit table (unit_index, parent_cell_area_index,\nparent_sector_index) and the values (1, 1, 2) (1,1,3), so that those 3\ntuples refer to items 2 and 3 of the set shown in the first part of this\nparagraph, and none refer to the first item which is (1,1), then when I try\nto delete the cell_area of (1,1) I get a referential integrity violation\nbecause it sees that the child which is the unit table has foreign keys\nreferencing the cell_area_index of 1 which is the same cell_area_index I am\ndeleting. But note that ALL of the items still in cell_area also have their\ncell_area_index at 1, so the referential integrity constraint should not\nfail since they are still referring to that \"1\". Also note that the other\nforeign keys in the children are not referencing any other of the tuples in\nthe parent, so the item I am trying to delete is not being referenced by\nanything.\n\n\tI have tried turning on DEFERRED constraint checks so that it would\nnot check to see that that index of \"1\" was being deleted but still same\nproblem.\n\n\tIf I leave everything else the same but remove the parent_cell_area\nfrom the unit table as a foreign key (this removing the check for\nreferential integrity on that one column only), then it deletes just fine.\n\n\tIt seems that the check for referential integrity doesn't check to\nsee that there are other items in the parent columns that have the same\nvalue which would still let the integrity pass.\n\nAny comments? Please ;-)\n\nMike\n\n",
"msg_date": "Fri, 8 Jun 2001 18:40:26 -0700 ",
"msg_from": "Mike Cianflone <mcianflone@littlefeet-inc.com>",
"msg_from_op": true,
"msg_subject": "Strange behavior on multiple primary key behavior deleting childr en"
},
{
"msg_contents": "\nOn Fri, 8 Jun 2001, Mike Cianflone wrote:\n\n> \tI'm running into some strange behavior with foreign keys which are a\n> tuple of primary keys.\n> \n> \n> I have a parent table sector, and a child of that is cell_area table and a\n> child of that is unit table.\n> \n> The cell_area table has a foreign key parent_sector_index referencing same\n> name in parent table sector.\n> \n> The unit table has a foreign key, parent_cell_area_index, and\n> parent_sector_index referencing same names in its parent sector and\n> cell_area.\n> \n> The primary key of each table is the composite of the foreign keys as well\n> as it's own index, therefore it's possible to have, for example, in the\n> cell-area table, to have several entries of the same index, say 1, as long\n> as the parent_sector_index is different for each. So we could have for the\n> cell_area table (1,1) (1,2) (1,3), as the primary key tuple.\n> \n> The same thing applies to the lowest level table, the unit table, which is a\n> 3 tuple of its own index, plus the parent_cell_area_index, plus the\n> parent_sector_index.\n> \n> Cascading deletes are turned off, and I have implemented my own trigger that\n> will delete the children, say for example when the cell_area is deleted, my\n> trigger will delete the children in the unit table, that have the same\n> parent_sector_index, and that have that specific cell_area as its\n> parent_cell_area.\n> \n> \tHere's the problem. If there are more than one entry in the\n> cell_area table with the same index, then I receive a referential integrity\n> violation when I try to remove the cell_area of (1,1), even though, based\n> upon the primary key tuple as explained above, there are no children that\n> reference it.\n> \tFor example, if I have in the cell_area table (cell_area_index,\n> parent_sector_index) and the values are (1,1) (1,2) (1,3), and have in its\n> child table which is the unit table (unit_index, parent_cell_area_index,\n> parent_sector_index) and the values (1, 1, 2) (1,1,3), so that those 3\n> tuples refer to items 2 and 3 of the set shown in the first part of this\n> paragraph, and none refer to the first item which is (1,1), then when I try\n> to delete the cell_area of (1,1) I get a referential integrity violation\n> because it sees that the child which is the unit table has foreign keys\n> referencing the cell_area_index of 1 which is the same cell_area_index I am\n> deleting. But note that ALL of the items still in cell_area also have their\n> cell_area_index at 1, so the referential integrity constraint should not\n> fail since they are still referring to that \"1\". Also note that the other\n> foreign keys in the children are not referencing any other of the tuples in\n> the parent, so the item I am trying to delete is not being referenced by\n> anything.\n\nHow is the unit table references created?\nAre they:\n(1)\n cell_area_index -> cell_area(cell_area_index)\n parent_sector_index-> sector(parent_sector_index)\n\n(2)\n (cell_area_index, parent_sector_index) -> cell_area(c_a_i, p_s_i)\n parent_sector_index-> sector(parent_sector_index)\n\n\nIf 1, then what version are you running. That's not technically a legal\nreferences constraint, but that wasn't checked under 7.0.x. The target\ncols of the constraint *MUST* belong to a unique or primary key constraint\nthat have no additional columns. Try 2 instead.\n\nIf 2, can you send the schema and data file to set this up from start\nstate?\n\n",
"msg_date": "Fri, 8 Jun 2001 19:27:18 -0700 (PDT)",
"msg_from": "Stephan Szabo <sszabo@megazone23.bigpanda.com>",
"msg_from_op": false,
"msg_subject": "Re: Strange behavior on multiple primary key behavior\n\tdeleting childr en"
}
] |
[
{
"msg_contents": "\nI had a baby girl on Tuesday. I am working through my backlogged emails\ntoday.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Sat, 9 Jun 2001 18:30:43 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Baby girl"
},
{
"msg_contents": "On Sat, 9 Jun 2001, Bruce Momjian wrote:\n\n>\n> I had a baby girl on Tuesday. I am working through my backlogged emails\n> today.\n\nCongrats papa! Enjoy a cigar for me (either real or chocolate, your\nchoice :)\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net\n 56K Nationwide Dialup from $16.00/mo at Pop4 Networking\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n",
"msg_date": "Sat, 9 Jun 2001 18:50:39 -0400 (EDT)",
"msg_from": "Vince Vielhaber <vev@michvhf.com>",
"msg_from_op": false,
"msg_subject": "Re: Baby girl"
},
{
"msg_contents": "Bruce Momjian wrote:\n> \n> I had a baby girl on Tuesday. I am working through my backlogged emails\n> today.\n\nGreat news. Get some sleep. lol.\n",
"msg_date": "Sat, 09 Jun 2001 19:41:31 -0400",
"msg_from": "mlw <markw@mohawksoft.com>",
"msg_from_op": false,
"msg_subject": "Re: Baby girl"
},
{
"msg_contents": "On Saturday 09 June 2001 18:30, Bruce Momjian wrote:\n> I had a baby girl on Tuesday. I am working through my backlogged emails\n> today.\n\nFirst girl, Bruce? You have three boys now, IIRC.\n\nAs a dad of one boy and two girls, let me tell you -- while a son means more \nto his dad than the dad can ever say, a daughter will grab her father's heart \nin a way that he never realized it could be grabbed. Trust me. :-) It's one \nthing to hear your son say 'I love you Dada' for the first time -- it's a \nwhole 'nother ball game when your daughter says it.\n\nThe young men who try to date my two girls are going to picked over like so \nmany RPM dependencies.... :->\n--\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n",
"msg_date": "Sat, 9 Jun 2001 21:57:14 -0400",
"msg_from": "Lamar Owen <lamar.owen@wgcr.org>",
"msg_from_op": false,
"msg_subject": "Re: Baby girl"
},
{
"msg_contents": "> On Saturday 09 June 2001 18:30, Bruce Momjian wrote:\n> > I had a baby girl on Tuesday. I am working through my backlogged emails\n> > today.\n> \n> First girl, Bruce? You have three boys now, IIRC.\n\nIt was a shocker to have a girl. I had all boys, and most of my\nextended family had all boys, or all girls. I have the first mixed sex\ngroup of children in quite a while.\n\n> As a dad of one boy and two girls, let me tell you -- while a son means more \n> to his dad than the dad can ever say, a daughter will grab her father's heart \n> in a way that he never realized it could be grabbed. Trust me. :-) It's one \n> thing to hear your son say 'I love you Dada' for the first time -- it's a \n> whole 'nother ball game when your daughter says it.\n> \n> The young men who try to date my two girls are going to picked over like so \n> many RPM dependencies.... :->\n\nI hear you. People say raising girls is harder than boys but I have\nmanaged my wife for 12 years so I am not concerned. :-)\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Sat, 9 Jun 2001 22:00:11 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Baby girl"
},
{
"msg_contents": "I'm afraid you're going to have to give her quite a few more kisses, one for\neverybody on the postgres list. ;-)\n\n----- Original Message -----\nFrom: \"Bruce Momjian\" <pgman@candle.pha.pa.us>\nTo: \"Lamar Owen\" <lamar.owen@wgcr.org>\nCc: \"PostgreSQL-development\" <pgsql-hackers@postgresql.org>\nSent: Sunday, June 10, 2001 3:00 AM\nSubject: Re: [HACKERS] Baby girl\n\n\n> > On Saturday 09 June 2001 18:30, Bruce Momjian wrote:\n> > > I had a baby girl on Tuesday. I am working through my backlogged\nemails\n> > > today.\n> >\n> > First girl, Bruce? You have three boys now, IIRC.\n>\n> It was a shocker to have a girl. I had all boys, and most of my\n> extended family had all boys, or all girls. I have the first mixed sex\n> group of children in quite a while.\n>\n> > As a dad of one boy and two girls, let me tell you -- while a son means\nmore\n> > to his dad than the dad can ever say, a daughter will grab her father's\nheart\n> > in a way that he never realized it could be grabbed. Trust me. :-)\nIt's one\n> > thing to hear your son say 'I love you Dada' for the first time -- it's\na\n> > whole 'nother ball game when your daughter says it.\n> >\n> > The young men who try to date my two girls are going to picked over like\nso\n> > many RPM dependencies.... :->\n>\n> I hear you. People say raising girls is harder than boys but I have\n> managed my wife for 12 years so I am not concerned. :-)\n>\n> --\n> Bruce Momjian | http://candle.pha.pa.us\n> pgman@candle.pha.pa.us | (610) 853-3000\n> + If your life is a hard drive, | 830 Blythe Avenue\n> + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n>\n> ---------------------------(end of broadcast)---------------------------\n> TIP 2: you can get off all lists at once with the unregister command\n> (send \"unregister YourEmailAddressHere\" to majordomo@postgresql.org)\n>\n>\n\n",
"msg_date": "Sun, 10 Jun 2001 16:36:10 +0100",
"msg_from": "<james@spunkysoftware.com>",
"msg_from_op": false,
"msg_subject": "Re: Baby girl"
},
{
"msg_contents": "Bruce Momjian wrote:\n>\n> I had a baby girl on Tuesday. I am working through my backlogged emails\n> today.\n\n Congrats and all the best to Chritine.\n\n\nJan\n\n--\n\n#======================================================================#\n# It's easier to get forgiveness for being wrong than for being right. #\n# Let's break this rule - forgive me. #\n#================================================== JanWieck@Yahoo.com #\n\n\n\n_________________________________________________________\nDo You Yahoo!?\nGet your free @yahoo.com address at http://mail.yahoo.com\n\n",
"msg_date": "Mon, 11 Jun 2001 09:24:22 -0400 (EDT)",
"msg_from": "Jan Wieck <JanWieck@Yahoo.com>",
"msg_from_op": false,
"msg_subject": "Re: Baby girl"
},
{
"msg_contents": "> Bruce Momjian wrote:\n> >\n> > I had a baby girl on Tuesday. I am working through my backlogged emails\n> > today.\n> \n> Congrats and all the best to Chritine.\n\nI do have a picture on my homepage under News:\n\n\thttp://candle.pha.pa.us/main/family/67.html\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 11 Jun 2001 12:14:45 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Baby girl"
}
] |
[
{
"msg_contents": "ChangeLogs$ ls -1\nChangeLog-7.1-7.1.1\nChangeLog-7.1RC1-to-7.1RC2\nChangeLog-7.1RC2-to-7.1RC3\nChangeLog-7.1RC3-to-7.1rc4\nChangeLog-7.1beta1-to-7.1beta3\nChangeLog-7.1beta3-to-7.1beta4\nChangeLog-7.1beta4-to-7.1beta5\nChangeLog-7.1beta5-to-7.1beta6\nChangeLog-7.1beta6-7.1RC1\nChangeLog-7.1rc4-7.1\n\nIs this still of interest? Why isn't there one for 7.1.2?\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Sun, 10 Jun 2001 01:05:41 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": true,
"msg_subject": "ChangeLogs"
},
{
"msg_contents": "> ChangeLogs$ ls -1\n> ChangeLog-7.1-7.1.1\n> ChangeLog-7.1RC1-to-7.1RC2\n> ChangeLog-7.1RC2-to-7.1RC3\n> ChangeLog-7.1RC3-to-7.1rc4\n> ChangeLog-7.1beta1-to-7.1beta3\n> ChangeLog-7.1beta3-to-7.1beta4\n> ChangeLog-7.1beta4-to-7.1beta5\n> ChangeLog-7.1beta5-to-7.1beta6\n> ChangeLog-7.1beta6-7.1RC1\n> ChangeLog-7.1rc4-7.1\n> \n> Is this still of interest? Why isn't there one for 7.1.2?\n\nMarc generates these. I suppose he forgot for 7.1.2.\n\nI don't think we can carry a 7.2 log because it would be too large. I\nsuggest we clear this out for 7.2 and start again after the first beta. \nMarc has to make that decision. Of course, there is no rush because 7.2\nis quite far off.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Sat, 9 Jun 2001 21:20:23 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: ChangeLogs"
}
] |
[
{
"msg_contents": "Awhile ago, I remember discussion about having a 'cstring' datatype in\npgsql with builtin understanding that to convert to cstring you need to\nuse xxx_out and to convert from cstring you need to use yyy_in.\n\nAnything came out of this discussion? It seems it'd be a great way to\nhave easiest datatype conversions where its possible at all.\n(I.E. data::foo::cstring::bar would do (essentially) bar_in(foo_out(data))\n\nThanks \n-alex\n\n",
"msg_date": "Sat, 9 Jun 2001 22:31:59 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "cstring datatype"
},
{
"msg_contents": "Alex Pilosov <alex@pilosoft.com> writes:\n> Anything came out of this discussion?\n\nNothing's been done yet, but it still seems like a good idea.\n\nThere are a number of related issues that I'd want to see tackled\nat the same time, all arising from the overuse of type OID zero to\nmean several different things.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sat, 09 Jun 2001 23:05:56 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: cstring datatype "
}
] |
[
{
"msg_contents": "Hi,\n\nI noticed that postgresql won't ever use a merge join when dealing with\ninet types (for t1.ip=t2.ip, where merge is definitely the best method).\nDelving into pg_operator, it appears that = for inet datatype is not\ncreated with any left_sort_op/right_sort_op and thus won't merge won't be\npossible. To me, this looks like an oversight, as (at least for inet\ntype), network_eq should be able to properly sort the data.\n\nAnyone up to modify the catalog accordingly for 7.2?\n\n(For cidr datatype this doesn't exactly apply, I think, because of all the\ntrickery with netmasks, network_eq may not properly sort the cidr data. I\nneed to think more about this)\n\n\nThanks\n-alex\n\n\n",
"msg_date": "Sat, 9 Jun 2001 22:51:39 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "inet type/merge joins"
},
{
"msg_contents": "Hate to reply to my own email, but now that I started thinking about\nthis, there are few more things about network types in catalog that should\nbe fixed:\n\na) inet and cidr should be hashable (they are memset'd on input, and the\nonly way values are equal is for their binary representations to be\nequal). All necessary stuff appears to be already in pg_amop. \n\nb) both inet and cidr should be merge-joinable for operator = using\nnetwork_lt as sorting function. \n\nI'm also thinking that <<, <<=, etc functions must be using an index, but\nI'm still trying to understand the way pg_operator, pg_amop, pg_amproc all\nfit together...\n\n\nOn Sat, 9 Jun 2001, Alex Pilosov wrote:\n\n> Hi,\n> \n> I noticed that postgresql won't ever use a merge join when dealing with\n> inet types (for t1.ip=t2.ip, where merge is definitely the best method).\n> Delving into pg_operator, it appears that = for inet datatype is not\n> created with any left_sort_op/right_sort_op and thus won't merge won't be\n> possible. To me, this looks like an oversight, as (at least for inet\n> type), network_eq should be able to properly sort the data.\n> \n> Anyone up to modify the catalog accordingly for 7.2?\n> \n> (For cidr datatype this doesn't exactly apply, I think, because of all the\n> trickery with netmasks, network_eq may not properly sort the cidr data. I\n> need to think more about this)\n> \n> \n> Thanks\n> -alex\n> \n> \n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 3: if posting/reading through Usenet, please send an appropriate\n> subscribe-nomail command to majordomo@postgresql.org so that your\n> message can get through to the mailing list cleanly\n> \n> \n\n\n",
"msg_date": "Sun, 10 Jun 2001 02:51:54 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "Re: inet type/merge joins"
},
{
"msg_contents": "Alex Pilosov <alex@pilosoft.com> writes:\n> a) inet and cidr should be hashable\n\nThat's not safe. The critical requirement for hashability (in its\npresent implementation) is that two values with distinct bit patterns\nmust never compare as equal. This is not true for inet/cidr, since\nthe comparison function doesn't pay attention to the 'type' field\n(inet vs. cidr).\n\nAt some point it'd be nice to use type-specific hash functions for\nhashjoin --- we support 'em for hash indexes, and I don't see why the\njoin mechanism should not use the same functions. With that, it'd be\npossible to overcome this problem by making a hash function that has\nthe same blind spots as the comparison function ...\n\nBut you're right that the network types should be mergejoinable;\nanything that supports btree indexes ought to be mergejoinable.\nI see a couple of similar omissions now that I look. Will fix.\n\n> I'm also thinking that <<, <<=, etc functions must be using an index, but\n> I'm still trying to understand the way pg_operator, pg_amop, pg_amproc all\n> fit together...\n\nI think you'd be better off to hack these into the \"special index\noperator\" stuff in optimizer/path/indxpath.c. Adding to pg_amop\nwould only be appropriate for something that you could define in a\ndatatype-independent fashion.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sun, 10 Jun 2001 12:26:44 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: inet type/merge joins "
},
{
"msg_contents": "Alex Pilosov <alex@pilosoft.com> writes:\n>> At some point it'd be nice to use type-specific hash functions for\n>> hashjoin --- we support 'em for hash indexes, and I don't see why the\n>> join mechanism should not use the same functions. With that, it'd be\n>> possible to overcome this problem by making a hash function that has\n>> the same blind spots as the comparison function ...\n\n> I guess the idea is to add a hash function to a catalog of a type\n> definition is a good idea?\n\nEither that, or replace the oprcanhash boolean field of pg_operator\nby an OID field that links to the appropriate hash function. Not sure\noffhand which is better.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sun, 10 Jun 2001 12:42:19 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: inet type/merge joins "
},
{
"msg_contents": "On Sun, 10 Jun 2001, Tom Lane wrote:\n\n> Alex Pilosov <alex@pilosoft.com> writes:\n> > a) inet and cidr should be hashable\n> \n> That's not safe. The critical requirement for hashability (in its\n> present implementation) is that two values with distinct bit patterns\n> must never compare as equal. This is not true for inet/cidr, since\n> the comparison function doesn't pay attention to the 'type' field\n> (inet vs. cidr).\nOops. I forgot about that field. \n\n> At some point it'd be nice to use type-specific hash functions for\n> hashjoin --- we support 'em for hash indexes, and I don't see why the\n> join mechanism should not use the same functions. With that, it'd be\n> possible to overcome this problem by making a hash function that has\n> the same blind spots as the comparison function ...\n\nI guess the idea is to add a hash function to a catalog of a type\ndefinition is a good idea?\n\n> But you're right that the network types should be mergejoinable;\n> anything that supports btree indexes ought to be mergejoinable.\n> I see a couple of similar omissions now that I look. Will fix.\n> \n> > I'm also thinking that <<, <<=, etc functions must be using an index, but\n> > I'm still trying to understand the way pg_operator, pg_amop, pg_amproc all\n> > fit together...\n> \n> I think you'd be better off to hack these into the \"special index\n> operator\" stuff in optimizer/path/indxpath.c. Adding to pg_amop\n> would only be appropriate for something that you could define in a\n> datatype-independent fashion.\nThanks for pointer, I'll try to have a patch later :)\n\n",
"msg_date": "Sun, 10 Jun 2001 12:44:51 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "Re: inet type/merge joins "
}
] |
[
{
"msg_contents": "Is there any reason to EVER call pg_fsync?\n\nWhat would happen if we always called pg_fdatasync?\n\nJust curious, is there a reason why we would always want the meta data updated\nfor each block update? Does postgres use it? Wouldn't the replacement of fsync\nwith fdatasync increase performance on all platforms which support the\ndifference?\n\nAre there any reasons not to?\n",
"msg_date": "Sun, 10 Jun 2001 13:38:50 -0400",
"msg_from": "mlw <markw@mohawksoft.com>",
"msg_from_op": true,
"msg_subject": "fsync vs fdatasync"
},
{
"msg_contents": "On Sun, 10 Jun 2001, mlw wrote:\n\n> Is there any reason to EVER call pg_fsync?\n>\n> What would happen if we always called pg_fdatasync?\n\nIn theory, nothing. I believe SUS guarantees that fdatasync\nwill flush all data and metadata to disk, _except_ perhaps\ninode access/change/modify times. This means file size,\npermissions, ownership and indirect blocks (or whatever is\nrelevant to your filesystem).\n\nThus, unless you need the timestamps to be accurate, it is\nalways safe.\n\nUnfortunately, there are (said to be -- I couldn't name one)\nimplementations which predate this (fairly sane) semantic,\nand flush only file contents.\n\nI think that use of fsync is wise on occasion. If we know\nthat (for example) we've extended the file, then fdatasync\nwill behave as fsync on SUS-conformant platforms, and will\nrisk data loss on non-conformant platforms.\n\nMatthew.\n\n",
"msg_date": "Sun, 10 Jun 2001 19:58:30 +0100 (BST)",
"msg_from": "Matthew Kirkwood <matthew@hairy.beasts.org>",
"msg_from_op": false,
"msg_subject": "Re: fsync vs fdatasync"
},
{
"msg_contents": "mlw <markw@mohawksoft.com> writes:\n> Wouldn't the replacement of fsync with fdatasync increase performance\n> on all platforms which support the difference?\n\nWe already prefer fdatasync where available, in performance-critical\npathways.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sun, 10 Jun 2001 16:04:51 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: fsync vs fdatasync "
}
] |
[
{
"msg_contents": "Hi,\n\ntoday I had a little problem with the actual JDBC driver. Due to the use of Runtime.addShutdownHooks(), which throws a SecurityException if used within a servlet container (WebLogic Server 5.1 & 6.0), the postgres JDBC driver is unusable in this environments. I spent some minutes looking at the code and came to the conclusion, that ConnectionHook should TRY to register itself, but without the sufficient permissions it should go on without throwing exceptions.\n\nThe modified ConnectionHook worked fine for me and my application operates very well from within the WLS container.\n\nWith regards,\n Ralf E. Stranzenbach\n\n\n\n\n\n\n\n\nHi,\n \ntoday I had a little problem with the actual \nJDBC driver. Due to the use of Runtime.addShutdownHooks(), which throws a \nSecurityException if used within a servlet container (WebLogic Server 5.1 & \n6.0), the postgres JDBC driver is unusable in this environments. I spent some \nminutes looking at the code and came to the conclusion, that ConnectionHook \nshould TRY to register itself, but without the sufficient permissions it should \ngo on without throwing exceptions.\n \nThe modified ConnectionHook worked fine for me and \nmy application operates very well from within the WLS container.\n \nWith regards,\n Ralf E. \nStranzenbach",
"msg_date": "Sun, 10 Jun 2001 22:49:09 +0200",
"msg_from": "\"Ralf Edmund Stranzenbach\" <ralf@reswi.de>",
"msg_from_op": true,
"msg_subject": "JDBC: Runtime.addShutdoiwnHooks()"
}
] |
[
{
"msg_contents": "\n> From Andreas' comments, it seems that for his application he would like\n> a different behavior, but frankly I'm not certain why the current\n> behavior would be detrimental in the use case he mentioned. If SQL92\n> requires that any query with \"= NULL\" be rejected as illegal\n\nYou don't mean me, no ? My comment was intended to give an argument *for*\nallowing \"= NULL\" to behave like \"IS NULL\", by saying that the \"= NULL\"\nsyntax is not defined directly (which Tom Ivar corrected), and would thus \nonly be an extension. \nTom Lane on the other hand said, that the standard only states NULL as a \nconstant for a comparison when properly cast to a datatype.\n\nAndreas\n",
"msg_date": "Mon, 11 Jun 2001 09:05:07 +0200",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL v s. Stand\n ards"
},
{
"msg_contents": "> You don't mean me, no ? My comment was intended to give an argument *for*\n> allowing \"= NULL\" to behave like \"IS NULL\", by saying that the \"= NULL\"\n> syntax is not defined directly (which Tom Ivar corrected), and would thus\n> only be an extension.\n> Tom Lane on the other hand said, that the standard only states NULL as a\n> constant for a comparison when properly cast to a datatype.\n\n:) That's the great thing about a long discussion: at the end I'm\nconfused about who wants what! Anyway, istm that until we have a\ncomprehensive solution for the original problem (badly formed queries\nfrom Access going through ODBC) there is more downside to removing the\nextension than there is in keeping it.\n\nDoes anyone know what other ODBC drivers look like internally? Do some\nof them do extensive parsing of input queries (to reliably detect the \"=\nNULL\" construct), or are they \"lightweight\" like ours seems to be?\n\n - Thomas\n",
"msg_date": "Tue, 12 Jun 2001 14:01:02 +0000",
"msg_from": "Thomas Lockhart <lockhart@fourpalms.org>",
"msg_from_op": false,
"msg_subject": "Re: AW: Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. \n\tStand ards"
}
] |
[
{
"msg_contents": "> These pointers are useless\n> except in the very unusual case where one steps forward and then back\n> in a sequential scan (for example, \"FETCH 1; FETCH BACKWARD 1;\" in a\n> cursor).\n\nActually I think it should be known whether a fetch backward is actually\nallowed for a particular cursor, since it usually needs to be declared \nas a scroll cursor explicitly. \n\n> It seems to me that this is wrongheaded. We could simplify\n> and speed up the normal case by maintaining only a \"current\" pointer,\n> which would be well worth the extra work in the forward/back \n> step case.\n\nSo it probably does pay off for a cursor, that is explicitly requested \nto be scrollable, but certainly not for others, yes.\n\nAndreas\n",
"msg_date": "Mon, 11 Jun 2001 09:35:14 +0200",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: Various silliness in heap_getnext and related routi\n\tnes"
}
] |
[
{
"msg_contents": "Hi all,\n\nI've posted this message twice nefore on pgsql-bugs, but I can't seem to get \nany response. The issue described below is pretty serious (at least as far as \nmy company is concerned):\n\nWhile trying to upgrade Postgres from version 7.0.3 to 7.1.2, I find that a \nprogram which dlopens the library mentioned above now produces the following \nerror message:\n\nld.so.1: ./BeeHive: fatal: relocation error: file \n/opt/pgsql/lib/libpsqlodbc.so: symbol main: referenced symbol not found\n\nI compiled Postgres with gcc-2.95.3, and configured with options \n--enable-odbc and --prefix=/opt/pgsql.\n\nThe same problem occurs with version 7.1.1, but as mentioned higher does not \noccur on 7.0.3 or earlier versions.\n\nSince the two most recently released versions both show this problem, it must \nbe something which was introduced in the 7.1 release.\n\nOur only alternative is to keep using the older releases for now, but this \nshould be fixed ASAP.\n\nSincerely,\n\nBob Deblier\nVirtual Unlimited\n",
"msg_date": "Mon, 11 Jun 2001 10:19:52 +0200",
"msg_from": "Bob Deblier <bob@virtualunlimited.com>",
"msg_from_op": true,
"msg_subject": "dlopen() of libpgsqlodbc.so >= release 7.1 fails on sparc solaris 2.8"
},
{
"msg_contents": "Bob Deblier writes:\n\n> While trying to upgrade Postgres from version 7.0.3 to 7.1.2, I find that a\n> program which dlopens the library mentioned above now produces the following\n> error message:\n>\n> ld.so.1: ./BeeHive: fatal: relocation error: file\n> /opt/pgsql/lib/libpsqlodbc.so: symbol main: referenced symbol not found\n\nTry using the flag RTLD_GLOBAL in dlopen().\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Mon, 11 Jun 2001 16:56:36 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: dlopen() of libpgsqlodbc.so >= release 7.1 fails on\n\tsparc solaris 2.8"
},
{
"msg_contents": "On Monday 11 June 2001 16:56, you wrote:\n> Bob Deblier writes:\n> > While trying to upgrade Postgres from version 7.0.3 to 7.1.2, I find that\n> > a program which dlopens the library mentioned above now produces the\n> > following error message:\n> >\n> > ld.so.1: ./BeeHive: fatal: relocation error: file\n> > /opt/pgsql/lib/libpsqlodbc.so: symbol main: referenced symbol not found\n>\n> Try using the flag RTLD_GLOBAL in dlopen().\n\nThat doesn't fix the problem, unfortunately. We've always opened the library \nwith RTLD_LAZY up from the 6 releases up to 7.0.3; now neither RTLD_LAZY, nor \nRLTD_LAZY | RTLD_GLOBAL works.\n\nBob Deblier\nVirtual Unlimited\n",
"msg_date": "Tue, 12 Jun 2001 14:35:43 +0200",
"msg_from": "Bob Deblier <bob@virtualunlimited.com>",
"msg_from_op": true,
"msg_subject": "Re: dlopen() of libpgsqlodbc.so >= release 7.1 fails on sparc solaris\n\t2.8"
}
] |
[
{
"msg_contents": "I noticed current wierd behaviour of a less/greater than comparisons of\nthings involving inet/cidr:\n\n10.1.2.3/8 is considered to be less than 10.0.0.0/32\n\nThe current logic does the following:\na) compare the network part of each (this will be 10.0.0.0), identical in\nthis case.\n\nb) compare the netmask length. If a value has shorter netmask, its\nconsidered to be less than a value with longer netmask.\n\nc) the host part is compared. \n\nTo me, this makes no sense. I think b and c should be transposed, and\nnetmask comparison must be only used as a tiebreaker when the values are\nthe same otherwise (such as, when comparing 10.1.2.3/8 and 10.1.2.3/32).\n\nFor type cidr, same thing applies: currently, 10.1.2.0/24 is considered to\nbe less than 10.0.0.0/8. \n\nIf someone can tell me a good reason why the comparisons are the way they\nare now, I'd much appreciate it :)\n\n-alex\n\n",
"msg_date": "Mon, 11 Jun 2001 09:47:20 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "inet/cidr type comparisons"
},
{
"msg_contents": "Alex Pilosov <alex@pilosoft.com> writes:\n> I noticed current wierd behaviour of a less/greater than comparisons of\n> things involving inet/cidr:\n\n> 10.1.2.3/8 is considered to be less than 10.0.0.0/32\n\nAnd what's wrong with that? Essentially this comes from the conclusion\nthat 10/8 is less than 10.0.0.0/32, which I have no problem with.\n\n> To me, this makes no sense. I think b and c should be transposed, and\n> netmask comparison must be only used as a tiebreaker when the values are\n> the same otherwise (such as, when comparing 10.1.2.3/8 and 10.1.2.3/32).\n\nThat would break the rule that network part is major sort key and host\npart is minor sort key, which I think is useful behavior.\n\n> For type cidr, same thing applies: currently, 10.1.2.0/24 is considered to\n> be less than 10.0.0.0/8. \n\nIt is?\n\nregression=# select '10.1.2.0/24'::cidr < '10.0.0.0/8'::cidr;\n ?column?\n----------\n f\n(1 row)\n\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 11 Jun 2001 12:03:54 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: inet/cidr type comparisons "
},
{
"msg_contents": "This behaviour makes harder to use index to optimize a << b\n\nWhat I have right now is rewriting a <<= b to use index plan :\n(a >= network(b)) && ( a <= broadcast(b) )\n\nHowever, that breaks down, since (for example) \n\nif a=10.1.2.3/32 and b = 10.1.2.0/24, broadcast(b) will be 10.1.2.255/24,\nbut 10.1.2.255/24 is considered to be less than 10.1.2.3/32...\n\nI can work around this, however, the concept just didn't make sense to me,\nbut I see that for some people it does, so I'll live with it :)\n\nSo what I'm going to do then is to make a function set_masklen(inet|cidr,\nint4) which would take an existing address and return a new value with\nchanged masklen.\n\nAlso, I'd like to create casting functions from varchar to inet/cidr,\nsince they are missing. Functions I'm writing:\n\nvarchar_inet(varchar)\nvarchar_cidr(varchar)\nvarchar_inet(varchar, int4)\nvarchar_cidr(varchar, int4)\n\n(the last two variants will take masklen as a separate argument)\n\nDoes this look good? Actually, what's more advisable for these functions,\ndoing conversions from varchar or doing it from text?\n\nApologies for asking so many questions, but I'd like a sanity check before\nproceeding :)\n\nThanks\n-alex\n\n\nOn Mon, 11 Jun 2001, Tom Lane wrote:\n\n> Alex Pilosov <alex@pilosoft.com> writes:\n> > I noticed current wierd behaviour of a less/greater than comparisons of\n> > things involving inet/cidr:\n> \n> > 10.1.2.3/8 is considered to be less than 10.0.0.0/32\n> \n> And what's wrong with that? Essentially this comes from the conclusion\n> that 10/8 is less than 10.0.0.0/32, which I have no problem with.\n> \n> > To me, this makes no sense. I think b and c should be transposed, and\n> > netmask comparison must be only used as a tiebreaker when the values are\n> > the same otherwise (such as, when comparing 10.1.2.3/8 and 10.1.2.3/32).\n> \n> That would break the rule that network part is major sort key and host\n> part is minor sort key, which I think is useful behavior.\n> \n> > For type cidr, same thing applies: currently, 10.1.2.0/24 is considered to\n> > be less than 10.0.0.0/8. \n> \n> It is?\n> \n> regression=# select '10.1.2.0/24'::cidr < '10.0.0.0/8'::cidr;\n> ?column?\n> ----------\n> f\n> (1 row)\n> \n> \n> \t\t\tregards, tom lane\n> \n> \n\n",
"msg_date": "Mon, 11 Jun 2001 13:16:01 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "Re: inet/cidr type comparisons "
},
{
"msg_contents": "Alex Pilosov <alex@pilosoft.com> writes:\n> What I have right now is rewriting a <<= b to use index plan :\n> (a >= network(b)) && ( a <= broadcast(b) )\n> However, that breaks down, since (for example) \n> if a=10.1.2.3/32 and b = 10.1.2.0/24, broadcast(b) will be 10.1.2.255/24,\n> but 10.1.2.255/24 is considered to be less than 10.1.2.3/32...\n\nThat simply demonstrates that broadcast(b) is not the right function to\nuse to derive an indexscan bound. You probably want to do this the same\nway that textual indexscan bounds are derived, viz for b = '10.1.2.0/24'\n\n\ta >= '10.1.2.0/24' AND a < '10.1.3.0/24'\n\nIn other words, increment the network part. This is for the same\nreasons that motivate the construction of indexscan limits for\n\"a LIKE 'abc%'\" as \"a >= 'abc' AND a < 'abd'\".\n\nWhile there may not be a user-visible function for next-network-part,\nthat hardly matters since the special-indexqual stuff isn't user-visible\neither.\n\n\n> So what I'm going to do then is to make a function set_masklen(inet|cidr,\n> int4) which would take an existing address and return a new value with\n> changed masklen.\n\nThere may or may not be any reason to export such a function; are there\nother uses for such a thing?\n\n\n> Also, I'd like to create casting functions from varchar to inet/cidr,\n> since they are missing. Functions I'm writing:\n\nShould be functions from text to inet/cidr, for consistency with the\nrest of Postgres.\n\n> varchar_inet(varchar, int4)\n> varchar_cidr(varchar, int4)\n\n> (the last two variants will take masklen as a separate argument)\n\nAnd do what exactly? What if the text string specifies masklen too?\n\nUnless this is a very common scenario, seems it's sufficient to provide\ntext to inet/cidr. The other can be done with the equivalent of\n\n\tinet('10.1.2.3' || '/' || '32').\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 11 Jun 2001 13:41:01 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: inet/cidr type comparisons "
},
{
"msg_contents": "On Mon, Jun 11, 2001 at 01:16:01PM -0400, Alex Pilosov wrote:\n> Apologies for asking so many questions, but I'd like a sanity check before\n> proceeding :)\n\nwhile you are in there, can you cahnge the print functions so that they\nare consistent?\n\nthe output should be 'x.x.x.x' or 'x.x.x.x/x'.\n\nin some cases, i have seen select's which output 'x.x.x/24', which totally\ndefeats the purpose of classless ip addrs.\n\neither the addrs are classless, or they are not.\n\nthe current print stuff seems to make special cases of classful addresses.\n\n-- \n[ Jim Mercer jim@reptiles.org +1 416 410-5633 ]\n[ Now with more and longer words for your reading enjoyment. ]\n",
"msg_date": "Mon, 11 Jun 2001 13:51:42 -0400",
"msg_from": "Jim Mercer <jim@reptiles.org>",
"msg_from_op": false,
"msg_subject": "Re: inet/cidr type comparisons"
},
{
"msg_contents": "On Mon, 11 Jun 2001, Tom Lane wrote:\n\n> While there may not be a user-visible function for next-network-part,\n> that hardly matters since the special-indexqual stuff isn't user-visible\n> either.\nWell, since I'm making an indexqual clause, I do need a valid pg_proc id\nthere. \n\nIt can't be resolved during the planning (directfunctioncall) because I do\nwant queries of a << b (b isn't a constant) to be also using the same\nmechanism. (so far it looks like special_index_* can cope with that OK)\n\n> > So what I'm going to do then is to make a function set_masklen(inet|cidr,\n> > int4) which would take an existing address and return a new value with\n> > changed masklen.\n> \n> There may or may not be any reason to export such a function; are there\n> other uses for such a thing?\n\nYeah, same reason I want to have text-to-varchar-with-masklen, it really\nsucks having to separate masklen and host, then aggregating them back\nagain...At any case, I think it has to be public due to above reasoning\n(function id for planner)\n\n> > Also, I'd like to create casting functions from varchar to inet/cidr,\n> > since they are missing. Functions I'm writing:\n> \n> Should be functions from text to inet/cidr, for consistency with the\n> rest of Postgres.\nOK\n\n> Unless this is a very common scenario, seems it's sufficient to provide\n> text to inet/cidr. The other can be done with the equivalent of\n> \n> \tinet('10.1.2.3' || '/' || '32').\nSounds ok, but I'd like to have network_set_masklen then to change masklen\nwithout having to break up the value again...\n\nThanks again.\n\n-alex\n\n\n",
"msg_date": "Mon, 11 Jun 2001 13:59:52 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "Re: inet/cidr type comparisons "
},
{
"msg_contents": "On Mon, 11 Jun 2001, Jim Mercer wrote:\n\n> while you are in there, can you cahnge the print functions so that they\n> are consistent?\n> \n> the output should be 'x.x.x.x' or 'x.x.x.x/x'.\n> \n> in some cases, i have seen select's which output 'x.x.x/24', which totally\n> defeats the purpose of classless ip addrs.\n7.1 will do it correctly, please upgrade:\n\nusers=# select '10/8'::inet;\n ?column?\n------------\n 10.0.0.0/8\n(1 row)\n\n\n",
"msg_date": "Mon, 11 Jun 2001 14:06:01 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "Re: inet/cidr type comparisons"
},
{
"msg_contents": "Alex Pilosov <alex@pilosoft.com> writes:\n> On Mon, 11 Jun 2001, Tom Lane wrote:\n>> While there may not be a user-visible function for next-network-part,\n>> that hardly matters since the special-indexqual stuff isn't user-visible\n>> either.\n\n> Well, since I'm making an indexqual clause, I do need a valid pg_proc id\n> there. \n\nNo, you need a constant there.\n\n> It can't be resolved during the planning (directfunctioncall) because I do\n> want queries of a << b (b isn't a constant) to be also using the same\n> mechanism. (so far it looks like special_index_* can cope with that OK)\n\nYou're mistaken ... that's not supported currently.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 11 Jun 2001 14:13:45 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: inet/cidr type comparisons "
},
{
"msg_contents": "Jim Mercer <jim@reptiles.org> writes:\n> while you are in there, can you cahnge the print functions so that they\n> are consistent?\n\nI believe they are consistent in 7.1; leastwise, you will have to make\na pretty good argument why we should change them again. We had a very\nlong discussion that led up to the current solution.\n\nThere are formatting functions that provide various alternative displays\nif you don't like the default one, btw.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 11 Jun 2001 14:33:12 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: inet/cidr type comparisons "
},
{
"msg_contents": "On Mon, Jun 11, 2001 at 02:33:12PM -0400, Tom Lane wrote:\n> Jim Mercer <jim@reptiles.org> writes:\n> > while you are in there, can you cahnge the print functions so that they\n> > are consistent?\n> \n> I believe they are consistent in 7.1; leastwise, you will have to make\n> a pretty good argument why we should change them again. We had a very\n> long discussion that led up to the current solution.\n\nah, it appears that this was done, thanx very much.\n\nPostgreSQL 7.0.3 on i386-unknown-freebsdelf4.2, compiled by gcc 2.95.2\nreptiles=> select '216.95.252/24'::cidr, '216.95.252/24'::inet;\n---------------+-----------------\n 216.95.252/24 | 216.95.252.0/24\n\nPostgreSQL 7.1.2 on i386-unknown-freebsd4.3, compiled by GCC 2.95.3\namphibians=# select '216.95.252/24'::cidr, '216.95.252/24'::inet;\n-----------------+-----------------\n 216.95.252.0/24 | 216.95.252.0/24\n\n-- \n[ Jim Mercer jim@reptiles.org +1 416 410-5633 ]\n[ Now with more and longer words for your reading enjoyment. ]\n",
"msg_date": "Mon, 11 Jun 2001 16:44:12 -0400",
"msg_from": "Jim Mercer <jim@reptiles.org>",
"msg_from_op": false,
"msg_subject": "Re: inet/cidr type comparisons"
},
{
"msg_contents": "On Mon, 11 Jun 2001, Tom Lane wrote:\n\n> > It can't be resolved during the planning (directfunctioncall) because I do\n> > want queries of a << b (b isn't a constant) to be also using the same\n> > mechanism. (so far it looks like special_index_* can cope with that OK)\n> \n> You're mistaken ... that's not supported currently.\nAugh, you are right. Well, now I have three options\n\na) fix match_clause_to_indexkey to use something like special_index_* for\n'special' operators that can use indices in a nested loop-join. \n\nb) add another access method to btree and muck with pg_amop (uuugh, bad\nidea)\n\nc) decide that I'm way deeper than I wanted to be already, and forget\nabout the idea.\n\nWhere I need a<<=b, I guess I can just use a>=network(b) and\na<next_network(b) directly. \n\nTom, thanks for helping me out.\n\nI'll still follow up with set_masklen and network_text funcs.\n\n-alex\n\n\n\n\n\n\n",
"msg_date": "Mon, 11 Jun 2001 17:00:34 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "Re: inet/cidr type comparisons "
}
] |
[
{
"msg_contents": "> I had a baby girl on Tuesday. I am working through my \n> backlogged emails\n> today.\n\nCongratulations -:)\n\nVadim\n",
"msg_date": "Mon, 11 Jun 2001 09:16:36 -0700",
"msg_from": "\"Mikheev, Vadim\" <vmikheev@SECTORBASE.COM>",
"msg_from_op": true,
"msg_subject": "RE: Baby girl"
},
{
"msg_contents": "\n\ntrust me ... girls are soooooo much fun ... *roll eyes* *watches for\nlightening*\n\nOn Mon, 11 Jun 2001, Mikheev, Vadim wrote:\n\n> > I had a baby girl on Tuesday. I am working through my\n> > backlogged emails\n> > today.\n>\n> Congratulations -:)\n>\n> Vadim\n>\n> ---------------------------(end of broadcast)---------------------------\n> TIP 4: Don't 'kill -9' the postmaster\n>\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org\nprimary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org\n\n",
"msg_date": "Mon, 11 Jun 2001 14:30:20 -0300 (ADT)",
"msg_from": "The Hermit Hacker <scrappy@hub.org>",
"msg_from_op": false,
"msg_subject": "RE: Baby girl"
}
] |
[
{
"msg_contents": "You guys said you've never seen it.\nYou said you wanted to know if anyone has ever run into it!\n\nWelcome to psql, the PostgreSQL interactive terminal.\n\nType: \\copyright for distribution terms\n \\h for help with SQL commands\n \\? for help on internal slash commands\n \\g or terminate with semicolon to execute query\n \\q to quit\n\ncdinfo=# create view test as select * from zsong ;\nERROR: pg_atoi: error reading \"2156109797\": Numerical result out of\nrange\ncdinfo=# vacuum analyze zsong ;\nVACUUM\ncdinfo=# create view test as select * from zsong ;\nERROR: pg_atoi: error reading \"2156109823\": Numerical result out of\nrange\ncdinfo=# create view test as select * from zsong ;\nERROR: pg_atoi: error reading \"2156109840\": Numerical result out of\nrange\ncdinfo=# vaanalyze zsong ;\ncdinfo=# \\d zsong\n Table \"zsong\"\n Attribute | Type | Modifier\n-----------+-----------+----------\n muzenbr | integer |\n disc | integer |\n trk | integer |\n song | varchar() |\n artistid | integer |\n acd | varchar() |\n trackid | integer |\n datasrc | integer |\n extid | integer |\n\ncdinfo=# select max(oid) from zsong ;\n max\n-------------\n -2138857719\n(1 row)\n\n",
"msg_date": "Mon, 11 Jun 2001 13:21:14 -0400",
"msg_from": "mlw <markw@mohawksoft.com>",
"msg_from_op": true,
"msg_subject": "OID Wrap"
},
{
"msg_contents": "> You guys said you've never seen it.\n> You said you wanted to know if anyone has ever run into it!\n> \n> Welcome to psql, the PostgreSQL interactive terminal.\n> \n> Type: \\copyright for distribution terms\n> \\h for help with SQL commands\n> \\? for help on internal slash commands\n> \\g or terminate with semicolon to execute query\n> \\q to quit\n\nVery interesting. Also, it points out that we don't have OID as\nunsigned in all places. Are you running 7.1.X?\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 11 Jun 2001 14:00:26 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: OID Wrap"
},
{
"msg_contents": "Bruce Momjian wrote:\n\n> > You guys said you've never seen it.\n> > You said you wanted to know if anyone has ever run into it!\n> >\n> > Welcome to psql, the PostgreSQL interactive terminal.\n> >\n> > Type: \\copyright for distribution terms\n> > \\h for help with SQL commands\n> > \\? for help on internal slash commands\n> > \\g or terminate with semicolon to execute query\n> > \\q to quit\n>\n> Very interesting. Also, it points out that we don't have OID as\n> unsigned in all places. Are you running 7.1.X?\n\nThis system is currently 7.0.3, but we are working at moving it to 7.1.x\nvery soon.\n\nThe issue is that we backup the database, run update scripts. If the update\nscripts fail, we drop the database and reload from backup (It is a very\ninterdependent amalgam of several vendor's databases). The database is well\nover 50 million records and almost a hundred indexes, and we have been doing\nthis for a while. I have had it in the back of my mind that I should keep an\neye on this, but it bit me before I really focused. It isn't a big deal for\nus, we just have to run initdb once in a while. lol.\n\nBut I thought you guys would like to know that it did happen!\n\n\n\n",
"msg_date": "Mon, 11 Jun 2001 14:11:06 -0400",
"msg_from": "mlw <markw@mohawksoft.com>",
"msg_from_op": true,
"msg_subject": "Re: OID Wrap"
},
{
"msg_contents": "mlw <markw@mohawksoft.com> writes:\n> cdinfo=# create view test as select * from zsong ;\n> ERROR: pg_atoi: error reading \"2156109797\": Numerical result out of\n> range\n\nIs this 7.1? I thought we'd fixed all the places that treated OID\nvalues as signed.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 11 Jun 2001 14:44:00 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: OID Wrap "
},
{
"msg_contents": "> mlw <markw@mohawksoft.com> writes:\n> > cdinfo=# create view test as select * from zsong ;\n> > ERROR: pg_atoi: error reading \"2156109797\": Numerical result out of\n> > range\n> \n> Is this 7.1? I thought we'd fixed all the places that treated OID\n> values as signed.\n\nIt is 7.0.3. 7.1 has doubled the size of oid.\n\nAs a test using the CVS copy, I ran:\n\t\n\tCREATE TEMPORARY TABLE pgdump_oid (dummy int4);\n\tCOPY pgdump_oid WITH OIDS FROM stdin;\n\t3000000000 0\n\t\\.\n\tDROP TABLE pgdump_oid;\n\nand then to show it worked:\n\t\n\ttest=> create table test (x int);\n\tCREATE\n\ttest=> insert into test values (1);\n\tINSERT 3000000011 1\n\nI then ran the regression tests, and they all passed.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 11 Jun 2001 16:42:14 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: OID Wrap"
}
] |
[
{
"msg_contents": "I am planning to deal with all of the following TODO items today:\n\n* pg_database should have unique indexes on oid and on datname.\n\n* pg_shadow should have unique indexes on usename and on usesysid.\n\n* pg_am should have unique index on oid\n\n* pg_opclass should have unique index on oid\n\n* pg_amproc should have unique index on amid+amopclaid+amprocnum\n\n* Remove pg_rewrite's unnecessary index on oid, delete unused RULEOID\n syscache.\n\n* Remove index on pg_listener for performance reasons.\n\n* Change pg_attrdef's nonunique index on adrelid into a unique index\n on adrelid+adnum.\n\nHave I missed anything in this line?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 11 Jun 2001 13:22:20 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": true,
"msg_subject": "Catalog index cleanup blitz planned"
}
] |
[
{
"msg_contents": "We have been researching replication for several months now, and\nI have some opinions to share to the community for feedback,\ndiscussion, and/or participation. Our goal is to get a replication\nsolution for PostgreSQL that will meet most needs of users\nand applications alike (mission impossible theme here :). \n\nMy research work along with others contributors has been collected\nand presented here http://www.greatbridge.org/genpage?replication_top\nIf there is something missing, especially PostgreSQL related\nwork, I would like to know about it, and my apologies to any\none who got left off the list. This work is ongoing and doesn't\ndraw a conclusion, which IMHO should be left up to the user,\nbut I'm offering my opinions to spur discussion and/or feed back\nfrom this list, and try not to offend any one.\n\nHere's my opinion: of the approaches we've surveyed, the most\npromising one is the Postgres-R project from the Information and\nCommunication Systems Group, ETH in Zurich, Switzerland, originally \nproduced by Bettina Kemme, Gustavo Alonso, and others. Although \nPostgres-R is a synchronous approach, I believe it is the closest to \nthe goal mentioned above. Here is an abstract of the advantages.\n\n1) Postgres-R is built on the PostgreSQL-6.4.2 code base. The \nreplication \nfunctionality is an optional parameter, so there will be insignificant \noverhead for non replication situations. The replication and \ncommunication\nmanagers are the two new modules added to the PostgreSQL code base.\n\n2) The replication manager's main function is controlling the\nreplication protocol via a message handling process. It receives\nmessages from the local and remote backends and forwards write\nsets and decision messages via the communication manager to the\nother servers. The replication manager controls all the transactions \nrunning on the local server by keeping track of the states, including \nwhich protocol phase (read, send, lock, or write) the transaction is\nin. The replication manager maintains a two way channel\nimplemented as buffered sockets to each backend.\n\n3) The main task of the communication manager is to provide simple\nsocket based interface between the replication manager and the\ngroup communication system (currently Ensemble). The\ncommunication system is a cluster of servers connected via\nthe communication manager. The replication manager also maintains\nthree one-way channels to the communication system: a broadcast\nchannel to send messages, a total-order channel to receive\ntotally orders write sets, and a no-order channel to listen for\ndecision messages from the communication system. Decision\nmessages can be received at any time where the reception of\ntotally ordered write sets can be blocked in certain phases.\n\n4) Based on a two phase locking approach, all dead lock situations\nare local and detectable by Postgres-R code base, and aborted.\n\n5) The write set messages used to send database changes to other\nservers, can use either the SQL statements or the actual tuples\nchanged. This is a parameter based on number of tuples changed\nby a transaction. While sending the tuple changes reduces\noverhead in query parse, plan and execution, there is a negative\neffect in sending a large write set across the network.\n\n6) Postgres-R uses a synchronous approach that keeps the data on \nall sites consistent and provides serializability. The user does not \nhave to bother with conflict resolution, and receives the same \ncorrectness and consistency of a centralized system.\n\n7) Postgres-R could be part of a good fault-resilient and load \ndistribution \nsolution. It is peer-to-peer based and incurs low overhead propagating \nupdates to the other cluster members. All replicated databases locally \nprocess queries.\n\n8) Compared to other synchronous replication strategies (e.g., standard \ndistributed 2-phase-locking + 2-phase-commit), Postgres-R has much \nbetter performance using 2-phase-locking.\n\n\nThere are some issues that are not currently addressed by\nPostgres-R, but some enhancements made to PostgreSQL since the\n6.4.2 tree are very favorable to addressing these short comings.\n\n1) The addition of WAL in 7.1 has the information for recovering \nfailed/off-line servers, currently all the servers would have to be \nstopped, and a copy would be used to get all the servers synchronized\nbefore starting again. \n\n2)Being synchronous, Postgres-R would not be a good solution \nfor off line/WAN scenarios where asynchronous replication is \nrequired. There are some theories on this issue which involve servers\nconnecting and disconnecting from the cluster.\n\n3)As in any serialized synchronous approach there is change in the \nflow of execution of a transaction; while most of these changes can \nbe solved by calling newly developed functions at certain time points, \nsynchronous replica control is tightly coupled with the concurrency \ncontrol.\nHence, especially in PostgreSQL 7.2 some parts of the concurrency control\n(MVCC) might have to be adjusted. This can lead to a slightly more \ncomplicated maintenance than a system that does not change the backend.\n\n4)Partial replication is not addressed. \n\n\nAny feedback on this post will be appreciated.\n\nThanks,\n\nDarren \n",
"msg_date": "Mon, 11 Jun 2001 18:18:15 GMT",
"msg_from": "Darren Johnson <djohnson@greatbridge.com>",
"msg_from_op": true,
"msg_subject": "PostgreSQL Replication"
}
] |
[
{
"msg_contents": "\nOn Fri, 8 Jun 2001, Mike Cianflone wrote:\n\n>> \tI'm running into some strange behavior with foreign keys which are a\n>> tuple of primary keys.\n>> \n>> \n>> I have a parent table sector, and a child of that is cell_area table and\na\n>> child of that is unit table.\n>> \n>> The cell_area table has a foreign key parent_sector_index referencing\nsame\n>> name in parent table sector.\n>> \n>> The unit table has a foreign key, parent_cell_area_index, and\n>> parent_sector_index referencing same names in its parent sector and\n>> cell_area.\n>> \n>> The primary key of each table is the composite of the foreign keys as\nwell\n>> as it's own index, therefore it's possible to have, for example, in the\n>> cell-area table, to have several entries of the same index, say 1, as\nlong\n>> as the parent_sector_index is different for each. So we could have for\nthe\n>> cell_area table (1,1) (1,2) (1,3), as the primary key tuple.\n>> \n>> The same thing applies to the lowest level table, the unit table, which\nis a\n>> 3 tuple of its own index, plus the parent_cell_area_index, plus the\n>> parent_sector_index.\n>> \n>> Cascading deletes are turned off, and I have implemented my own trigger\nthat\n>> will delete the children, say for example when the cell_area is deleted,\nmy\n>> trigger will delete the children in the unit table, that have the same\n>> parent_sector_index, and that have that specific cell_area as its\n>> parent_cell_area.\n>> \n>> \tHere's the problem. If there are more than one entry in the\n>> cell_area table with the same index, then I receive a referential\nintegrity\n>> violation when I try to remove the cell_area of (1,1), even though, based\n>> upon the primary key tuple as explained above, there are no children that\n>> reference it.\n>> \tFor example, if I have in the cell_area table (cell_area_index,\n>> parent_sector_index) and the values are (1,1) (1,2) (1,3), and have in\nits\n>> child table which is the unit table (unit_index, parent_cell_area_index,\n>> parent_sector_index) and the values (1, 1, 2) (1,1,3), so that those 3\n>> tuples refer to items 2 and 3 of the set shown in the first part of this\n>> paragraph, and none refer to the first item which is (1,1), then when I\ntry\n>> to delete the cell_area of (1,1) I get a referential integrity violation\n>> because it sees that the child which is the unit table has foreign keys\n>> referencing the cell_area_index of 1 which is the same cell_area_index I\nam\n>> deleting. But note that ALL of the items still in cell_area also have\ntheir\n>> cell_area_index at 1, so the referential integrity constraint should not\n>> fail since they are still referring to that \"1\". Also note that the other\n>> foreign keys in the children are not referencing any other of the tuples\nin\n>> the parent, so the item I am trying to delete is not being referenced by\n>> anything.\n\n>How is the unit table references created?\n>Are they:\n>(1)\n> cell_area_index -> cell_area(cell_area_index)\n> parent_sector_index-> sector(parent_sector_index)\n>\n>(2)\n> (cell_area_index, parent_sector_index) -> cell_area(c_a_i, p_s_i)\n> parent_sector_index-> sector(parent_sector_index)\n>\n>\n>If 1, then what version are you running. That's not technically a legal\n>references constraint, but that wasn't checked under 7.0.x. The target\n>cols of the constraint *MUST* belong to a unique or primary key constraint\n>that have no additional columns. Try 2 instead.\n>\n>If 2, can you send the schema and data file to set this up from start\n>state?\n>\n\tYes, they were referenced as in your example #1. I'm running version\n7.0.3.2. I changed the foreign keys to reference the parents as you have\nspecified in your example #2 and that fixed the problem.\n\tThank you for taking the time to read through my long winded issue\nand make sense of it. I removed my own home-grown cascading delete triggers\nnow that this works fine. Thanks!\n\nMike Cianflone\n",
"msg_date": "Mon, 11 Jun 2001 11:51:16 -0700",
"msg_from": "Mike Cianflone <mcianflone@littlefeet-inc.com>",
"msg_from_op": true,
"msg_subject": "RE: Strange behavior on multiple primary key behavior d\n\teleting childr en"
}
] |
[
{
"msg_contents": "We have been researching replication for several months now, and\nI have some opinions to share to the community for feedback,\ndiscussion, and/or participation. Our goal is to get a replication\nsolution for PostgreSQL that will meet most needs of users\nand applications alike (mission impossible theme here :). \n\nMy research work along with others contributors has been collected\nand presented here http://www.greatbridge.org/genpage?replication_top\nIf there is something missing, especially PostgreSQL related\nwork, I would like to know about it, and my apologies to any\none who got left off the list. This work is ongoing and doesn't\ndraw a conclusion, which IMHO should be left up to the user,\nbut I'm offering my opinions to spur discussion and/or feed back\nfrom this list, and try not to offend any one.\n\nHere's my opinion: of the approaches we've surveyed, the most\npromising one is the Postgres-R project from the Information and\nCommunication Systems Group, ETH in Zurich, Switzerland, originally \nproduced by Bettina Kemme, Gustavo Alonso, and others. Although \nPostgres-R is a synchronous approach, I believe it is the closest to \nthe goal mentioned above. Here is an abstract of the advantages.\n\n1) Postgres-R is built on the PostgreSQL-6.4.2 code base. The \nreplication \nfunctionality is an optional parameter, so there will be insignificant \noverhead for non replication situations. The replication and \ncommunication\nmanagers are the two new modules added to the PostgreSQL code base.\n\n2) The replication manager's main function is controlling the\nreplication protocol via a message handling process. It receives\nmessages from the local and remote backends and forwards write\nsets and decision messages via the communication manager to the\nother servers. The replication manager controls all the transactions \nrunning on the local server by keeping track of the states, including \nwhich protocol phase (read, send, lock, or write) the transaction is\nin. The replication manager maintains a two way channel\nimplemented as buffered sockets to each backend.\n\n3) The main task of the communication manager is to provide simple\nsocket based interface between the replication manager and the\ngroup communication system (currently Ensemble). The\ncommunication system is a cluster of servers connected via\nthe communication manager. The replication manager also maintains\nthree one-way channels to the communication system: a broadcast\nchannel to send messages, a total-order channel to receive\ntotally orders write sets, and a no-order channel to listen for\ndecision messages from the communication system. Decision\nmessages can be received at any time where the reception of\ntotally ordered write sets can be blocked in certain phases.\n\n4) Based on a two phase locking approach, all dead lock situations\nare local and detectable by Postgres-R code base, and aborted.\n\n5) The write set messages used to send database changes to other\nservers, can use either the SQL statements or the actual tuples\nchanged. This is a parameter based on number of tuples changed\nby a transaction. While sending the tuple changes reduces\noverhead in query parse, plan and execution, there is a negative\neffect in sending a large write set across the network.\n\n6) Postgres-R uses a synchronous approach that keeps the data on \nall sites consistent and provides serializability. The user does not \nhave to bother with conflict resolution, and receives the same \ncorrectness and consistency of a centralized system.\n\n7) Postgres-R could be part of a good fault-resilient and load \ndistribution \nsolution. It is peer-to-peer based and incurs low overhead propagating \nupdates to the other cluster members. All replicated databases locally \nprocess queries.\n\n8) Compared to other synchronous replication strategies (e.g., standard \ndistributed 2-phase-locking + 2-phase-commit), Postgres-R has much \nbetter performance using 2-phase-locking.\n\n\nThere are some issues that are not currently addressed by\nPostgres-R, but some enhancements made to PostgreSQL since the\n6.4.2 tree are very favorable to addressing these short comings.\n\n1) The addition of WAL in 7.1 has the information for recovering \nfailed/off-line servers, currently all the servers would have to be \nstopped, and a copy would be used to get all the servers synchronized\nbefore starting again. \n\n2)Being synchronous, Postgres-R would not be a good solution \nfor off line/WAN scenarios where asynchronous replication is \nrequired. There are some theories on this issue which involve servers\nconnecting and disconnecting from the cluster.\n\n3)As in any serialized synchronous approach there is change in the \nflow of execution of a transaction; while most of these changes can \nbe solved by calling newly developed functions at certain time points, \nsynchronous replica control is tightly coupled with the concurrency \ncontrol.\nHence, especially in PostgreSQL 7.2 some parts of the concurrency control\n(MVCC) might have to be adjusted. This can lead to a slightly more \ncomplicated maintenance than a system that does not change the backend.\n\n4)Partial replication is not addressed. \n\n\nAny feedback on this post will be appreciated.\n\nThanks,\n\nDarren \n",
"msg_date": "Mon, 11 Jun 2001 19:46:44 GMT",
"msg_from": "Darren Johnson <djohnson@greatbridge.com>",
"msg_from_op": true,
"msg_subject": "Postgres Replication"
},
{
"msg_contents": "On Mon, 11 Jun 2001 19:46:44 GMT, you wrote:\n\n>We have been researching replication for several months now, and\n>I have some opinions to share to the community for feedback,\n>discussion, and/or participation. Our goal is to get a replication\n>solution for PostgreSQL that will meet most needs of users\n>and applications alike (mission impossible theme here :). \n>\n>My research work along with others contributors has been collected\n>and presented here http://www.greatbridge.org/genpage?replication_top\n>If there is something missing, especially PostgreSQL related\n>work, I would like to know about it, and my apologies to any\n>one who got left off the list. This work is ongoing and doesn't\n>draw a conclusion, which IMHO should be left up to the user,\n>but I'm offering my opinions to spur discussion and/or feed back\n>from this list, and try not to offend any one.\n>\n>Here's my opinion: of the approaches we've surveyed, the most\n>promising one is the Postgres-R project from the Information and\n>Communication Systems Group, ETH in Zurich, Switzerland, originally \n>produced by Bettina Kemme, Gustavo Alonso, and others. Although \n>Postgres-R is a synchronous approach, I believe it is the closest to \n>the goal mentioned above. Here is an abstract of the advantages.\n>\n>1) Postgres-R is built on the PostgreSQL-6.4.2 code base. The \n>replication \n>functionality is an optional parameter, so there will be insignificant \n>overhead for non replication situations. The replication and \n>communication\n>managers are the two new modules added to the PostgreSQL code base.\n>\n>2) The replication manager's main function is controlling the\n>replication protocol via a message handling process. It receives\n>messages from the local and remote backends and forwards write\n>sets and decision messages via the communication manager to the\n>other servers. The replication manager controls all the transactions \n>running on the local server by keeping track of the states, including \n>which protocol phase (read, send, lock, or write) the transaction is\n>in. The replication manager maintains a two way channel\n>implemented as buffered sockets to each backend.\n\nwhat does \"manager controls all the transactions\" mean? I hope it does\n*not* mean that a bug in the manager would cause transactions not to\ncommit...\n\n>\n>3) The main task of the communication manager is to provide simple\n>socket based interface between the replication manager and the\n>group communication system (currently Ensemble). The\n>communication system is a cluster of servers connected via\n>the communication manager. The replication manager also maintains\n>three one-way channels to the communication system: a broadcast\n>channel to send messages, a total-order channel to receive\n>totally orders write sets, and a no-order channel to listen for\n>decision messages from the communication system. Decision\n>messages can be received at any time where the reception of\n>totally ordered write sets can be blocked in certain phases.\n>\n>4) Based on a two phase locking approach, all dead lock situations\n>are local and detectable by Postgres-R code base, and aborted.\n\nDoes this imply locking over different servers? That would mean a\ngrinding halt when a network outage occurs...\n\n>5) The write set messages used to send database changes to other\n>servers, can use either the SQL statements or the actual tuples\n>changed. This is a parameter based on number of tuples changed\n>by a transaction. While sending the tuple changes reduces\n>overhead in query parse, plan and execution, there is a negative\n>effect in sending a large write set across the network.\n>\n>6) Postgres-R uses a synchronous approach that keeps the data on \n>all sites consistent and provides serializability. The user does not \n>have to bother with conflict resolution, and receives the same \n>correctness and consistency of a centralized system.\n>\n>7) Postgres-R could be part of a good fault-resilient and load \n>distribution \n>solution. It is peer-to-peer based and incurs low overhead propagating \n>updates to the other cluster members. All replicated databases locally \n>process queries.\n>\n>8) Compared to other synchronous replication strategies (e.g., standard \n>distributed 2-phase-locking + 2-phase-commit), Postgres-R has much \n>better performance using 2-phase-locking.\n\nComing from a Sybase background I have some experience with\nreplication. The way it works in Sybase Replication server is as\nfollows:\n- for each replicated database, there is a \"log reader\" process that\nreads the WAL and captures only *committed transactions* to the\nreplication server. (it does not make much sense to replicate other\nthings IMHO :-).\n- the replication server stores incoming data in a que (\"stable\ndevice\"), until it is sure it has reached its final destination\n\n- a replication server can send data to another replication server in\na compact (read: WAN friendly) way. A chain of replication servers can\nbe made, depending on network architecture)\n\n- the final replication server makes a almost standard client\nconnection to the target database and translates the compact\ntransactions back to SQL statements. By using masks, extra\nfunctionality can be built in. \n\nThis kind of architecture has several advantages:\n- only committed transactions are replicated which saves overhead\n- it does not have very much impact on performance of the source\nserver (apart from reading the WAL)\n- since every replication server has a stable device, data is stored\nwhen the network is down and nothing gets lost (nor stops performing)\n- because only the log reader and the connection from the final\nreplication server are RDBMS specific, it is possible to replicate\nfrom MS to Oracle using a Sybase replication server (or different\nversions etc).\n\nI do not know how much of this is patented or copyrighted, but the\narchitecture seems elegant and robust to me. I have done\nimplementations of bi-directional replication too. It *is* possible\nbut does require some funky setup and maintenance. (but it is better\nthat letting offices on different continents working on the same\ndatabase :-)\n\njust my 2 EURO cts :-)\n\n\n-- \n__________________________________________________\n\"Nothing is as subjective as reality\"\nReinoud van Leeuwen reinoud@xs4all.nl\nhttp://www.xs4all.nl/~reinoud\n__________________________________________________\n",
"msg_date": "Mon, 11 Jun 2001 22:06:07 GMT",
"msg_from": "reinoud@xs4all.nl (Reinoud van Leeuwen)",
"msg_from_op": false,
"msg_subject": "Re: Postgres Replication"
},
{
"msg_contents": "On Mon, 11 Jun 2001, Reinoud van Leeuwen wrote:\n\n> On Mon, 11 Jun 2001 19:46:44 GMT, you wrote:\n\n> what does \"manager controls all the transactions\" mean? I hope it does\n> *not* mean that a bug in the manager would cause transactions not to\n> commit...\nWell yeah it does. Bugs are a fact of life. :)\n\n> >4) Based on a two phase locking approach, all dead lock situations\n> >are local and detectable by Postgres-R code base, and aborted.\n> \n> Does this imply locking over different servers? That would mean a\n> grinding halt when a network outage occurs...\nDon't know, but see below.\n\n> Coming from a Sybase background I have some experience with\n> replication. The way it works in Sybase Replication server is as\n> follows:\n> - for each replicated database, there is a \"log reader\" process that\n> reads the WAL and captures only *committed transactions* to the\n> replication server. (it does not make much sense to replicate other\n> things IMHO :-).\n> - the replication server stores incoming data in a que (\"stable\n> device\"), until it is sure it has reached its final destination\n> \n> - a replication server can send data to another replication server in\n> a compact (read: WAN friendly) way. A chain of replication servers can\n> be made, depending on network architecture)\n> \n> - the final replication server makes a almost standard client\n> connection to the target database and translates the compact\n> transactions back to SQL statements. By using masks, extra\n> functionality can be built in. \n> \n> This kind of architecture has several advantages:\n> - only committed transactions are replicated which saves overhead\n> - it does not have very much impact on performance of the source\n> server (apart from reading the WAL)\n> - since every replication server has a stable device, data is stored\n> when the network is down and nothing gets lost (nor stops performing)\n> - because only the log reader and the connection from the final\n> replication server are RDBMS specific, it is possible to replicate\n> from MS to Oracle using a Sybase replication server (or different\n> versions etc).\n> \n> I do not know how much of this is patented or copyrighted, but the\n> architecture seems elegant and robust to me. I have done\n> implementations of bi-directional replication too. It *is* possible\n> but does require some funky setup and maintenance. (but it is better\n> that letting offices on different continents working on the same\n> database :-)\nYes, the above architecture is what almost every vendor of replication\nsoftware uses. And I'm sure if you worked much with Sybase, you hate the\ngarbage that their repserver is :). \n\nThe architecture of postgres-r and repserver are fundamentally different\nfor a good reason: repserver only wants to replicate committed\ntransactions, while postgres-r is more of a 'clustering' solution (albeit\nthey don't say this word), and is capable to do much more than simple rep\nserver. \n\nI.E. you can safely put half of your clients to second server in a\nreplicated postgres-r cluster without being worried that a conflict (or a\nwierd locking situation) may occur.\n\nTry that with sybase, it is fundamentally designed for one-way\nreplication, and the fact that you can do one-way replication in both\ndirections doesn't mean its safe to do that!\n\nI'm not sure how postgres-r handles network problems. To be useful, a good\nreplication solution must have an option of \"no network->no updates\" as\nwell as \"no network->queue updates and send them later\". However, it is\nfar easier to add queuing to a correct 'eager locking' database than it is\nto add proper locking to a queue-based replicator.\n\n-alex\n\n",
"msg_date": "Mon, 11 Jun 2001 18:46:05 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": false,
"msg_subject": "Re: Postgres Replication"
},
{
"msg_contents": "\nThanks for the feedback. I'll try to address both your issues here.\n\n>> what does \"manager controls all the transactions\" mean? \n> \nThe replication manager controls the transactions by serializing the \nwrite set messages. \nThis ensures all transactions are committed in the same order on each \nserver, so bugs\nhere are not allowed ;-)\n\n>> I hope it does\n>> *not* mean that a bug in the manager would cause transactions not to\n>> commit...\n> \n> Well yeah it does. Bugs are a fact of life. :\n\n> \n>>> 4) Based on a two phase locking approach, all dead lock situations\n>>> are local and detectable by Postgres-R code base, and aborted.\n>> \n>> Does this imply locking over different servers? That would mean a\n>> grinding halt when a network outage occurs...\n> \n> Don't know, but see below.\n\nThere is a branch of the Postgres-R code that has some failure detection \nimplemented,\nso we will have to merge this functionality with the version of \nPostgres-R we have, and\ntest this issue. I'll let you the results.\n\n>> \n>> - the replication server stores incoming data in a que (\"stable\n>> device\"), until it is sure it has reached its final destination\n> \nI like this idea for recovering servers that have been down a short \nperiod of time, using WAL\nto recover transactions missed during the outage.\n\n>> \n>> This kind of architecture has several advantages:\n>> - only committed transactions are replicated which saves overhead\n>> - it does not have very much impact on performance of the source\n>> server (apart from reading the WAL)\n>> - since every replication server has a stable device, data is stored\n>> when the network is down and nothing gets lost (nor stops performing)\n>> - because only the log reader and the connection from the final\n>> replication server are RDBMS specific, it is possible to replicate\n>> from MS to Oracle using a Sybase replication server (or different\n>> versions etc).\n> \nThere are some issues with the \"log reader\" approach:\n1) The databases are not synchronized until the log reader completes its \nprocessing.\n2) I'm not sure about Sybase, but the log reader sends SQL statements to \nthe other servers\nwhich are then parsed, planned and executed. This over head could be \navoided if only\nthe tuple changes are replicated.\n3) Works fine for read only situations, but peer-to-peer applications \nusing this approach\nmust be designed with a conflict resolution scheme. \n\nDon't get me wrong, I believe we can learn from the replication \ntechniques used by commercial\ndatabases like Sybase, and try to implement the good ones into \nPostgreSQL. Postgres-R is\na synchronous approach which out performs the traditional approaches to \nsynchronous replication.\nBeing based on PostgreSQL-6.4.2, getting this approach in the 7.2 tree \nmight be better than\nreinventing the wheel.\n\nThanks again,\n\nDarren\n\n\nThanks again,\n\nDarren\n\n",
"msg_date": "Mon, 11 Jun 2001 22:07:37 -0400",
"msg_from": "Darren Johnson <djohnson@greatbridge.com>",
"msg_from_op": true,
"msg_subject": "Re: Postgres Replication"
}
] |
[
{
"msg_contents": "I am trying to create a user defined C function that will\nbe called within PL/pgSQL\n\nNamely, I need a function that will create a new Large Object and copy\nthe data\nof an existing Large Object into the new Large Object.\n\nThis is the way the function would be registered\n\nCREATE FUNCTION copyoid(oid) RETURNS oid AS '/copyoid.so' LANGUAGE\n'C';\n\nI notice that the lo_create and lo_open functions require a postgres\nconnection (PGConn)\n\nOid lo_creat(PGconn *conn, int mode)\nint lo_open(PGconn *conn, Oid lobjId, int mode)\n\nSince the function I wish to create will be executed within the backend,\n\nhow do I handle\nthe conn (PGconn) variable?\n\nI realize I will need to open the original large object , create a new\nlarge object and then\nread the old and write the new until done, and then close both.\n\nEvery example I can find opens a connection and then uses the new\nconnection for these functions.\n\nIs this required or can I use the \"current\" connection ?\n\nThanks\n\n",
"msg_date": "Mon, 11 Jun 2001 16:24:22 -0400",
"msg_from": "Vincent Roberts <vroberts@emanon.net>",
"msg_from_op": true,
"msg_subject": "Calling lo_open within user defined C function"
},
{
"msg_contents": "Vincent Roberts <vroberts@emanon.net> writes:\n> I notice that the lo_create and lo_open functions require a postgres\n> connection (PGConn)\n\nThose are the client-side functions; naturally they need a connection\nto the backend. For the server-side functions, look in\nsrc/backend/libpq/be-fsstubs.c. For that matter, since you seemingly\ndon't need to hold an open LO reference except within your function,\nyou might find it easiest to work directly with the underlying\ninv_create &etc layer of functions. See lo_export and lo_import in\nbe-fsstubs.c for inspiration.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 12 Jun 2001 02:32:05 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Calling lo_open within user defined C function "
}
] |
[
{
"msg_contents": "I have run into a small snag with adding indexes to pg_shadow: the first\nattempt to run a non-bootstrap-mode backend fails with 'user \"postgres\"\ndoes not exist'. The reason it fails is that user postgres is added\nto pg_shadow by global.bki, which is run after template1.bki, which is\nwhere all the bootstrap-time indexes are created and filled. So user\npostgres is in pg_shadow, but it's not in the indexes, which means that\na syscache-driven attempt to look it up will fail.\n\nI could hack around this by moving bootstrap index creation to the end\nof global.bki instead of template1.bki. However, this just begs the\nquestion of why we have two init scripts at all. The distinction\nbetween global and local objects is not determined by these scripts\n(IsSharedSystemRelationName is where that gold is hidden). We've\nalready got template1.bki creating some global objects (namely the\nindexes on pg_group), and if I make the quick-hack fix then we'll\ninstead have global.bki creating a whole bunch of non-global indexes\nalong with a few global ones.\n\nI'm strongly inclined to merge global.bki and template1.bki into a\nsingle initialization script, say postgres.bki. Comments?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 11 Jun 2001 19:28:37 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": true,
"msg_subject": "global.bki vs template1.bki init files"
},
{
"msg_contents": "> I have run into a small snag with adding indexes to pg_shadow: the first\n> attempt to run a non-bootstrap-mode backend fails with 'user \"postgres\"\n> does not exist'. The reason it fails is that user postgres is added\n> to pg_shadow by global.bki, which is run after template1.bki, which is\n> where all the bootstrap-time indexes are created and filled. So user\n> postgres is in pg_shadow, but it's not in the indexes, which means that\n> a syscache-driven attempt to look it up will fail.\n> \n> I could hack around this by moving bootstrap index creation to the end\n> of global.bki instead of template1.bki. However, this just begs the\n> question of why we have two init scripts at all. The distinction\n> between global and local objects is not determined by these scripts\n> (IsSharedSystemRelationName is where that gold is hidden). We've\n> already got template1.bki creating some global objects (namely the\n> indexes on pg_group), and if I make the quick-hack fix then we'll\n> instead have global.bki creating a whole bunch of non-global indexes\n> along with a few global ones.\n> \n> I'm strongly inclined to merge global.bki and template1.bki into a\n> single initialization script, say postgres.bki. Comments?\n\nI thought we agreed to merge them already. Also, could we modify\nIndexScanOK() to catch this case and do a heap scan?\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 11 Jun 2001 20:18:24 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: global.bki vs template1.bki init files"
},
{
"msg_contents": "> I thought we agreed to merge them already.\n\nWe did? Good. Will make it so.\n\n> Also, could we modify\n> IndexScanOK() to catch this case and do a heap scan?\n\nHow? Also, why?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 11 Jun 2001 21:10:54 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: global.bki vs template1.bki init files "
},
{
"msg_contents": "]> > I thought we agreed to merge them already.\n> \n> We did? Good. Will make it so.\n\nI know Peter mentioned it a long time ago.\n\n> > Also, could we modify\n> > IndexScanOK() to catch this case and do a heap scan?\n> \n> How? Also, why?\n\nI remember problems getting the index on pg_index because of recursive\nlookups so I thought you could either have bootstrap mode ignore the\npg_shadow index or have recursion identified and fallback to heapscan,\nbut if you merge them there isn't much point.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 11 Jun 2001 21:14:03 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: global.bki vs template1.bki init files"
},
{
"msg_contents": "Bruce Momjian writes:\n\n> ]> > I thought we agreed to merge them already.\n> >\n> > We did? Good. Will make it so.\n>\n> I know Peter mentioned it a long time ago.\n\nSomehow I got marked down for this but I actually thought the split was\nuseful. One reason was that you could restore template1 individually\n(which hasn't worked for a while). Another was that you could have more\nthan one template initialization file, possibly even to initialize more\nthan one template database at boot time. Obviously these things are never\nused and there are other ways to achieve similar results, and given that\nthere is a pretty strong interdependency between what initdb does and what\nthe backend thinks it should do there's little need to fight for it.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Tue, 12 Jun 2001 16:42:56 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: global.bki vs template1.bki init files"
},
{
"msg_contents": "Peter Eisentraut <peter_e@gmx.net> writes:\n> Somehow I got marked down for this but I actually thought the split was\n> useful. One reason was that you could restore template1 individually\n> (which hasn't worked for a while).\n\nIf it ever did, which seems doubtful given the way build_indices works;\nthere's no way to build only a subset of the existent indices.\n\nAnyway, we have a superior solution for that problem now: you can delete\ntemplate1 and clone it from template0. (Yes, that actually works...\nat least it does if you have another database you can connect to while\nissuing the DROP DATABASE and CREATE DATABASE commands...)\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 12 Jun 2001 10:54:14 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: global.bki vs template1.bki init files "
}
] |
[
{
"msg_contents": "Attached is a patch adding following functions:\n\ninet(text), cidr(text): convert a text value into inet/cidr\nset_masklen(inet): set masklen on the inet value\n\nPatch also contains regression checks for these functions.\n\n-alex",
"msg_date": "Mon, 11 Jun 2001 21:29:39 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "[PATCH] addition of text_inet, text_cidr and inet_set_masklen"
},
{
"msg_contents": "Your patch has been added to the PostgreSQL unapplied patches list at:\n\n\thttp://candle.pha.pa.us/cgi-bin/pgpatches\n\nI will try to apply it within the next 48 hours.\n\n> Attached is a patch adding following functions:\n> \n> inet(text), cidr(text): convert a text value into inet/cidr\n> set_masklen(inet): set masklen on the inet value\n> \n> Patch also contains regression checks for these functions.\n> \n> -alex\n\nContent-Description: pg-network.patch\n\n[ Attachment, skipping... ]\n\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 5: Have you checked our extensive FAQ?\n> \n> http://www.postgresql.org/users-lounge/docs/faq.html\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Tue, 12 Jun 2001 14:00:47 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] addition of text_inet, text_cidr and inet_set_masklen"
},
{
"msg_contents": "\nThanks. Patch applied. This knocks out another TODO item.\n\n\n> Attached is a patch adding following functions:\n> \n> inet(text), cidr(text): convert a text value into inet/cidr\n> set_masklen(inet): set masklen on the inet value\n> \n> Patch also contains regression checks for these functions.\n> \n> -alex\n\nContent-Description: pg-network.patch\n\n[ Attachment, skipping... ]\n\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 5: Have you checked our extensive FAQ?\n> \n> http://www.postgresql.org/users-lounge/docs/faq.html\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Wed, 13 Jun 2001 17:08:56 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] addition of text_inet, text_cidr and inet_set_masklen"
},
{
"msg_contents": ">> Attached is a patch adding following functions:\n>> \n>> inet(text), cidr(text): convert a text value into inet/cidr\n>> set_masklen(inet): set masklen on the inet value\n>> \n>> Patch also contains regression checks for these functions.\n\nHow about some documentation updates to go with that?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 13 Jun 2001 17:55:10 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] addition of text_inet, text_cidr and inet_set_masklen "
},
{
"msg_contents": "My bad.\n\nAttached.\n\n-alex\n\nOn Wed, 13 Jun 2001, Tom Lane wrote:\n\n> >> Attached is a patch adding following functions:\n> >> \n> >> inet(text), cidr(text): convert a text value into inet/cidr\n> >> set_masklen(inet): set masklen on the inet value\n> >> \n> >> Patch also contains regression checks for these functions.\n> \n> How about some documentation updates to go with that?\n> \n> \t\t\tregards, tom lane\n> \n>",
"msg_date": "Wed, 13 Jun 2001 18:16:48 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "Re: [PATCH] addition of text_inet, text_cidr and\n inet_set_masklen"
},
{
"msg_contents": "\nPatch applied.\n\n> My bad.\n> \n> Attached.\n> \n> -alex\n> \n> On Wed, 13 Jun 2001, Tom Lane wrote:\n> \n> > >> Attached is a patch adding following functions:\n> > >> \n> > >> inet(text), cidr(text): convert a text value into inet/cidr\n> > >> set_masklen(inet): set masklen on the inet value\n> > >> \n> > >> Patch also contains regression checks for these functions.\n> > \n> > How about some documentation updates to go with that?\n> > \n> > \t\t\tregards, tom lane\n> > \n> > \n\nContent-Description: \n\n[ Attachment, skipping... ]\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Wed, 13 Jun 2001 18:44:53 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] addition of text_inet, text_cidr and inet_set_masklen"
}
] |
[
{
"msg_contents": "\nOops, I see you've just done that, great!\n\n\n\n\nTo: Chris Dunlop <chris@onthe.net.au>\ncc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-patches@postgresql.org (bcc: Chris\n Bitmead/ITG/Health)\n\nSubject: Re: [PATCHES] Australian timezone configure option\n\n\n\n> On Mon, Jun 11, 2001 at 06:52:52PM -0400, Bruce Momjian wrote:\n> >\n> > I have decided to make this configurable via postgresql.conf so you\n> > don't need separate binaries / configure switch to run in Australia. I\n> > will send a patch over for testing.\n>\n>\n> Great, that's better than a configure option...\n>\n\nI thought so.\n\n--\n\n\n\n\n\n\n",
"msg_date": "Tue, 12 Jun 2001 15:01:24 +1000",
"msg_from": "chris.bitmead@health.gov.au",
"msg_from_op": true,
"msg_subject": "Re: Australian timezone configure option"
}
] |
[
{
"msg_contents": "Hi\n\nI wonder why all large objects is placed in one system table\n pg_largeobject ).\nI just want to trow an idea, why not create a similiar table and added pglo\n( something like pglo_tablename ).\nThis way, the large objects will be spread in every table that has the blob\ntype.\n\nThank's\nAndy\n\n\n",
"msg_date": "Tue, 12 Jun 2001 12:20:59 +0700",
"msg_from": "\"Andy Samuel\" <andysamuel@geocities.com>",
"msg_from_op": true,
"msg_subject": "large object implementation"
},
{
"msg_contents": "\"Andy Samuel\" <andysamuel@geocities.com> writes:\n> I wonder why all large objects is placed in one system table\n> pg_largeobject ).\n\nWhy not? There's no tight limit on the size of a table.\n\n> I just want to trow an idea, why not create a similiar table and added pglo\n> ( something like pglo_tablename ).\n> This way, the large objects will be spread in every table that has the blob\n> type.\n\nBut large objects aren't blobs, if by blob you mean something that's\ntied to a single table. There's not a way to associate a large object\nwith a particular table. Besides which, we already have TOAST, which\nseems to do what you're thinking of.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 12 Jun 2001 02:43:24 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: large object implementation "
}
] |
[
{
"msg_contents": "\n> Although \n> Postgres-R is a synchronous approach, I believe it is the closest to \n> the goal mentioned above. Here is an abstract of the advantages.\n\nIf you only want synchronous replication, why not simply use triggers ?\nAll you would then need is remote query access and two phase commit,\nand maybe a little script that helps create the appropriate triggers.\n\nDoing a replicate all or nothing approach that only works synchronous\nis imho not flexible enough.\n\nAndreas\n",
"msg_date": "Tue, 12 Jun 2001 09:02:20 +0200",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: Postgres Replication"
},
{
"msg_contents": "\nHello\n\nI have hacked up a replication layer for Perl code accessing a\ndatabase throught the DBI interface. It works pretty well with MySQL\n(I can run pre-bender slashcode replicated, haven't tried the more\nrecent releases).\n\nPotentially this hack should also work with Pg but I haven't tried\nyet. If someone would like to test it out with a complex Pg app and\nlet me know how it went that would be cool.\n\nThe replication layer is based on Eric Newton's Recall replication\nlibrary (www.fault-tolerant.org/recall), and requires that all\ndatabase accesses be through the DBI interface.\n\nThe replicas are live, in that every operation affects all the\nreplicas in real time. Replica outages are invisible to the user, so\nlong as a majority of the replicas are functioning. Disconnected\nreplicas can be used for read-only access.\n\nThe only code modification that should be required to use the\nreplication layer is to change the DSN in connect():\n\n my $replicas = '192.168.1.1:7000,192.168.1.2:7000,192.168.1.3:7000';\n my $dbh = DBI->connect(\"DBI:Recall:database=$replicas\");\n\nYou should be able to install the replication modules with:\n\nperl -MCPAN -eshell\ncpan> install Replication::Recall::DBServer\n\nand then install DBD::Recall (which doesn't seem to be accessible from\nthe CPAN shell yet, for some reason), by:\n\nwget http://www.cpan.org/authors/id/AGUL/DBD-Recall-1.10.tar.gz\ntar xzvf DBD-Recall-1.10.tar.gz\ncd DBD-Recall-1.10\nperl Makefile.PL\nmake install\n\nI would be very interested in hearing about your experiences with\nthis...\n\nThanks\n\n#!\n",
"msg_date": "Tue, 12 Jun 2001 12:36:23 +0530",
"msg_from": "root <root@generalogic.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Postgres Replication"
},
{
"msg_contents": "\nwhich I believe is what the rserv implementation in contrib currently does\n... no?\n\nits funny ... what is in contrib right now was developed in a weekend by\nVadim, put in contrib, yet nobody has either used it *or* seen fit to\nsubmit patches to improve it ... ?\n\nOn Tue, 12 Jun 2001, Zeugswetter Andreas SB wrote:\n\n>\n> > Although\n> > Postgres-R is a synchronous approach, I believe it is the closest to\n> > the goal mentioned above. Here is an abstract of the advantages.\n>\n> If you only want synchronous replication, why not simply use triggers ?\n> All you would then need is remote query access and two phase commit,\n> and maybe a little script that helps create the appropriate triggers.\n>\n> Doing a replicate all or nothing approach that only works synchronous\n> is imho not flexible enough.\n>\n> Andreas\n>\n> ---------------------------(end of broadcast)---------------------------\n> TIP 6: Have you searched our list archives?\n>\n> http://www.postgresql.org/search.mpl\n>\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org\nprimary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org\n\n",
"msg_date": "Tue, 12 Jun 2001 06:07:41 -0300 (ADT)",
"msg_from": "The Hermit Hacker <scrappy@hub.org>",
"msg_from_op": false,
"msg_subject": "Re: AW: Postgres Replication"
},
{
"msg_contents": "\n> which I believe is what the rserv implementation in contrib currently \ndoes\n> ... no?\n\nWe tried rserv, PG Link (Joseph Conway), and PosrgreSQL Replicator. All\nthese projects are trigger based asynchronous replication. They all have\nsome advantages over the current functionality of Postgres-R some of \nwhich I believe can be addressed:\n\n1) Partial replication - being able to replicate just one or part of a\ntable(s)\n2) They make no changes to the PostgreSQL code base. (Postgres-R can't \naddress this one ;)\n3) PostgreSQL Replicator has some very nice conflict resolution schemes.\n\n\nHere are some disadvantages to using a \"trigger based\" approach:\n\n1) Triggers simply transfer individual data items when they are modified,\nthey do not keep track of transactions.\n2) The execution of triggers within a database imposes a performance \noverhead to that database.\n3) Triggers require careful management by database administrators. \nSomeone needs to keep track of all the \"alarms\" going off.\n4) The activation of triggers in a database cannot be easily \nrolled back or undone.\n\n\n\n> On Tue, 12 Jun 2001, Zeugswetter Andreas SB wrote:\n\n> > Doing a replicate all or nothing approach that only works synchronous\n> > is imho not flexible enough.\n> >\n\n\nI agree. Partial and asynchronous replication need to be addressed, \nand some of the common functionality of Postgres-R could possibly \nbe used to meet those needs. \n \n\nThanks for your feedback,\n\nDarren\n",
"msg_date": "Tue, 12 Jun 2001 13:32:16 GMT",
"msg_from": "Darren Johnson <djohnson@greatbridge.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: Postgres Replication"
}
] |
[
{
"msg_contents": "\n> Frequently one wants a data set returned in the same order as the\n> index used in the query. Informix (at least) has implicit order-by,\n> which means that the data will be returned in collating order if the\n> query forces use of the appropriate index.\n> \n> Does Postgresql do this?\n\nYes, but same as in Informix you can not rely on the optimizer to choose\nthat plan, if he thinks another access is cheaper. (In Informix you can \nforce a certain index with an optimizer directive which is not available \nin PostgreSQL, but for this particular case simply use an order by in both \ndatabases) \n\n> If not, does an Order-by force a sort even if an index has the correct\n> order to satisfy the order-by?\n\nIf a btree index is chosen that satisfies the order by, the sort is \navoided.\n\nAndreas\n",
"msg_date": "Tue, 12 Jun 2001 09:35:03 +0200",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: Implicit order-by in Postgresql?"
},
{
"msg_contents": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:\n>> If not, does an Order-by force a sort even if an index has the correct\n>> order to satisfy the order-by?\n\n> If a btree index is chosen that satisfies the order by, the sort is \n> avoided.\n\nAnd, of course, selection of that index is encouraged, because the\noptimizer will realize that any other plan will require an explicit\nsort step with extra costs.\n\nBottom line: say what you mean, don't try to outsmart the system.\nIf you want your results delivered in order, say ORDER BY.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 12 Jun 2001 09:38:57 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: AW: Implicit order-by in Postgresql? "
}
] |
[
{
"msg_contents": "Not sure if this is the right place, but...\n\nI am evaluating a move from FoxPro to PostgreSQL. So far, I like what I\nsee... alot. But, I have a data migration issue looming in the near\nfuture that I need to address. The pgAdmin tool is nice, and works okay\non small databases, but I need to migrate some tables with 200,000+\nrecords each. pgAdmin is too slow for this and it does not migrate the\nprimary keys and other indices.\n\nSo... is there a way to configure pgAdmin to migrate this much data and\ngrab the keys and indices?\n\nOr has someone seen a Perl script that could be used to build an SQL DDL\nscript from a FoxPro database (or any ODBC datasource), and I can export\nthe data and use the PostgreSQL COPY command to load the data locally.\n\n",
"msg_date": "Tue, 12 Jun 2001 09:28:56 -0400",
"msg_from": "\"P. Dwayne Miller\" <dmiller@espgroup.net>",
"msg_from_op": true,
"msg_subject": "Perl script"
}
] |
[
{
"msg_contents": "\n> Here are some disadvantages to using a \"trigger based\" approach:\n> \n> 1) Triggers simply transfer individual data items when they \n> are modified, they do not keep track of transactions.\n> 2) The execution of triggers within a database imposes a performance \n> overhead to that database.\n> 3) Triggers require careful management by database administrators. \n> Someone needs to keep track of all the \"alarms\" going off.\n> 4) The activation of triggers in a database cannot be easily \n> rolled back or undone.\n\nYes, points 2 and 3 are a given, although point 2 buys you the functionality\nof transparent locking across all involved db servers.\nPoints 1 and 4 are only the case for a trigger mechanism that does \nnot use remote connection and 2-phase commit. \n\nImho an implementation that opens a separate client connection to the \nreplication target is only suited for async replication, and for that a WAL \nbased solution would probably impose less overhead.\n\nAndreas\n",
"msg_date": "Tue, 12 Jun 2001 15:50:09 +0200",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: AW: Postgres Replication"
},
{
"msg_contents": "\n\n> Imho an implementation that opens a separate client connection to the\n> replication target is only suited for async replication, and for that a \nWAL\n> based solution would probably impose less overhead.\n\n\nYes there is significant overhead with opening a connection to a \nclient, so Postgres-R creates a pool of backends at start up, \ncoupled with the group communication system (Ensemble) that\nsignificantly reduces this issue.\n\n\nVery good points,\n\nDarren\n\n\n",
"msg_date": "Tue, 12 Jun 2001 14:37:18 GMT",
"msg_from": "Darren Johnson <djohnson@greatbridge.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: AW: Postgres Replication"
},
{
"msg_contents": "On Tue, 12 Jun 2001 15:50:09 +0200, you wrote:\n\n>\n>> Here are some disadvantages to using a \"trigger based\" approach:\n>> \n>> 1) Triggers simply transfer individual data items when they \n>> are modified, they do not keep track of transactions.\n>> 2) The execution of triggers within a database imposes a performance \n>> overhead to that database.\n>> 3) Triggers require careful management by database administrators. \n>> Someone needs to keep track of all the \"alarms\" going off.\n>> 4) The activation of triggers in a database cannot be easily \n>> rolled back or undone.\n>\n>Yes, points 2 and 3 are a given, although point 2 buys you the functionality\n>of transparent locking across all involved db servers.\n>Points 1 and 4 are only the case for a trigger mechanism that does \n>not use remote connection and 2-phase commit. \n>\n>Imho an implementation that opens a separate client connection to the \n>replication target is only suited for async replication, and for that a WAL \n>based solution would probably impose less overhead.\n\nWell as I read back the thread I see 2 different approaches to\nreplication:\n\n1: tight integrated replication. \npro:\n- bi-directional (or multidirectional): updates are possible\neverywhere\n- A cluster of servers allways has the same state. \n- it does not matter to which server you connect\ncon:\n- network between servers will be a bottleneck, especially if it is a\nWAN connection\n- only full replication possible\n- what happens if one server is down? (or the network between) are\ncommits still possible\n\n2: async replication\npro:\n- long distance possible\n- no problems with network outages\n- only changes are replicated, selects do not have impact \n- no locking issues accross servers\n- partial replication possible (many->one (datawarehouse), or one-many\n(queries possible everywhere, updates only central) \n- goof for failover situations (backup server is standing by)\ncon:\n- bidirectional replication hard to set up (you'll have to implement\nconflict resolution according to your business rules)\n- different servers are not guaranteed to be in the same state.\n\nI can think of some scenarios where I would definitely want to\n*choose* one of the options. A load-balanced web environment would\nlikely want the first option, but synchronizing offices in different\ncontinents might not work with 2-phase commit over the network....\n\nAnd we have not even started talking about *managing* replicated\nenvironments. A lot of fail-over scenarios stop planning after the\nbackup host has take control. But how to get back? \n-- \n__________________________________________________\n\"Nothing is as subjective as reality\"\nReinoud van Leeuwen reinoud@xs4all.nl\nhttp://www.xs4all.nl/~reinoud\n__________________________________________________\n",
"msg_date": "Tue, 12 Jun 2001 22:59:23 GMT",
"msg_from": "reinoud@xs4all.nl (Reinoud van Leeuwen)",
"msg_from_op": false,
"msg_subject": "Re: AW: AW: Postgres Replication"
},
{
"msg_contents": "reinoud@xs4all.nl (Reinoud van Leeuwen) writes:\n> Well as I read back the thread I see 2 different approaches to\n> replication:\n> ...\n> I can think of some scenarios where I would definitely want to\n> *choose* one of the options.\n\nYes. IIRC, it looks to be possible to support a form of async\nreplication using the Postgres-R approach: you allow the cluster\nto break apart when communications fail, and then rejoin when\nyour link comes back to life. (This can work in principle, how\nclose it is to reality is another question; but the rejoin operation\nis the same as crash recovery, so you have to have it anyway.)\n\nSo this seems to me to allow getting most of the benefits of the async\napproach. OTOH it is difficult to see how to go the other way: getting\nthe benefits of a synchronous solution atop a basically-async\nimplementation doesn't seem like it can work.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 12 Jun 2001 19:39:18 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: AW: AW: Postgres Replication "
}
] |
[
{
"msg_contents": "In case Tom isn't sick of me yet...\n\nusers=# select '10.1.2.3/24'::inet::cidr;\n ?column? \n-------------\n 10.1.2.3/24\n\nwhile:\n\nusers=# select '10.1.2.3/24'::cidr;\nERROR: invalid CIDR value '10.1.2.3/24': has bits set to right of mask\n\nApparently, since there's no explicit function to cast from inet to cidr,\npostgresql assumes its always safe to do so, as they are\nbinary-compatible. Anyone mind if I create explicit function for this so\nthis could be flagged as error?\n\n-alex\n\n",
"msg_date": "Tue, 12 Jun 2001 09:58:21 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "inet/cidr wierdness (casting)"
},
{
"msg_contents": "Alex Pilosov <alex@pilosoft.com> writes:\n> Apparently, since there's no explicit function to cast from inet to cidr,\n> postgresql assumes its always safe to do so, as they are\n> binary-compatible.\n\nYes. I've thought for awhile that it was a mistake to treat them as\nbinary-compatible. However, you'd need a lot more operator/function\ndeclarations if they're not so marked.\n\n> Anyone mind if I create explicit function for this so\n> this could be flagged as error?\n\nWon't help if they are binary compatible...\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 12 Jun 2001 11:19:36 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: inet/cidr wierdness (casting) "
}
] |
[
{
"msg_contents": "\n> > I would be very interested in hearing about your experiences with\n> > this...\n\nWell, Eric thinks it works just spiffy. 8-)\n\nRecall is written in C++, and is meant to be extensible. It was\nextended for perl and the DBI layer. \n\nNote that this hack for perl is not perfect, especially in the area of\ntransactions and locks (which weren't a big deal for MySQL). Recall\nsupports active repliation with strict consistency. The perl\ninterface is cool hack, but Recall can do even more.\n\nI would love it if you folks could take a look. I'm working on an\nCORBA version right now. Any feedback would be very helpful. \n\nBesides... it don't cost nothin'\n\n-Eric\n",
"msg_date": "Tue, 12 Jun 2001 10:46:07 -0400",
"msg_from": "\"Eric C. Newton\" <ecn@metaslash.com>",
"msg_from_op": true,
"msg_subject": "Re: [Fwd: AW: Postgres Replication]"
},
{
"msg_contents": "Here is a basic lo_copy routine\n\nIt copies a large object from an existing large object\n\n\nPG_FUNCTION_INFO_V1(lo_copy);\n\nDatum\nlo_copy(PG_FUNCTION_ARGS)\n{\n Oid oldlobjId = PG_GETARG_OID(0);\n LargeObjectDesc *lobj,*oldlobj;\n int readbytes,\n writebytes;\n char buf[BUFSIZE];\n Oid lobjOid;\n\n\n oldlobj = inv_open(oldlobjId, INV_READ);\n if (lobj == NULL)\n elog(ERROR, \"lo_copy: can't open inv object %u\", oldlobjId);\n\n lobj = inv_create(INV_READ | INV_WRITE);\n if (lobj == NULL)\n elog(ERROR, \"lo_copy: can't create inv object\");\n lobjOid = lobj->id;\n\n while ((readbytes = inv_read(oldlobj, buf, BUFSIZE)) > 0)\n {\n writebytes = inv_write(lobj, buf, readbytes);\n if (writebytes != readbytes)\n elog(ERROR, \"lo_copy: error while copying\");\n }\n\n inv_close(oldlobj);\n inv_close(lobj);\n\n PG_RETURN_OID(lobjOid);\n}\n \n\n\n",
"msg_date": "Tue, 12 Jun 2001 12:33:51 -0400 (EDT)",
"msg_from": "Vince Roberts <vroberts@emanon.net>",
"msg_from_op": false,
"msg_subject": "lo_copy routine"
}
] |
[
{
"msg_contents": "\n Running postgres-7.0.3 on a RedHat 6.2 system:\n\n Recently I updated the schema of one of our tables (create, insert\nselect, drop, rename). We have a boolean column \"hitsingle\" with a default\nof 'f'.\n\nmedia=> \\d incantaaudioclipregistry\n Table \"incantaaudioclipregistry\"\n Attribute | Type | Modifier \n----------------+--------------+----------------------\n...\n releasedate | integer | not null\n...\n hitsingle | boolean | not null default 'f'\n...\n\n Lately newly inserted rows have been coming up with a value of 't', even\nthough that column is not mentioned in the insert (and therefore should get\nthe default value).\n\nmedia=> select releasedate, hitsingle, count(*) from incantaaudioclipregistry group by releasedate, hitsingle;\n\n releasedate | hitsingle | count \n-------------+-----------+-------\n...\n 1237 | f | 1984\n 1237 | t | 31\n 1237 | t | 429\n 1239 | f | 264\n 1239 | t | 26\n 1239 | t | 669\n...\n\n WTF is that?!\n\nmedia=> select count(*) from incantaaudioclipregistry where hitsingle and not hitsingle = 't';\n count \n-------\n 1098\n(1 row)\n\n So, I have T and no T!\n\n I tried replicating the problem on a small scale and couldn't. I can't\neven replicate it in the database with problems. Sigh.\n\n I have made copies of the files in base/media/ just in case somebody out\nthere could perform a forensic analysis.\n",
"msg_date": "Tue, 12 Jun 2001 11:37:37 -0400",
"msg_from": "Robert Forsman <thoth@purplefrog.com>",
"msg_from_op": true,
"msg_subject": "freaky results"
}
] |
[
{
"msg_contents": "We have the following item on TODO:\n\n\t* Overhaul pg_hba.conf host-based authentication\n\nCan people tell me what they want changed. I know we need the pg_shadow\npassword field encrypted in the table and I will work on that now.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Tue, 12 Jun 2001 12:28:44 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Improving pg_hba.conf"
},
{
"msg_contents": "On Tue, 12 Jun 2001, Bruce Momjian wrote:\n\nIt might be work while to add restrictions in the config file for user\nlevel locking, I realize that it can be done now...but having it in the\npg_hba.conf file could make it easier...\n\n\n\n> We have the following item on TODO:\n>\n> \t* Overhaul pg_hba.conf host-based authentication\n>\n> Can people tell me what they want changed. I know we need the pg_shadow\n> password field encrypted in the table and I will work on that now.\n>\n> --\n> Bruce Momjian | http://candle.pha.pa.us\n> pgman@candle.pha.pa.us | (610) 853-3000\n> + If your life is a hard drive, | 830 Blythe Avenue\n> + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n>\n> ---------------------------(end of broadcast)---------------------------\n> TIP 4: Don't 'kill -9' the postmaster\n>\n\n Chris Bowlby,\n -----------------------------------------------------\n Web Developer @ Hub.org.\n excalibur@hub.org\n www.hub.org\n 1-902-542-3657\n -----------------------------------------------------\n\n",
"msg_date": "Tue, 12 Jun 2001 15:07:05 -0400 (EDT)",
"msg_from": "Chris Bowlby <excalibur@hub.org>",
"msg_from_op": false,
"msg_subject": "Re: Improving pg_hba.conf"
},
{
"msg_contents": "\nI don't think that belongs in pg_hba.conf.\n\n\n> On Tue, 12 Jun 2001, Bruce Momjian wrote:\n> \n> It might be work while to add restrictions in the config file for user\n> level locking, I realize that it can be done now...but having it in the\n> pg_hba.conf file could make it easier...\n> \n> \n> \n> > We have the following item on TODO:\n> >\n> > \t* Overhaul pg_hba.conf host-based authentication\n> >\n> > Can people tell me what they want changed. I know we need the pg_shadow\n> > password field encrypted in the table and I will work on that now.\n> >\n> > --\n> > Bruce Momjian | http://candle.pha.pa.us\n> > pgman@candle.pha.pa.us | (610) 853-3000\n> > + If your life is a hard drive, | 830 Blythe Avenue\n> > + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n> >\n> > ---------------------------(end of broadcast)---------------------------\n> > TIP 4: Don't 'kill -9' the postmaster\n> >\n> \n> Chris Bowlby,\n> -----------------------------------------------------\n> Web Developer @ Hub.org.\n> excalibur@hub.org\n> www.hub.org\n> 1-902-542-3657\n> -----------------------------------------------------\n> \n> \n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Tue, 12 Jun 2001 15:08:01 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Improving pg_hba.conf"
},
{
"msg_contents": "Bruce Momjian wrote:\n> \n> We have the following item on TODO:\n> \n> * Overhaul pg_hba.conf host-based authentication\n> \n> Can people tell me what they want changed. I know we need the pg_shadow\n> password field encrypted in the table and I will work on that now.\n\nWhy doesn't postgres put the contents pg_hba.conf in a table? That way it comes\nfor free when you reinitialize and restore a database?\n",
"msg_date": "Wed, 13 Jun 2001 06:02:18 -0400",
"msg_from": "mlw <markw@mohawksoft.com>",
"msg_from_op": false,
"msg_subject": "Re: Improving pg_hba.conf"
},
{
"msg_contents": "> Bruce Momjian wrote:\n> > \n> > We have the following item on TODO:\n> > \n> > * Overhaul pg_hba.conf host-based authentication\n> > \n> > Can people tell me what they want changed. I know we need the pg_shadow\n> > password field encrypted in the table and I will work on that now.\n> \n> Why doesn't postgres put the contents pg_hba.conf in a table? That way it comes\n> for free when you reinitialize and restore a database?\n\nThe file has to be read by the postmaster and the postmaster has no\naccess to data tables for speed and security reasons.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Wed, 13 Jun 2001 09:50:38 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Re: Improving pg_hba.conf"
},
{
"msg_contents": "Chris Bowlby writes:\n\n> It might be work while to add restrictions in the config file for user\n> level locking, I realize that it can be done now...but having it in the\n> pg_hba.conf file could make it easier...\n\nThis would be mostly pointless since you can create locks with judicious\nuse of insert/update/delete. I don't suppose you want to let those\ncommands run without the appropriate locks.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Wed, 13 Jun 2001 17:39:38 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: Re: Improving pg_hba.conf"
},
{
"msg_contents": "mlw writes:\n\n> Why doesn't postgres put the contents pg_hba.conf in a table? That way it comes\n> for free when you reinitialize and restore a database?\n\nBecause if you hosed that table you would have hosed your entire\ninstallation.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Wed, 13 Jun 2001 17:40:11 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: Re: Improving pg_hba.conf"
},
{
"msg_contents": "Peter Eisentraut wrote:\n\n> mlw writes:\n>\n> > Why doesn't postgres put the contents pg_hba.conf in a table? That way it comes\n> > for free when you reinitialize and restore a database?\n>\n> Because if you hosed that table you would have hosed your entire\n> installation.\n>\n\nYou could use a bki script to fix the problem in stand alone mode if need be. I\ndon't think breaking this table is really an issue. My only concerns would be the\nchicken vs egg problem connecting to the system, and security. Assuming these issues\ncould be resolved, I think having this info in a table would be beneficial for\nmaintenance.\n\n\n",
"msg_date": "Wed, 13 Jun 2001 13:07:04 -0400",
"msg_from": "mlw <markw@mohawksoft.com>",
"msg_from_op": false,
"msg_subject": "Re: Re: Improving pg_hba.conf"
},
{
"msg_contents": "> We have the following item on TODO:\n> \n> \t* Overhaul pg_hba.conf host-based authentication\n> \n> Can people tell me what they want changed. I know we need the pg_shadow\n> password field encrypted in the table and I will work on that now.\n\nI haven't heard of any more issues with pg_hba.conf so I will mark the\nitem as done. I did cleanup the comments in the file. I have also\nadded a TODO item:\n\n\t* Read pg_hba.conf only on postmaster startup or SIGHUP\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 9 Jul 2001 17:31:35 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Improving pg_hba.conf"
},
{
"msg_contents": ">\n>\n>I haven't heard of any more issues with pg_hba.conf so I will mark the\n>item as done. I did cleanup the comments in the file. I have also\n>added a TODO item:\n>\n>\t* Read pg_hba.conf only on postmaster startup or SIGHUP\n>\n\nIf you do this, can you add an access table for secondary lookups? I \ntend to update host access frequently and personally I think it'd be \ndandy to have a table that can be updated for access as well as the \nprimary pg_hba.conf file.\n\nDavid\n\n\n",
"msg_date": "Sun, 22 Jul 2001 22:59:13 -0400",
"msg_from": "David Ford <david@blue-labs.org>",
"msg_from_op": false,
"msg_subject": "Re: Improving pg_hba.conf"
},
{
"msg_contents": "> >\n> >\n> >I haven't heard of any more issues with pg_hba.conf so I will mark the\n> >item as done. I did cleanup the comments in the file. I have also\n> >added a TODO item:\n> >\n> >\t* Read pg_hba.conf only on postmaster startup or SIGHUP\n> >\n> \n> If you do this, can you add an access table for secondary lookups? I \n> tend to update host access frequently and personally I think it'd be \n> dandy to have a table that can be updated for access as well as the \n> primary pg_hba.conf file.\n\nSorry, I don't understand what secondary lookups are.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Sun, 22 Jul 2001 23:01:05 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Improving pg_hba.conf"
},
{
"msg_contents": "What I mean is, do host lookups first in the text file, then if a \npg_hostaccess table (example) exists, check it for host entries. This \nalleviates HUP or restart etc. to reload a config file.\n\nDavid\n\nBruce Momjian wrote:\n\n>>>\n>>>I haven't heard of any more issues with pg_hba.conf so I will mark the\n>>>item as done. I did cleanup the comments in the file. I have also\n>>>added a TODO item:\n>>>\n>>>\t* Read pg_hba.conf only on postmaster startup or SIGHUP\n>>>\n>>If you do this, can you add an access table for secondary lookups? I \n>>tend to update host access frequently and personally I think it'd be \n>>dandy to have a table that can be updated for access as well as the \n>>primary pg_hba.conf file.\n>>\n>\n>Sorry, I don't understand what secondary lookups are.\n>\n\n\n",
"msg_date": "Mon, 23 Jul 2001 01:38:11 -0400",
"msg_from": "David Ford <david@blue-labs.org>",
"msg_from_op": false,
"msg_subject": "Re: Improving pg_hba.conf"
},
{
"msg_contents": "> What I mean is, do host lookups first in the text file, then if a \n> pg_hostaccess table (example) exists, check it for host entries. This \n> alleviates HUP or restart etc. to reload a config file.\n\nCan't do that. Postmaster has no database access. Must be fast.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 23 Jul 2001 05:56:17 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Improving pg_hba.conf"
}
] |
[
{
"msg_contents": "> Here are some disadvantages to using a \"trigger based\" approach:\n> \n> 1) Triggers simply transfer individual data items when they \n> are modified, they do not keep track of transactions.\n\nI don't know about other *async* replication engines but Rserv\nkeeps track of transactions (if I understood you corectly).\nRserv transfers not individual modified data items but\n*consistent* snapshot of changes to move slave database from\none *consistent* state (when all RI constraints satisfied)\nto another *consistent* state.\n\n> 4) The activation of triggers in a database cannot be easily\n> rolled back or undone.\n\nWhat do you mean?\n\nVadim\n",
"msg_date": "Tue, 12 Jun 2001 10:30:27 -0700",
"msg_from": "\"Mikheev, Vadim\" <vmikheev@SECTORBASE.COM>",
"msg_from_op": true,
"msg_subject": "RE: AW: Postgres Replication"
},
{
"msg_contents": "\n\n> > Here are some disadvantages to using a \"trigger based\" approach:\n> >\n> > 1) Triggers simply transfer individual data items when they\n> > are modified, they do not keep track of transactions.\n\n> I don't know about other *async* replication engines but Rserv\n> keeps track of transactions (if I understood you corectly).\n> Rserv transfers not individual modified data items but\n> *consistent* snapshot of changes to move slave database from\n> one *consistent* state (when all RI constraints satisfied)\n> to another *consistent* state.\n\nI thought Andreas did a good job of correcting me here. Transaction-\nbased replication with triggers do not apply to points 1 and 4. I\nshould have made a distinction between non-transaction and \ntransaction based replication with triggers. I was not trying to\nsingle out rserv or any other project, and I can see how my wording \nimplies this misinterpretation (my apologies).\n \n\n> > 4) The activation of triggers in a database cannot be easily\n> > rolled back or undone.\n\n> What do you mean?\n\nOnce the trigger fires, it is not an easy task to abort that \nexecution via rollback or undo. Again this is not an issue \nwith a transaction-based trigger approach.\n\n\nSincerely,\n\nDarren\n",
"msg_date": "Tue, 12 Jun 2001 18:29:20 GMT",
"msg_from": "Darren Johnson <djohnson@greatbridge.com>",
"msg_from_op": false,
"msg_subject": "RE: AW: Postgres Replication"
}
] |
[
{
"msg_contents": "Anyone know of any alternatives to using pgAdmin to migrate a database\n(schema and data) from Foxpro to PostgreSQL? pgAdmin worked fine on my\ninitial test database, but it was slow... very slow. I'd like to try to\nmigrate one of our production databases, where several tables have\n200,000+ records each. I can export the data into a PG COPY friendly\nformat, but was wondering if anyone knew of a tool that would migrate\nall of the primary keys and indexes too? Or a perl utility that would\nread the Foxpro database and generate the SQL commands needed to create\nthe tables and indexes?\n\n",
"msg_date": "Tue, 12 Jun 2001 13:36:02 -0400",
"msg_from": "\"P. Dwayne Miller\" <dmiller@espgroup.net>",
"msg_from_op": true,
"msg_subject": "Migration from FoxPro"
},
{
"msg_contents": "On Tue, 12 Jun 2001 13:36:02 -0400, you wrote:\n\n>Anyone know of any alternatives to using pgAdmin to migrate a database\n>(schema and data) from Foxpro to PostgreSQL? pgAdmin worked fine on my\n>initial test database, but it was slow... very slow. I'd like to try to\n>migrate one of our production databases, where several tables have\n>200,000+ records each. I can export the data into a PG COPY friendly\n>format, but was wondering if anyone knew of a tool that would migrate\n>all of the primary keys and indexes too? Or a perl utility that would\n>read the Foxpro database and generate the SQL commands needed to create\n>the tables and indexes?\n>\n\n(assuming you use some windows version :-)\n\n- Download the Powerdesigner 45 day trial from www.sybase.com\n- make an ODBC connection to your database\n- reverse engineer the datamodel\n- change the target model to postgresql\n- install postgresql odbc drivers\n- generate a database creation script and execute it through the ODBC\nconnection\n- create a report of your database for your documentation :-)\n-- \n__________________________________________________\n\"Nothing is as subjective as reality\"\nReinoud van Leeuwen reinoud@xs4all.nl\nhttp://www.xs4all.nl/~reinoud\n__________________________________________________\n",
"msg_date": "Tue, 12 Jun 2001 22:47:42 GMT",
"msg_from": "reinoud@xs4all.nl (Reinoud van Leeuwen)",
"msg_from_op": false,
"msg_subject": "Re: Migration from FoxPro"
}
] |
[
{
"msg_contents": "\tI know that vacuum has come up in the past, and even saw the\ndiscussion about putting a cron entry to have it run every once in a while,\nbut I don't remember seeing anything about having it kick off via a trigger\nevery so may inserts.\n\tIs there a relative consensus for how often to run vacuum? I have a\ntable of about 8 columns that I fill with 100,000 items simply via a \"\\i\nalarms.sql\". After 1,000 items or so it gets extremely slow to fill with\ndata, and will take over a day to fill the entire thing unless I run vacuum\nonce a minute.\n\tIs there a way to run vacuum every so many inserts, updates, and\ndeletes? (with 1 table the trigger is easy, but is there a global way to\ncheck no matter which tables are utilized?).\n\n\tDo other DBMSs such as Oracle run into the same problem and need to\nbe vacuumed, in their own sort of way?\n\nThanks for any insight,\nMike\n",
"msg_date": "Tue, 12 Jun 2001 10:57:40 -0700",
"msg_from": "Mike Cianflone <mcianflone@littlefeet-inc.com>",
"msg_from_op": true,
"msg_subject": "vacuum"
},
{
"msg_contents": "Mike Cianflone <mcianflone@littlefeet-inc.com> writes:\n\n> \tI know that vacuum has come up in the past, and even saw the\n> discussion about putting a cron entry to have it run every once in a while,\n> but I don't remember seeing anything about having it kick off via a trigger\n> every so may inserts.\n> \tIs there a relative consensus for how often to run vacuum? I have a\n> table of about 8 columns that I fill with 100,000 items simply via a \"\\i\n> alarms.sql\". After 1,000 items or so it gets extremely slow to fill with\n> data, and will take over a day to fill the entire thing unless I run vacuum\n> once a minute.\n\nUmmm... Are you wrapping the inserts in a transaction? If not, no\nwonder it's slow--you're paying transaction overhead for each insert.\n\nI don't think VACUUM has that much effect on insert performance, as\ninsert doesn't leave empty space in existing pages.\n\nTry using COPY instead of INSERT, or at least wrap all your inserts in \na transaction. Also, drop indexes before running the insert, and\nrecreate them afterwards.\n\n-Doug\n-- \nThe rain man gave me two cures; he said jump right in,\nThe first was Texas medicine--the second was just railroad gin,\nAnd like a fool I mixed them, and it strangled up my mind,\nNow people just get uglier, and I got no sense of time... --Dylan\n",
"msg_date": "13 Jun 2001 11:39:05 -0400",
"msg_from": "Doug McNaught <doug@wireboard.com>",
"msg_from_op": false,
"msg_subject": "Re: vacuum"
}
] |
[
{
"msg_contents": "Hi,\r\n\r\nMy project requires to use Big5/EUC_TW (two bytes per\r\nchinese-character).\r\n\r\nUnfortunately, Big5 code contains escape '\\'.\r\nFor instance,\r\n1: create table \"¦¨¥\\ªº¤@¥b\" (n int, m text);\r\n2: create table n (n int, m text);\r\n3: insert into n values (19,'¦nªº¶}©l¬O¦¨¥\\ªº¤@¥b'); -- 10 chinese\r\ncharacters\r\n4: select * from n;\r\n n | m\r\n----+----------------------\r\n 15 | ¦nªº¶}©l¬O¦¨¥ªº¤@¥b\r\n\r\nTable name in line 1 is ¦¨¥\\ªº¤@¥b. With \", there is no problem. Line\r\n3 tries to insert a value with escape '\\'. I realized this '\\' is\r\ngone. Of course, what we see are totally nonsense after the 6th\r\ncharacter.\r\n\r\nThis can be fixed by creating a MULTIBYTE block in scansup.c (see\r\nattachment). Can you put this in the next release if there is no\r\nobjection (or bugs). :-)\r\n\r\nI am thinking about to write an introduction book for PostgreSQL in\r\nchinese (big5). With this problem, it will be hard to convince them to\r\nuse PostgreSQL.\r\n\r\n--\r\nRegards,\r\nLimin Liu",
"msg_date": "Tue, 12 Jun 2001 11:18:54 -0700",
"msg_from": "Limin Liu <limin@pumpkinnet.com>",
"msg_from_op": true,
"msg_subject": "Big5 contains '\\'"
},
{
"msg_contents": "> Unfortunately, Big5 code contains escape '\\'.\r\n> For instance,\r\n> 1: create table \"¦¨¥\\ªº¤@¥b\" (n int, m text);\r\n> 2: create table n (n int, m text);\r\n> 3: insert into n values (19,'¦nªº¶}©l¬O¦¨¥\\ªº¤@¥b'); -- 10 chinese\r\n> characters\r\n> 4: select * from n;\r\n> n | m\r\n> ----+----------------------\r\n> 15 | ¦nªº¶}©l¬O¦¨¥ªº¤@¥b\r\n>\r\n\r\nMy previous approach was not able to provide scape-escape. I.e. \"\\\\t\" will\r\nremain as \"\\\\t\". Here is the new update. I tried the following... It looks\r\nfine on all cases.\r\n\r\ninsert into n values (21,'¦nªº¶}©l¬O¦¨¥\\ªº¤@¥b \\t \\\\t \\\\\\try \\\\\\\\test2');\r\nselect * from n;\r\n n | m\r\n----+----------------------\r\n 21 | ¦nªº¶}©l¬O¦¨¥\\ªº¤@¥b \\t \\ ry \\\\test2\r\n\r\n\r\n--\r\nRegards,\r\nLimin Liu",
"msg_date": "Tue, 12 Jun 2001 13:31:04 -0700",
"msg_from": "Limin Liu <limin@pumpkinnet.com>",
"msg_from_op": true,
"msg_subject": "Re: Big5 contains '\\'"
},
{
"msg_contents": "> My project requires to use Big5/EUC_TW (two bytes per\n> chinese-character).\n> \n> Unfortunately, Big5 code contains escape '\\'.\n\nPostgreSQL can handle Big5 since 6.5. Create a database with the encoding\nEUC_TW, and set the client side encoding to BIG5. For example, set\nPGCLIENTENCODING envrionment variable to BIG5 before starting psql or\nany libpq based clients. For 7.0 or greater version of PostgreSQL, you\ncould also use \\encoding command in psql.\n--\nTatsuo Ishii\n",
"msg_date": "Wed, 13 Jun 2001 09:03:43 +0900",
"msg_from": "Tatsuo Ishii <t-ishii@sra.co.jp>",
"msg_from_op": false,
"msg_subject": "Re: Big5 contains '\\'"
}
] |
[
{
"msg_contents": "Here is a patch that will warn you during VACUUM when you are within 75%\nof oid/xid wraparound.\n\nI will apply it if 7.2 has no solution to the wraparounds.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n\nIndex: src/backend/commands/vacuum.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/commands/vacuum.c,v\nretrieving revision 1.195\ndiff -c -r1.195 vacuum.c\n*** src/backend/commands/vacuum.c\t2001/05/25 15:45:32\t1.195\n--- src/backend/commands/vacuum.c\t2001/06/12 23:25:58\n***************\n*** 159,166 ****\n static bool enough_space(VacPage vacpage, Size len);\n static void init_rusage(VacRUsage *ru0);\n static char *show_rusage(VacRUsage *ru0);\n \n- \n /*\n * Primary entry point for VACUUM and ANALYZE commands.\n */\n--- 159,166 ----\n static bool enough_space(VacPage vacpage, Size len);\n static void init_rusage(VacRUsage *ru0);\n static char *show_rusage(VacRUsage *ru0);\n+ static void check_limits(void);\n \n /*\n * Primary entry point for VACUUM and ANALYZE commands.\n */\n***************\n*** 236,241 ****\n--- 236,242 ----\n \n \t/* clean up */\n \tvacuum_shutdown();\n+ \tcheck_limits();\n }\n \n /*\n***************\n*** 2645,2648 ****\n--- 2646,2672 ----\n \t\t\t (int) (ru1.tv.tv_usec - ru0->tv.tv_usec) / 10000);\n \n \treturn result;\n+ }\n+ \n+ /*\n+ *\tcheck if we are near OID or XID wraparound\n+ */\n+ static void check_limits(void)\n+ {\n+ \tOid nextOid;\n+ \n+ \t/* If we are 75% to the limit, warn the user */\n+ \tif (GetCurrentTransactionId() >\n+ \t\t~(TransactionId)0 - (~(TransactionId)0) / 4)\n+ \t\telog(NOTICE,\"You are within 75%% of the limit for transaction ids.\\n\"\n+ \t\t\t\"Dumping your databases, running initdb, and reloading will reset\\n\"\n+ \t\t\t\"the transaction id counter.\");\n+ \n+ \t/* If we are 75% to the limit, warn the user */\n+ \tGetNewObjectId(&nextOid);\n+ \tif (nextOid > ~(Oid)0 - (~(Oid)0) / 4)\n+ \t\telog(NOTICE,\"You are within 75%% of the limit for object ids.\\n\"\n+ \t\t\t\"If you are not using object ids as primary keys, dumping your\\n\"\n+ \t\t\t\"databases, running initdb, and reloading will reset\\n\"\n+ \t\t\t\"the oid counter.\");\n }",
"msg_date": "Tue, 12 Jun 2001 19:33:15 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Patch to warn about oid/xid wraparound"
},
{
"msg_contents": "On Tuesday 12 June 2001 19:33, Bruce Momjian wrote:\n> Here is a patch that will warn you during VACUUM when you are within 75%\n> of oid/xid wraparound.\n\n> I will apply it if 7.2 has no solution to the wraparounds.\n\nIs this something a potential 7.1.3 release might need? I consider this a \nbug workaround, actually. Or even a feature patch against 7.1.x that people \ncan download if they think they need it?\n\nAs PostgreSQL gets used in bigger and bigger database installations, the \nwraparound problems become more and more likely. And it's likely to be at \nleast six months before 7.2beta, if the track record stays the same as it has \nthe last three releases.\n--\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n",
"msg_date": "Wed, 13 Jun 2001 10:54:48 -0400",
"msg_from": "Lamar Owen <lamar.owen@wgcr.org>",
"msg_from_op": false,
"msg_subject": "Re: Patch to warn about oid/xid wraparound"
},
{
"msg_contents": "> On Tuesday 12 June 2001 19:33, Bruce Momjian wrote:\n> > Here is a patch that will warn you during VACUUM when you are within 75%\n> > of oid/xid wraparound.\n> \n> > I will apply it if 7.2 has no solution to the wraparounds.\n> \n> Is this something a potential 7.1.3 release might need? I consider this a \n> bug workaround, actually. Or even a feature patch against 7.1.x that people \n> can download if they think they need it?\n> \n> As PostgreSQL gets used in bigger and bigger database installations, the \n> wraparound problems become more and more likely. And it's likely to be at \n> least six months before 7.2beta, if the track record stays the same as it has \n> the last three releases.\n\nHere is an new patch that updates the percentage display when it is run,\nrather than just displaying 75%. I had to do the computation using\nfloats to prevent overflow.\n\nAgain, I will put this in 7.2 if we have no solution for rollover.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n\nIndex: src/backend/commands/vacuum.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/commands/vacuum.c,v\nretrieving revision 1.195\ndiff -c -r1.195 vacuum.c\n*** src/backend/commands/vacuum.c\t2001/05/25 15:45:32\t1.195\n--- src/backend/commands/vacuum.c\t2001/06/13 18:46:01\n***************\n*** 159,166 ****\n static bool enough_space(VacPage vacpage, Size len);\n static void init_rusage(VacRUsage *ru0);\n static char *show_rusage(VacRUsage *ru0);\n \n- \n /*\n * Primary entry point for VACUUM and ANALYZE commands.\n */\n--- 159,166 ----\n static bool enough_space(VacPage vacpage, Size len);\n static void init_rusage(VacRUsage *ru0);\n static char *show_rusage(VacRUsage *ru0);\n+ static void check_limits(void);\n \n /*\n * Primary entry point for VACUUM and ANALYZE commands.\n */\n***************\n*** 236,241 ****\n--- 236,242 ----\n \n \t/* clean up */\n \tvacuum_shutdown();\n+ \tcheck_limits();\n }\n \n /*\n***************\n*** 2645,2648 ****\n--- 2646,2674 ----\n \t\t\t (int) (ru1.tv.tv_usec - ru0->tv.tv_usec) / 10000);\n \n \treturn result;\n+ }\n+ \n+ /*\n+ *\tcheck if we are near OID or XID wraparound\n+ */\n+ static void check_limits(void)\n+ {\n+ \tOid nextOid;\n+ \n+ \t/* If we are 75% to the limit, warn the user */\n+ \tif (GetCurrentTransactionId() >\n+ \t\t~(TransactionId)0 - (~(TransactionId)0) / 4)\n+ \t\telog(NOTICE,\"You are %.0f%% from the limit for transaction ids.\\n\"\n+ \t\t\t\"\\t Dumping your databases, running initdb, and reloading will reset\\n\"\n+ \t\t\t\"\\t the transaction id counter.\",\n+ \t\t\tGetCurrentTransactionId() - (float)(~(TransactionId)0) * 100);\n+ \n+ \t/* If we are 75% to the limit, warn the user */\n+ \tGetNewObjectId(&nextOid);\n+ \tif (nextOid > ~(Oid)0 - (~(Oid)0) / 4)\n+ \t\telog(NOTICE,\"You are %.0f%% from the limit for object ids.\\n\"\n+ \t\t\t\"\\t If you are not using object ids as primary keys, dumping your\\n\"\n+ \t\t\t\"\\t databases, running initdb, and reloading will reset\\n\"\n+ \t\t\t\"\\t the oid counter.\",\n+ \t\t\t(float)nextOid / (float)~(Oid)0 * 100);\n }",
"msg_date": "Wed, 13 Jun 2001 15:56:06 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Patch to warn about oid/xid wraparound"
},
{
"msg_contents": "Bruce Momjian writes:\n\n> Here is an new patch that updates the percentage display when it is run,\n> rather than just displaying 75%. I had to do the computation using\n> floats to prevent overflow.\n\nYou could use ldiv().\n\nAlso, UINT_MAX (for transaction id) and OID_MAX (for Oid) might be\npreferred over ~0.\n\nBtw., there is a typo here:\n\n> GetCurrentTransactionId() - (float)(~(TransactionId)0) * 100);\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Wed, 13 Jun 2001 22:35:26 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: Patch to warn about oid/xid wraparound"
},
{
"msg_contents": "> Bruce Momjian writes:\n> \n> > Here is an new patch that updates the percentage display when it is run,\n> > rather than just displaying 75%. I had to do the computation using\n> > floats to prevent overflow.\n\n\nSorry, I should have been doing this on patches list.\n\n> You could use ldiv().\n\nIt is overflow that I am worried about: curr/max * 100\nI don't see how ldiv helps here.\n\n> \n> Also, UINT_MAX (for transaction id) and OID_MAX (for Oid) might be\n> preferred over ~0.\n\nDone. Patch attached.\n\n> \n> Btw., there is a typo here:\n> \n> > GetCurrentTransactionId() - (float)(~(TransactionId)0) * 100);\n\nThanks. Fixed. I hadn't gotten to testing the transaction code yet,\njust the oid test.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n\nIndex: src/backend/commands/vacuum.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/commands/vacuum.c,v\nretrieving revision 1.195\ndiff -c -r1.195 vacuum.c\n*** src/backend/commands/vacuum.c\t2001/05/25 15:45:32\t1.195\n--- src/backend/commands/vacuum.c\t2001/06/13 21:01:37\n***************\n*** 17,22 ****\n--- 17,23 ----\n #include <fcntl.h>\n #include <unistd.h>\n #include <time.h>\n+ #include <limits.h>\n #include <sys/time.h>\n #include <sys/types.h>\n #include <sys/file.h>\n***************\n*** 159,166 ****\n static bool enough_space(VacPage vacpage, Size len);\n static void init_rusage(VacRUsage *ru0);\n static char *show_rusage(VacRUsage *ru0);\n \n- \n /*\n * Primary entry point for VACUUM and ANALYZE commands.\n */\n--- 160,167 ----\n static bool enough_space(VacPage vacpage, Size len);\n static void init_rusage(VacRUsage *ru0);\n static char *show_rusage(VacRUsage *ru0);\n+ static void check_limits(void);\n \n /*\n * Primary entry point for VACUUM and ANALYZE commands.\n */\n***************\n*** 236,241 ****\n--- 237,243 ----\n \n \t/* clean up */\n \tvacuum_shutdown();\n+ \tcheck_limits();\n }\n \n /*\n***************\n*** 2645,2648 ****\n--- 2647,2674 ----\n \t\t\t (int) (ru1.tv.tv_usec - ru0->tv.tv_usec) / 10000);\n \n \treturn result;\n+ }\n+ \n+ /*\n+ *\tcheck if we are near OID or XID wraparound\n+ */\n+ static void check_limits(void)\n+ {\n+ \tOid nextOid;\n+ \n+ \t/* If we are 75% to the limit, warn the user */\n+ \tif (GetCurrentTransactionId() > UINT_MAX - UINT_MAX / 4)\n+ \t\telog(NOTICE,\"You are %.0f%% toward the limit for transaction ids.\\n\"\n+ \t\t\t\"\\t Dumping your databases, running initdb, and reloading will reset\\n\"\n+ \t\t\t\"\\t the transaction id counter.\",\n+ \t\t\tGetCurrentTransactionId() / (float)UINT_MAX * 100);\n+ \n+ \t/* If we are 75% to the limit, warn the user */\n+ \tGetNewObjectId(&nextOid);\n+ \tif (nextOid > OID_MAX - OID_MAX / 4)\n+ \t\telog(NOTICE,\"You are %.0f%% toward the limit for object ids.\\n\"\n+ \t\t\t\"\\t If you are not using object ids as primary keys, dumping your\\n\"\n+ \t\t\t\"\\t databases, running initdb, and reloading will reset\\n\"\n+ \t\t\t\"\\t the oid counter.\",\n+ \t\t\t(float)nextOid / OID_MAX * 100);\n }",
"msg_date": "Wed, 13 Jun 2001 17:04:32 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Patch to warn about oid/xid wraparound"
}
] |
[
{
"msg_contents": "\n> \tIs there a relative consensus for how often to run vacuum? I have a\n> table of about 8 columns that I fill with 100,000 items simply via a \"\\i\n> alarms.sql\". After 1,000 items or so it gets extremely slow to fill with\n> data, and will take over a day to fill the entire thing unless I run vacuum\n> once a minute.\n\nYou will have to tell us, what exactly your alarms.sql does, and what indexes \nyour table has. Above behavior is certainly not to be expected in general,\nespecially the \"vacuum once a minute\" is highly suspicious.\n\nFor a series of insert only statements, the vacuum is not supposed to help at \nall, thus there must be an update hidden somewhere. \n\nAndreas\n",
"msg_date": "Wed, 13 Jun 2001 10:03:35 +0200",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: vacuum"
},
{
"msg_contents": "On Wed, 13 Jun 2001, Zeugswetter Andreas SB wrote:\n\n>\n> > \tIs there a relative consensus for how often to run vacuum? I have a\n> > table of about 8 columns that I fill with 100,000 items simply via a \"\\i\n> > alarms.sql\". After 1,000 items or so it gets extremely slow to fill with\n> > data, and will take over a day to fill the entire thing unless I run vacuum\n> > once a minute.\n>\n> You will have to tell us, what exactly your alarms.sql does, and what indexes\n> your table has. Above behavior is certainly not to be expected in general,\n> especially the \"vacuum once a minute\" is highly suspicious.\n>\n> For a series of insert only statements, the vacuum is not supposed to help at\n> all, thus there must be an update hidden somewhere.\n\nthe one question I'd have is what does the table size look like\nbefore/after this 'once a minute vacuum'? I have one client that has\ncontinuous UPDATEs happening to his table, no INSERTs, no DELETEs ... and\nhis tables quicklky grow from a 8k table to 65Meg if there is no vacuum\nhappening every few *hours* ...\n\nThe other question is, what are your startup parameters? What sort of\nshared memory buffer are you working with? I image that VACUUM does a\nflush to disk, so are 1000 items filling your buffer(s), causing an almost\ncontinue fsync to disk for each INSERT after that ... so the VACUUM is\nclearing the buffer(s) to disk, giving your space again to do quick\nINSERTs for 1000 records again?\n\n",
"msg_date": "Wed, 13 Jun 2001 06:54:16 -0300 (ADT)",
"msg_from": "The Hermit Hacker <scrappy@hub.org>",
"msg_from_op": false,
"msg_subject": "Re: AW: vacuum"
},
{
"msg_contents": "The same question ... how's the size after you vacuum the tables/db ?\n\n> continuous UPDATEs happening to his table, no INSERTs, no DELETEs ... and\n> his tables quicklky grow from a 8k table to 65Meg if there is no vacuum\n> happening every few *hours* ...\n\nTIA\nAndy\n\n\n",
"msg_date": "Wed, 13 Jun 2001 17:49:33 +0700",
"msg_from": "\"Andy Samuel\" <andysamuel@geocities.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: vacuum"
},
{
"msg_contents": "\n8k ...\n\nOn Wed, 13 Jun 2001, Andy Samuel wrote:\n\n> The same question ... how's the size after you vacuum the tables/db ?\n>\n> > continuous UPDATEs happening to his table, no INSERTs, no DELETEs ... and\n> > his tables quicklky grow from a 8k table to 65Meg if there is no vacuum\n> > happening every few *hours* ...\n>\n> TIA\n> Andy\n>\n>\n>\n> ---------------------------(end of broadcast)---------------------------\n> TIP 3: if posting/reading through Usenet, please send an appropriate\n> subscribe-nomail command to majordomo@postgresql.org so that your\n> message can get through to the mailing list cleanly\n>\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org\nprimary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org\n\n",
"msg_date": "Wed, 13 Jun 2001 08:55:32 -0300 (ADT)",
"msg_from": "The Hermit Hacker <scrappy@hub.org>",
"msg_from_op": false,
"msg_subject": "Re: AW: vacuum"
}
] |
[
{
"msg_contents": "\n> Well as I read back the thread I see 2 different approaches to\n> replication:\n> \n> 1: tight integrated replication. \n> pro:\n> - bi-directional (or multidirectional): updates are possible everywhere\n> - A cluster of servers allways has the same state. \n> - it does not matter to which server you connect\n> con:\n> - network between servers will be a bottleneck, especially if it is a\n> WAN connection\n> - only full replication possible\n\nI do not understand that point, if it is trigger based, you \nhave all the flexibility you need. (only some tables, only some rows,\ndifferent rows to different targets ....), \n(or do you mean not all targets, that could also be achieved with triggers)\n\n> - what happens if one server is down? (or the network between) are\n> commits still possible\n\nNo, updates are not possible if one target is not reachable, \nthat would not be synchronous and would again need business rules\nto resolve conflicts.\n\nAllowing updates when a target is not reachable would require admin \nintervention.\n\nAndreas\n",
"msg_date": "Wed, 13 Jun 2001 11:55:48 +0200",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: AW: AW: Postgres Replication"
},
{
"msg_contents": "\n> > - only full replication possible\n\n> I do not understand that point, if it is trigger based, you\n> have all the flexibility you need. (only some tables, only some rows,\n> different rows to different targets ....),\n> (or do you mean not all targets, that could also be achieved with \ntriggers)\n\nCurrently with Postgres-R, it is one database replicating all tables to \nall servers in the group communication system. There are some ways \naround\nthis by invoking the -r option when a SQL statement should be replicated, \nand leaving the -r option off for non-replicated scenarios. IMHO this is\nnot a good solution. \n\nA better solution will need to be implemented, which involves a \nsubscription table(s) with relation/server information. There are two\nideas for subscribing and receiving replicated data.\n\n1) Receiver driven propagation - A simple solution where all \ntransactions are propagated and the receiving servers will reference\nthe subscription information before applying updates.\n\n2) Sender driven propagation - A more optimal and complex solution \nwhere servers do not receive any messages regarding data items for \nwhich they have not subscribed\n\n\n> > - what happens if one server is down? (or the network between) are\n> > commits still possible\n\n> No, updates are not possible if one target is not reachable,\n\nAFAIK, Postgres-R can still replicate if one target is not reachable,\nbut only to the remaining servers ;). \n\nThere is a scenario that could arise if a server issues a lock \nrequest then fails or goes off line. There is code that checks \nfor this condition, which needs to be merged with the branch we have.\n\n> that would not be synchronous and would again need business rules\n> to resolve conflicts.\n\nYes the failed server would not be synchronized, and getting this\nfailed server back in sync needs to be addressed.\n\n> Allowing updates when a target is not reachable would require admin\n> intervention.\n\nIn its current state yes, but our goal would be to eliminate this\nrequirement as well.\n\n\n\nDarren\n",
"msg_date": "Wed, 13 Jun 2001 14:44:11 GMT",
"msg_from": "Darren Johnson <djohnson@greatbridge.com>",
"msg_from_op": false,
"msg_subject": "Re: AW: AW: AW: Postgres Replication"
}
] |
[
{
"msg_contents": "I was thinking this morning, how much work would it be to change the directory\nstructure of Postgres. \n\nfrom:\n\npostgres/\n\tbase/\n\t\tdb1/\n\t\tdb2/\n\t\tdb3/\n\t\t...\n\tpg_xlog/\n\nto\n\npostgres/\n\tbase/\n\t\tdb1/\n\t\tdb2/\n\t\tdb3/\n\t\t...\n\tindex/\n\t\tdb1/\n\t\tdb2/\n\t\tdb3/\n\t\t...\n\tpg_xlog/\n\nOr\npostgres/\n\tbase/\n\t\tdb1/\n\t\t\tdata/\n\t\t\tindex/\n\t\tdb2/\n\t\t\tdata/\n\t\t\tindex/\n\t\tdb3/\n\t\t\tdata/\n\t\t\tindex/\n\t\t...\n\tpg_xlog/\n\nThis sort of arangment would allow putting indexes on separate volumes. If it\nis a stupid idea, with little value or a huge amount of work, I take it back.\nSeriously, however, does it make any sense?\n",
"msg_date": "Wed, 13 Jun 2001 08:35:16 -0400",
"msg_from": "mlw <markw@mohawksoft.com>",
"msg_from_op": true,
"msg_subject": "Indexing on a separate volume"
},
{
"msg_contents": "On Wed, 13 Jun 2001, mlw wrote:\n\n> I was thinking this morning, how much work would it be to change the directory\n> structure of Postgres. \n\nAnother useful change would be the addition of directory splitting in the\ndatabase directories. This will increase performance on operating systems\nwhose filesystem performance drops dramatically with a large number of\nfiles (say, large objects) in a single directory.\n\nGavin\n\n",
"msg_date": "Wed, 13 Jun 2001 23:55:45 +1000 (EST)",
"msg_from": "Gavin Sherry <swm@linuxworld.com.au>",
"msg_from_op": false,
"msg_subject": "Re: Indexing on a separate volume"
},
{
"msg_contents": "\n\nIt is a good idea. See the web-based TODO list under tablespaces for a\ndiscussion.\n\n\n> I was thinking this morning, how much work would it be to change the directory\n> structure of Postgres. \n> \n> from:\n> \n> postgres/\n> \tbase/\n> \t\tdb1/\n> \t\tdb2/\n> \t\tdb3/\n> \t\t...\n> \tpg_xlog/\n> \n> to\n> \n> postgres/\n> \tbase/\n> \t\tdb1/\n> \t\tdb2/\n> \t\tdb3/\n> \t\t...\n> \tindex/\n> \t\tdb1/\n> \t\tdb2/\n> \t\tdb3/\n> \t\t...\n> \tpg_xlog/\n> \n> Or\n> postgres/\n> \tbase/\n> \t\tdb1/\n> \t\t\tdata/\n> \t\t\tindex/\n> \t\tdb2/\n> \t\t\tdata/\n> \t\t\tindex/\n> \t\tdb3/\n> \t\t\tdata/\n> \t\t\tindex/\n> \t\t...\n> \tpg_xlog/\n> \n> This sort of arangment would allow putting indexes on separate volumes. If it\n> is a stupid idea, with little value or a huge amount of work, I take it back.\n> Seriously, however, does it make any sense?\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 4: Don't 'kill -9' the postmaster\n> \n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Wed, 13 Jun 2001 10:01:00 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Indexing on a separate volume"
},
{
"msg_contents": "> On Wed, 13 Jun 2001, mlw wrote:\n> \n> > I was thinking this morning, how much work would it be to change the directory\n> > structure of Postgres. \n> \n> Another useful change would be the addition of directory splitting in the\n> database directories. This will increase performance on operating systems\n> whose filesystem performance drops dramatically with a large number of\n> files (say, large objects) in a single directory.\n\nGood news is that in 7.1 large objects are all in one file. Again, see\nthe TODO.detail about tablespaces.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Wed, 13 Jun 2001 10:07:37 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Indexing on a separate volume"
}
] |
[
{
"msg_contents": "\n> The other question is, what are your startup parameters? What sort of\n> shared memory buffer are you working with? I image that VACUUM does a\n> flush to disk, so are 1000 items filling your buffer(s), \n> causing an almost\n> continue fsync to disk for each INSERT after that ... so the VACUUM is\n> clearing the buffer(s) to disk, giving your space again to do quick\n> INSERTs for 1000 records again?\n\nAah yes, you mean that the pages are only written during checkpoints ?\nThen he would not need a vacuum, but a forced checkpoint.\nThat would actually impose, that we need yet another checkpoint initiating\nevent, e.g. do checkpoint when buffer is 75% dirty. Or better yet have\na daemon, that only writes out dirty pages from back to front of the LRU queue\nuntil only a configurable amount of buffers is dirty.\n\nAndreas\n",
"msg_date": "Wed, 13 Jun 2001 16:01:32 +0200",
"msg_from": "Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>",
"msg_from_op": true,
"msg_subject": "AW: AW: vacuum"
}
] |
[
{
"msg_contents": "Hello all,\n\nI have PostgreSQL 7.1.1 installed on a RedHat 7.1 server.\n\nWhen running the following query \"SELECT Field1 || Field2 AS Result FROM Table\"\nthe result is NULL when Field2 is NULL.\n\nSame as if I use a PL/pgSQL function to concatenate Filed 1 || Field2.\n\nDid I miss something?\n\nRegards,\nJean-Michel POURE, pgAdmin development team\n\n",
"msg_date": "Wed, 13 Jun 2001 16:37:16 +0200",
"msg_from": "Jean-Michel POURE <jm.poure@freesurf.fr>",
"msg_from_op": true,
"msg_subject": "SELECT Field1 || Field2 FROM Table"
},
{
"msg_contents": "Yes, that's correct behaviour. Any operation on null will yield null.\n\nWhat you need to do:\nselect coalesce(field1,'') || coalesce(field2,'') ...\n\n-alex\n\nOn Wed, 13 Jun 2001, Jean-Michel POURE wrote:\n\n> Hello all,\n> \n> I have PostgreSQL 7.1.1 installed on a RedHat 7.1 server.\n> \n> When running the following query \"SELECT Field1 || Field2 AS Result FROM Table\"\n> the result is NULL when Field2 is NULL.\n> \n> Same as if I use a PL/pgSQL function to concatenate Filed 1 || Field2.\n> \n> Did I miss something?\n> \n> Regards,\n> Jean-Michel POURE, pgAdmin development team\n> \n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 4: Don't 'kill -9' the postmaster\n> \n> \n\n",
"msg_date": "Wed, 13 Jun 2001 11:49:03 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": false,
"msg_subject": "Re: SELECT Field1 || Field2 FROM Table"
}
] |
[
{
"msg_contents": "\nAccording to \\h create user I can stipulate NOCREATEDB and NOCREATEUSER\nwhen I create a user. But I get this:\n\nmydb=# create user foo NOCREATEUSER NOCREATEDB in group bar;\nERROR: parser: parse error at or near \"NOCREATEDB\"\nmydb=#\n\nI can create the user by only stipulating one of the NOCREATE items but\nnot both. Does that mean something's broke or am I misunderstanding\nthis:\n\nCREATE USER username\n [ WITH\n [ SYSID uid ]\n [ PASSWORD 'password' ] ]\n [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]\n [ IN GROUP groupname [, ...] ]\n [ VALID UNTIL 'abstime' ]\n\n\nThis line:\n\n [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]\n\ndoes say I can do both, right?\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net\n 56K Nationwide Dialup from $16.00/mo at Pop4 Networking\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n",
"msg_date": "Wed, 13 Jun 2001 13:16:18 -0400 (EDT)",
"msg_from": "Vince Vielhaber <vev@michvhf.com>",
"msg_from_op": true,
"msg_subject": "create user problem"
},
{
"msg_contents": "Vince Vielhaber <vev@michvhf.com> writes:\n> mydb=# create user foo NOCREATEUSER NOCREATEDB in group bar;\n> ERROR: parser: parse error at or near \"NOCREATEDB\"\n\n> This line:\n> [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]\n> does say I can do both, right?\n\nIt says you can do both *in that order*.\n\nFeel free to submit a grammar patch to make CREATE USER more flexible\nabout the ordering of its optional clauses. Right now it's pretty\nrigid.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 13 Jun 2001 14:53:18 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: create user problem "
},
{
"msg_contents": "On Wed, 13 Jun 2001, Tom Lane wrote:\n\n> Vince Vielhaber <vev@michvhf.com> writes:\n> > mydb=# create user foo NOCREATEUSER NOCREATEDB in group bar;\n> > ERROR: parser: parse error at or near \"NOCREATEDB\"\n>\n> > This line:\n> > [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]\n> > does say I can do both, right?\n>\n> It says you can do both *in that order*.\n>\n> Feel free to submit a grammar patch to make CREATE USER more flexible\n> about the ordering of its optional clauses. Right now it's pretty\n> rigid.\n\nLet me guess, gram.y?\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net\n 56K Nationwide Dialup from $16.00/mo at Pop4 Networking\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n",
"msg_date": "Wed, 13 Jun 2001 16:20:09 -0400 (EDT)",
"msg_from": "Vince Vielhaber <vev@michvhf.com>",
"msg_from_op": true,
"msg_subject": "Re: create user problem "
},
{
"msg_contents": "Vince Vielhaber <vev@michvhf.com> writes:\n>> Feel free to submit a grammar patch to make CREATE USER more flexible\n>> about the ordering of its optional clauses. Right now it's pretty\n>> rigid.\n\n> Let me guess, gram.y?\n\nYup.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 13 Jun 2001 17:09:20 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: create user problem "
},
{
"msg_contents": "> Vince Vielhaber <vev@michvhf.com> writes:\n> > mydb=# create user foo NOCREATEUSER NOCREATEDB in group bar;\n> > ERROR: parser: parse error at or near \"NOCREATEDB\"\n> \n> > This line:\n> > [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]\n> > does say I can do both, right?\n> \n> It says you can do both *in that order*.\n> \n> Feel free to submit a grammar patch to make CREATE USER more flexible\n> about the ordering of its optional clauses. Right now it's pretty\n> rigid.\n\nAdded to TODO:\n\n\t* Allow CREATEUSER/CREATEDB ordering in CREATE/ALTER USER\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 9 Jul 2001 17:37:19 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: create user problem"
}
] |
[
{
"msg_contents": "I know this topic was discussed a few months ago, but I'm wondering if any\ndecisions have been reached on if, how, and when setuid functions and triggers\nmight be implemented. If not, I have an idea to throw at it.\n\nThanks,\nMark\n",
"msg_date": "Wed, 13 Jun 2001 13:24:45 -0400",
"msg_from": "Mark Volpe <volpe.mark@epamail.epa.gov>",
"msg_from_op": true,
"msg_subject": "Setuid functions"
},
{
"msg_contents": "Okay, what I'm thinking is to have a pair of commands added to PL/pgSQL. For\nthe sake of example we'll call them:\n\nENABLE PRIVLEDGE --> Sets user ID to that of the function's owner\nDISABLE PRIVLEDGE --> Restores the original UID\n\nI saw something like this being used in the referential integrity code, and\nthought this would be a nice (albeit incomplete) way to generalize this\nability.\n\nMark\n\nMark Volpe wrote:\n> \n> I know this topic was discussed a few months ago, but I'm wondering if any\n> decisions have been reached on if, how, and when setuid functions and triggers\n> might be implemented. If not, I have an idea to throw at it.\n> \n> Thanks,\n> Mark\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org\n",
"msg_date": "Wed, 20 Jun 2001 15:57:08 -0400",
"msg_from": "Mark Volpe <volpe.mark@epa.gov>",
"msg_from_op": false,
"msg_subject": "Re: Setuid functions"
},
{
"msg_contents": "> Okay, what I'm thinking is to have a pair of commands added to \n> PL/pgSQL. For\n> the sake of example we'll call them:\n> \n> ENABLE PRIVLEDGE --> Sets user ID to that of the function's owner\n> DISABLE PRIVLEDGE --> Restores the original UID\n\nI hope you mean:\n\nENABLE PRIVILEGE\nDISABLE PRIVILEGE\n\nChris\n\n\n",
"msg_date": "Thu, 21 Jun 2001 09:44:43 +0800",
"msg_from": "\"Christopher Kings-Lynne\" <chriskl@familyhealth.com.au>",
"msg_from_op": false,
"msg_subject": "RE: Setuid functions"
},
{
"msg_contents": "On Thu, Jun 21, 2001 at 09:44:43AM +0800, Christopher Kings-Lynne wrote:\n> > Okay, what I'm thinking is to have a pair of commands added to \n> > PL/pgSQL. For\n> > the sake of example we'll call them:\n> > \n> > ENABLE PRIVLEDGE --> Sets user ID to that of the function's owner\n> > DISABLE PRIVLEDGE --> Restores the original UID\n> \n> I hope you mean:\n> \n> ENABLE PRIVILEGE\n> DISABLE PRIVILEGE\n> \n\nCome on, Chris, you've never heard about SQL standard LEDGE? That's\nthe nomenclature they chose to describe a collection of permissions:\na SHELF or LEDGE. PUBLEDGE, USERLEDGE, PRIVLEDGE. So, the last is the\nPRIVATE LEDGE, reserved for the owner of the object whose access is\nbeing determined (or was that PRIVITHEDGE? now I'm confused)\n\n... or something. ;-) Actually, not too far from how some of the SQL92\nstandards docs actually seem to read, especially after falling asleep\nface down on the keyboard will trying to understand them, and having \nvivid dreams.\n\nRoss (who's in the office much too late, working on budget justifications\nfor grants that are due tomorrow!)\n",
"msg_date": "Wed, 20 Jun 2001 21:33:21 -0500",
"msg_from": "\"Ross J. Reedstrom\" <reedstrm@rice.edu>",
"msg_from_op": false,
"msg_subject": "Re: Setuid functions"
},
{
"msg_contents": "> Come on, Chris, you've never heard about SQL standard LEDGE? That's\n> the nomenclature they chose to describe a collection of permissions:\n> a SHELF or LEDGE. PUBLEDGE, USERLEDGE, PRIVLEDGE. So, the last is the\n> PRIVATE LEDGE, reserved for the owner of the object whose access is\n> being determined (or was that PRIVITHEDGE? now I'm confused)\n\nIt's alright - Americans don't seem to be able to spell the same as the rest\nof the English speaking world anyway ;)\n\nChris\n\n",
"msg_date": "Thu, 21 Jun 2001 11:20:22 +0800",
"msg_from": "\"Christopher Kings-Lynne\" <chriskl@familyhealth.com.au>",
"msg_from_op": false,
"msg_subject": "RE: Setuid functions"
},
{
"msg_contents": "Sorry, I have decided not to follow the SQL standard ;-) PRIVILEGE is spelled\ncorrectly in my patch.\n\nThis patch will implement the \"ENABLE PRIVILEGE\" and \"DISABLE PRIVILEGE\"\ncommands in PL/pgSQL, which, respectively, change the effective uid to that\nof the function owner and back. It doesn't break security (I hope). The\ncommands can be abbreviated as \"ENABLE\" and \"DISABLE\" for the poor saps that\nhave trouble with \"PRIVILEGE\" :) Easier than adding a setuid bit to the\ncatalog, no?\n\nApologies if the patch is not in the correct format. Apply with\n\npatch -p1 < enable_disable.patch\n\nin the tippety-top of the 7.1.2 tree.\n\nRegression example:\n\nCREATE USER sample_user;\nCREATE TABLE test_log(stamp datetime);\nGRANT SELECT ON test_log TO PUBLIC;\n\nDROP FUNCTION test_enable();\nCREATE FUNCTION test_enable() RETURNS boolean AS\n'\n DECLARE\n user name;\n BEGIN\n user:=current_user;\n RAISE NOTICE ''Username: %'', user;\n ENABLE PRIVILEGE;\n user:=current_user;\n RAISE NOTICE ''Username: %'', user;\n INSERT INTO test_log VALUES(''now''::text);\n DISABLE PRIVILEGE; -- Actually unnecessary at the end of the function\n RETURN TRUE;\n END;\n' LANGUAGE 'plpgsql';\n\n\\c - sample_user\nSELECT test_enable();\nSELECT * FROM test_log;\n\n stamp \n------------------------\n 2001-06-21 11:17:29-04\n\n(Note current time logged into a table where sample_user could not normally\nwrite)\n\nHope you will find this useful\n- Mark\n\n\"Ross J. Reedstrom\" wrote:\n> \n> Come on, Chris, you've never heard about SQL standard LEDGE? That's\n> the nomenclature they chose to describe a collection of permissions:\n> a SHELF or LEDGE. PUBLEDGE, USERLEDGE, PRIVLEDGE. So, the last is the\n> PRIVATE LEDGE, reserved for the owner of the object whose access is\n> being determined (or was that PRIVITHEDGE? now I'm confused)\n> \n> ... or something. ;-) Actually, not too far from how some of the SQL92\n> standards docs actually seem to read, especially after falling asleep\n> face down on the keyboard will trying to understand them, and having\n> vivid dreams.\n> \n> Ross (who's in the office much too late, working on budget justifications\n> for grants that are due tomorrow!)\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 2: you can get off all lists at once with the unregister command\n> (send \"unregister YourEmailAddressHere\" to majordomo@postgresql.org)",
"msg_date": "Thu, 21 Jun 2001 11:24:44 -0400",
"msg_from": "Mark Volpe <volpe.mark@epa.gov>",
"msg_from_op": false,
"msg_subject": "[PATCH] Re: Setuid functions"
},
{
"msg_contents": "Your patch has been added to the PostgreSQL unapplied patches list at:\n\n\thttp://candle.pha.pa.us/cgi-bin/pgpatches\n\nI will try to apply it within the next 48 hours.\n\n> Sorry, I have decided not to follow the SQL standard ;-) PRIVILEGE is spelled\n> correctly in my patch.\n> \n> This patch will implement the \"ENABLE PRIVILEGE\" and \"DISABLE PRIVILEGE\"\n> commands in PL/pgSQL, which, respectively, change the effective uid to that\n> of the function owner and back. It doesn't break security (I hope). The\n> commands can be abbreviated as \"ENABLE\" and \"DISABLE\" for the poor saps that\n> have trouble with \"PRIVILEGE\" :) Easier than adding a setuid bit to the\n> catalog, no?\n> \n> Apologies if the patch is not in the correct format. Apply with\n> \n> patch -p1 < enable_disable.patch\n> \n> in the tippety-top of the 7.1.2 tree.\n> \n> Regression example:\n> \n> CREATE USER sample_user;\n> CREATE TABLE test_log(stamp datetime);\n> GRANT SELECT ON test_log TO PUBLIC;\n> \n> DROP FUNCTION test_enable();\n> CREATE FUNCTION test_enable() RETURNS boolean AS\n> '\n> DECLARE\n> user name;\n> BEGIN\n> user:=current_user;\n> RAISE NOTICE ''Username: %'', user;\n> ENABLE PRIVILEGE;\n> user:=current_user;\n> RAISE NOTICE ''Username: %'', user;\n> INSERT INTO test_log VALUES(''now''::text);\n> DISABLE PRIVILEGE; -- Actually unnecessary at the end of the function\n> RETURN TRUE;\n> END;\n> ' LANGUAGE 'plpgsql';\n> \n> \\c - sample_user\n> SELECT test_enable();\n> SELECT * FROM test_log;\n> \n> stamp \n> ------------------------\n> 2001-06-21 11:17:29-04\n> \n> (Note current time logged into a table where sample_user could not normally\n> write)\n> \n> Hope you will find this useful\n> - Mark\n> \n> \"Ross J. Reedstrom\" wrote:\n> > \n> > Come on, Chris, you've never heard about SQL standard LEDGE? That's\n> > the nomenclature they chose to describe a collection of permissions:\n> > a SHELF or LEDGE. PUBLEDGE, USERLEDGE, PRIVLEDGE. So, the last is the\n> > PRIVATE LEDGE, reserved for the owner of the object whose access is\n> > being determined (or was that PRIVITHEDGE? now I'm confused)\n> > \n> > ... or something. ;-) Actually, not too far from how some of the SQL92\n> > standards docs actually seem to read, especially after falling asleep\n> > face down on the keyboard will trying to understand them, and having\n> > vivid dreams.\n> > \n> > Ross (who's in the office much too late, working on budget justifications\n> > for grants that are due tomorrow!)\n> > \n> > ---------------------------(end of broadcast)---------------------------\n> > TIP 2: you can get off all lists at once with the unregister command\n> > (send \"unregister YourEmailAddressHere\" to majordomo@postgresql.org)\n\n> diff -ur postgresql-7.1.2/src/pl/plpgsql/src/gram.y postgresql-7.1.2-patch/src/pl/plpgsql/src/gram.y\n> --- postgresql-7.1.2/src/pl/plpgsql/src/gram.y\tWed Jun 20 20:07:45 2001\n> +++ postgresql-7.1.2-patch/src/pl/plpgsql/src/gram.y\tWed Jun 20 19:48:18 2001\n> @@ -121,7 +121,7 @@\n> %type <stmts>\tproc_sect, proc_stmts, stmt_else, loop_body\n> %type <stmt>\tproc_stmt, pl_block\n> %type <stmt>\tstmt_assign, stmt_if, stmt_loop, stmt_while, stmt_exit\n> -%type <stmt>\tstmt_return, stmt_raise, stmt_execsql, stmt_fori\n> +%type <stmt>\tstmt_return, stmt_raise, stmt_execsql, stmt_fori, stmt_enable, stmt_disable\n> %type <stmt>\tstmt_fors, stmt_select, stmt_perform\n> %type <stmt>\tstmt_dynexecute, stmt_dynfors, stmt_getdiag\n> \n> @@ -164,6 +164,9 @@\n> %token\tK_PERFORM\n> %token\tK_ROW_COUNT\n> %token\tK_RAISE\n> +%token K_ENABLE\n> +%token K_DISABLE\n> +%token K_PRIVILEGE\n> %token\tK_RECORD\n> %token\tK_RENAME\n> %token\tK_RESULT_OID\n> @@ -569,6 +572,10 @@\n> \t\t\t\t\t\t{ $$ = $1; }\n> \t\t\t\t| stmt_raise\n> \t\t\t\t\t\t{ $$ = $1; }\n> +\t\t\t\t| stmt_enable\n> +\t\t\t\t\t\t{ $$ = $1; }\n> +\t\t\t\t| stmt_disable\n> +\t\t\t\t\t\t{ $$ = $1; }\n> \t\t\t\t| stmt_execsql\n> \t\t\t\t\t\t{ $$ = $1; }\n> \t\t\t\t| stmt_dynexecute\n> @@ -1033,6 +1040,34 @@\n> \t\t\t\t\t\t$$ = (PLpgSQL_stmt *)new;\n> \t\t\t\t\t}\n> \t\t\t\t;\n> +\n> +stmt_enable\t\t: K_ENABLE opt_privilege lno ';'\n> +\t\t\t\t{\n> +\t\t\t\t\tPLpgSQL_stmt_privilege *new;\n> +\n> +\t\t\t\t\tnew=malloc(sizeof(PLpgSQL_stmt_privilege));\n> +\n> +\t\t\t\t\tnew->cmd_type = PLPGSQL_STMT_ENABLE;\n> +\t\t\t\t\tnew->lineno = $3;\n> +\n> +\t\t\t\t\t$$ = (PLpgSQL_stmt *)new;\n> +\t\t\t\t}\n> +\n> +stmt_disable\t\t: K_DISABLE opt_privilege lno ';'\n> +\t\t\t\t{\n> +\t\t\t\t\tPLpgSQL_stmt_privilege *new;\n> +\n> +\t\t\t\t\tnew=malloc(sizeof(PLpgSQL_stmt_privilege));\n> +\n> +\t\t\t\t\tnew->cmd_type = PLPGSQL_STMT_DISABLE;\n> +\t\t\t\t\tnew->lineno = $3;\n> +\n> +\t\t\t\t\t$$ = (PLpgSQL_stmt *)new;\n> +\t\t\t\t}\n> +\n> +opt_privilege :\n> +\t| K_PRIVILEGE\n> +;\n> \n> stmt_raise\t\t: K_RAISE lno raise_level raise_msg raise_params ';'\n> \t\t\t\t\t{\n> diff -ur postgresql-7.1.2/src/pl/plpgsql/src/pl_exec.c postgresql-7.1.2-patch/src/pl/plpgsql/src/pl_exec.c\n> --- postgresql-7.1.2/src/pl/plpgsql/src/pl_exec.c\tWed Jun 20 20:07:45 2001\n> +++ postgresql-7.1.2-patch/src/pl/plpgsql/src/pl_exec.c\tWed Jun 20 19:48:18 2001\n> @@ -99,6 +99,8 @@\n> \t\t\t PLpgSQL_stmt_exit * stmt);\n> static int exec_stmt_return(PLpgSQL_execstate * estate,\n> \t\t\t\t PLpgSQL_stmt_return * stmt);\n> +static int exec_stmt_privilege(PLpgSQL_execstate * estate,\n> +\t\t\t\tPLpgSQL_stmt_privilege * stmt);\n> static int exec_stmt_raise(PLpgSQL_execstate * estate,\n> \t\t\t\tPLpgSQL_stmt_raise * stmt);\n> static int exec_stmt_execsql(PLpgSQL_execstate * estate,\n> @@ -220,6 +222,12 @@\n> \t\t\t\t\tcase PLPGSQL_STMT_RETURN:\n> \t\t\t\t\t\tstmttype = \"return\";\n> \t\t\t\t\t\tbreak;\n> +\t\t\t\t\tcase PLPGSQL_STMT_ENABLE:\n> +\t\t\t\t\t\tstmttype = \"enable\";\n> +\t\t\t\t\t\tbreak;\n> +\t\t\t\t\tcase PLPGSQL_STMT_DISABLE:\n> +\t\t\t\t\t\tstmttype = \"disable\";\n> +\t\t\t\t\t\tbreak;\n> \t\t\t\t\tcase PLPGSQL_STMT_RAISE:\n> \t\t\t\t\t\tstmttype = \"raise\";\n> \t\t\t\t\t\tbreak;\n> @@ -265,6 +273,8 @@\n> \testate.retistuple = func->fn_retistuple;\n> \testate.retisset = func->fn_retset;\n> \testate.exitlabel = NULL;\n> +\testate.save_uid = InvalidOid;\n> +\testate.fn_oid = func->fn_oid;\n> \n> \testate.found_varno = func->found_varno;\n> \testate.ndatums = func->ndatums;\n> @@ -385,6 +395,9 @@\n> \t\telog(ERROR, \"control reaches end of function without RETURN\");\n> \t}\n> \n> +\tif (estate.save_uid!=InvalidOid)\n> +\t\tSetUserId(estate.save_uid);\n> +\n> \t/*\n> \t * We got a return value - process it\n> \t */\n> @@ -565,6 +578,8 @@\n> \testate.retistuple = func->fn_retistuple;\n> \testate.retisset = func->fn_retset;\n> \testate.exitlabel = NULL;\n> +\testate.save_uid = InvalidOid;\n> +\testate.fn_oid = func->fn_oid;\n> \n> \testate.found_varno = func->found_varno;\n> \testate.ndatums = func->ndatums;\n> @@ -742,6 +757,9 @@\n> \t\telog(ERROR, \"control reaches end of trigger procedure without RETURN\");\n> \t}\n> \n> +\tif (estate.save_uid!=InvalidOid)\n> +\t\tSetUserId(estate.save_uid);\n> +\n> \t/*\n> \t * Check that the returned tuple structure has the same attributes,\n> \t * the relation that fired the trigger has.\n> @@ -986,6 +1004,11 @@\n> \t\t\trc = exec_stmt_return(estate, (PLpgSQL_stmt_return *) stmt);\n> \t\t\tbreak;\n> \n> +\t\tcase PLPGSQL_STMT_ENABLE:\n> +\t\tcase PLPGSQL_STMT_DISABLE:\n> +\t\t\trc = exec_stmt_privilege(estate, (PLpgSQL_stmt_privilege *) stmt);\n> +\t\t\tbreak;\n> +\n> \t\tcase PLPGSQL_STMT_RAISE:\n> \t\t\trc = exec_stmt_raise(estate, (PLpgSQL_stmt_raise *) stmt);\n> \t\t\tbreak;\n> @@ -1536,6 +1559,41 @@\n> \t\t\t\t\t\t\t\t\t&(estate->rettype));\n> \n> \treturn PLPGSQL_RC_RETURN;\n> +}\n> +\n> +/* ----------\n> + * exec_stmt_privilege Changes user ID to/from\n> + * that of the function owner's\n> + * ----------\n> + */\n> +\n> +static int\n> +exec_stmt_privilege(PLpgSQL_execstate * estate, PLpgSQL_stmt_privilege * stmt)\n> +{\n> +\tHeapTuple procedureTuple;\n> +\tForm_pg_proc procedureStruct;\n> +\n> +\tif (stmt->cmd_type==PLPGSQL_STMT_ENABLE)\n> +\t{\n> +\t\tif (estate->save_uid!=InvalidOid) return PLPGSQL_RC_OK; /* Already enabled */\n> +\t\tprocedureTuple = SearchSysCache(PROCOID, ObjectIdGetDatum(estate->fn_oid), 0, 0, 0);\n> +\n> +\t\tif (!HeapTupleIsValid(procedureTuple))\n> +\t\t\telog(ERROR, \"exec_stmt_privilege: cache lookup failed\");\n> +\n> +\t\tprocedureStruct = (Form_pg_proc) GETSTRUCT(procedureTuple);\n> +\n> +\t\testate->save_uid = GetUserId();\n> +\t\tSetUserId(procedureStruct->proowner);\n> +\t\tReleaseSysCache(procedureTuple);\n> +\t} else\n> +\t{\n> +\t\tif (estate->save_uid==InvalidOid) return PLPGSQL_RC_OK; /* Already disabled */\n> +\t\tSetUserId(estate->save_uid);\n> +\t\testate->save_uid = InvalidOid;\n> +\t}\n> +\n> +\treturn PLPGSQL_RC_OK;\n> }\n> \n> \n> diff -ur postgresql-7.1.2/src/pl/plpgsql/src/pl_funcs.c postgresql-7.1.2-patch/src/pl/plpgsql/src/pl_funcs.c\n> --- postgresql-7.1.2/src/pl/plpgsql/src/pl_funcs.c\tWed Jun 20 20:07:45 2001\n> +++ postgresql-7.1.2-patch/src/pl/plpgsql/src/pl_funcs.c\tWed Jun 20 20:05:14 2001\n> @@ -382,6 +382,7 @@\n> static void dump_select(PLpgSQL_stmt_select * stmt);\n> static void dump_exit(PLpgSQL_stmt_exit * stmt);\n> static void dump_return(PLpgSQL_stmt_return * stmt);\n> +static void dump_privilege(PLpgSQL_stmt_privilege * stmt);\n> static void dump_raise(PLpgSQL_stmt_raise * stmt);\n> static void dump_execsql(PLpgSQL_stmt_execsql * stmt);\n> static void dump_dynexecute(PLpgSQL_stmt_dynexecute * stmt);\n> @@ -435,6 +436,10 @@\n> \t\tcase PLPGSQL_STMT_RETURN:\n> \t\t\tdump_return((PLpgSQL_stmt_return *) stmt);\n> \t\t\tbreak;\n> +\t\tcase PLPGSQL_STMT_ENABLE:\n> +\t\tcase PLPGSQL_STMT_DISABLE:\n> +\t\t\tdump_privilege((PLpgSQL_stmt_privilege *) stmt);\n> +\t\t\tbreak;\n> \t\tcase PLPGSQL_STMT_RAISE:\n> \t\t\tdump_raise((PLpgSQL_stmt_raise *) stmt);\n> \t\t\tbreak;\n> @@ -647,6 +652,16 @@\n> \t\t\tdump_expr(stmt->expr);\n> \t}\n> \tprintf(\"\\n\");\n> +}\n> +\n> +static void\n> +dump_privilege(PLpgSQL_stmt_privilege * stmt)\n> +{\n> +\tdump_ind();\n> +\tif (stmt->cmd_type==PLPGSQL_STMT_ENABLE)\n> +\t\tprintf(\"ENABLE PRIVILEGE\\n\");\n> +\telse\n> +\t\tprintf(\"DISABLE PRIVILEGE\\n\");\n> }\n> \n> static void\n> diff -ur postgresql-7.1.2/src/pl/plpgsql/src/plpgsql.h postgresql-7.1.2-patch/src/pl/plpgsql/src/plpgsql.h\n> --- postgresql-7.1.2/src/pl/plpgsql/src/plpgsql.h\tWed Jun 20 20:07:45 2001\n> +++ postgresql-7.1.2-patch/src/pl/plpgsql/src/plpgsql.h\tWed Jun 20 20:08:57 2001\n> @@ -94,7 +94,9 @@\n> \tPLPGSQL_STMT_EXECSQL,\n> \tPLPGSQL_STMT_DYNEXECUTE,\n> \tPLPGSQL_STMT_DYNFORS,\n> -\tPLPGSQL_STMT_GETDIAG\n> +\tPLPGSQL_STMT_GETDIAG,\n> +\tPLPGSQL_STMT_ENABLE,\n> +\tPLPGSQL_STMT_DISABLE\n> };\n> \n> \n> @@ -387,6 +389,11 @@\n> \tint\t\t\tretrecno;\n> }\t\t\tPLpgSQL_stmt_return;\n> \n> +typedef struct\n> +{ /* ENABLE/DISABLE statement */\n> + int cmd_type;\n> + int lineno;\n> +} PLpgSQL_stmt_privilege;\n> \n> typedef struct\n> {\t\t\t\t\t\t\t\t/* RAISE statement\t\t\t*/\n> @@ -464,6 +471,8 @@\n> \tint\t\t\tfound_varno;\n> \tint\t\t\tndatums;\n> \tPLpgSQL_datum **datums;\n> +\tOid\t\tsave_uid;\n> +\tOid\t\tfn_oid;\n> }\t\t\tPLpgSQL_execstate;\n> \n> \n> Only in postgresql-7.1.2/src/pl/plpgsql/src: plpgsql.h.orig\n> Only in postgresql-7.1.2/src/pl/plpgsql/src: plpgsql.h.rej\n> diff -ur postgresql-7.1.2/src/pl/plpgsql/src/scan.l postgresql-7.1.2-patch/src/pl/plpgsql/src/scan.l\n> --- postgresql-7.1.2/src/pl/plpgsql/src/scan.l\tWed Jun 20 20:07:45 2001\n> +++ postgresql-7.1.2-patch/src/pl/plpgsql/src/scan.l\tWed Jun 20 19:48:18 2001\n> @@ -115,6 +115,9 @@\n> null\t\t\t{ return K_NULL;\t\t\t}\n> perform\t\t\t{ return K_PERFORM;\t\t\t}\n> raise\t\t\t{ return K_RAISE;\t\t\t}\n> +enable\t\t\t{ return K_ENABLE;\t\t\t}\n> +disable\t\t{ return K_DISABLE;\t\t\t}\n> +privilege\t\t{ return K_PRIVILEGE;\t\t\t}\n> record\t\t\t{ return K_RECORD;\t\t\t}\n> rename\t\t\t{ return K_RENAME;\t\t\t}\n> result_oid\t\t{ return K_RESULT_OID;\t\t}\n\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 3: if posting/reading through Usenet, please send an appropriate\n> subscribe-nomail command to majordomo@postgresql.org so that your\n> message can get through to the mailing list cleanly\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Fri, 22 Jun 2001 21:56:53 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] Re: Setuid functions"
},
{
"msg_contents": "Mark Volpe writes:\n\n> This patch will implement the \"ENABLE PRIVILEGE\" and \"DISABLE PRIVILEGE\"\n> commands in PL/pgSQL, which, respectively, change the effective uid to that\n> of the function owner and back.\n\nMay I suggest better names? When I do DISABLE PRIVILEGE, do I no longer\nhave any privilege? Also, in SQL, the term \"privilege\" refers to\nselect/insert/update/etc. right on some table, so \"enable privilege\" would\nbe \"grant\". The term for user identity is \"authorization\", so I would\ncall these commands\n\n SET AUTHORIZATION { INVOKER | DEFINER }\n\n(\"invoker\" and \"definer\" are part of the SQL CREATE FUNCTION syntax) and\nthe default would be invoker.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Sat, 23 Jun 2001 17:48:20 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] Re: Setuid functions"
},
{
"msg_contents": "Mark Volpe writes:\n\n> I know this topic was discussed a few months ago, but I'm wondering if any\n> decisions have been reached on if, how, and when setuid functions and triggers\n> might be implemented. If not, I have an idea to throw at it.\n\nAdd a boolean column to pg_proc, when that column is true you select a\nspecial function class handler in fmgr_info(), that function handler will\nsave and restore the user id and then call the real function. See\nbackend/utils/fmgr/fmgr.c for the action.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Sat, 23 Jun 2001 17:53:03 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: Setuid functions"
},
{
"msg_contents": "Peter Eisentraut <peter_e@gmx.net> writes:\n> The term for user identity is \"authorization\", so I would\n> call these commands\n\n> SET AUTHORIZATION { INVOKER | DEFINER }\n\nI like that better, too.\n\nOverall, the only objection I can see to doing things this way is that\nwe have to do it over again for each function language (eg, adding such\na thing to SQL functions is doable, but much more tedious than for\nplpgsql). But it seems more flexible than the pg_proc-attribute\napproach.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sat, 23 Jun 2001 20:47:28 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] Re: Setuid functions "
},
{
"msg_contents": "At 20:47 23/06/01 -0400, Tom Lane wrote:\n>Peter Eisentraut <peter_e@gmx.net> writes:\n>> The term for user identity is \"authorization\", so I would\n>> call these commands\n>\n>> SET AUTHORIZATION { INVOKER | DEFINER }\n>\n>I like that better, too.\n>\n\nI have not read the whole thread, but I am used to module level definitions\n(which easily translate to funtion level):\n\n Create Module ZZZ [Authorization <auth-name>]\n\nWhere <auth-name> is any valid UID or Role (we don't have roles yet). We\ndefinitely should not limit ourselves to DEFINER or INVOKER (and obviously,\nwhen undefined, it is CURRENT_USER). \n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.B.N. 75 008 659 498) | /(@) ______---_\nTel: (+61) 0500 83 82 81 | _________ \\\nFax: (+61) 0500 83 82 82 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n",
"msg_date": "Sun, 24 Jun 2001 11:31:05 +1000",
"msg_from": "Philip Warner <pjw@rhyme.com.au>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] Re: Setuid functions "
},
{
"msg_contents": "\nRemoved from queue pending review.\n\n> Sorry, I have decided not to follow the SQL standard ;-) PRIVILEGE is spelled\n> correctly in my patch.\n> \n> This patch will implement the \"ENABLE PRIVILEGE\" and \"DISABLE PRIVILEGE\"\n> commands in PL/pgSQL, which, respectively, change the effective uid to that\n> of the function owner and back. It doesn't break security (I hope). The\n> commands can be abbreviated as \"ENABLE\" and \"DISABLE\" for the poor saps that\n> have trouble with \"PRIVILEGE\" :) Easier than adding a setuid bit to the\n> catalog, no?\n> \n> Apologies if the patch is not in the correct format. Apply with\n> \n> patch -p1 < enable_disable.patch\n> \n> in the tippety-top of the 7.1.2 tree.\n> \n> Regression example:\n> \n> CREATE USER sample_user;\n> CREATE TABLE test_log(stamp datetime);\n> GRANT SELECT ON test_log TO PUBLIC;\n> \n> DROP FUNCTION test_enable();\n> CREATE FUNCTION test_enable() RETURNS boolean AS\n> '\n> DECLARE\n> user name;\n> BEGIN\n> user:=current_user;\n> RAISE NOTICE ''Username: %'', user;\n> ENABLE PRIVILEGE;\n> user:=current_user;\n> RAISE NOTICE ''Username: %'', user;\n> INSERT INTO test_log VALUES(''now''::text);\n> DISABLE PRIVILEGE; -- Actually unnecessary at the end of the function\n> RETURN TRUE;\n> END;\n> ' LANGUAGE 'plpgsql';\n> \n> \\c - sample_user\n> SELECT test_enable();\n> SELECT * FROM test_log;\n> \n> stamp \n> ------------------------\n> 2001-06-21 11:17:29-04\n> \n> (Note current time logged into a table where sample_user could not normally\n> write)\n> \n> Hope you will find this useful\n> - Mark\n> \n> \"Ross J. Reedstrom\" wrote:\n> > \n> > Come on, Chris, you've never heard about SQL standard LEDGE? That's\n> > the nomenclature they chose to describe a collection of permissions:\n> > a SHELF or LEDGE. PUBLEDGE, USERLEDGE, PRIVLEDGE. So, the last is the\n> > PRIVATE LEDGE, reserved for the owner of the object whose access is\n> > being determined (or was that PRIVITHEDGE? now I'm confused)\n> > \n> > ... or something. ;-) Actually, not too far from how some of the SQL92\n> > standards docs actually seem to read, especially after falling asleep\n> > face down on the keyboard will trying to understand them, and having\n> > vivid dreams.\n> > \n> > Ross (who's in the office much too late, working on budget justifications\n> > for grants that are due tomorrow!)\n> > \n> > ---------------------------(end of broadcast)---------------------------\n> > TIP 2: you can get off all lists at once with the unregister command\n> > (send \"unregister YourEmailAddressHere\" to majordomo@postgresql.org)\n\n> diff -ur postgresql-7.1.2/src/pl/plpgsql/src/gram.y postgresql-7.1.2-patch/src/pl/plpgsql/src/gram.y\n> --- postgresql-7.1.2/src/pl/plpgsql/src/gram.y\tWed Jun 20 20:07:45 2001\n> +++ postgresql-7.1.2-patch/src/pl/plpgsql/src/gram.y\tWed Jun 20 19:48:18 2001\n> @@ -121,7 +121,7 @@\n> %type <stmts>\tproc_sect, proc_stmts, stmt_else, loop_body\n> %type <stmt>\tproc_stmt, pl_block\n> %type <stmt>\tstmt_assign, stmt_if, stmt_loop, stmt_while, stmt_exit\n> -%type <stmt>\tstmt_return, stmt_raise, stmt_execsql, stmt_fori\n> +%type <stmt>\tstmt_return, stmt_raise, stmt_execsql, stmt_fori, stmt_enable, stmt_disable\n> %type <stmt>\tstmt_fors, stmt_select, stmt_perform\n> %type <stmt>\tstmt_dynexecute, stmt_dynfors, stmt_getdiag\n> \n> @@ -164,6 +164,9 @@\n> %token\tK_PERFORM\n> %token\tK_ROW_COUNT\n> %token\tK_RAISE\n> +%token K_ENABLE\n> +%token K_DISABLE\n> +%token K_PRIVILEGE\n> %token\tK_RECORD\n> %token\tK_RENAME\n> %token\tK_RESULT_OID\n> @@ -569,6 +572,10 @@\n> \t\t\t\t\t\t{ $$ = $1; }\n> \t\t\t\t| stmt_raise\n> \t\t\t\t\t\t{ $$ = $1; }\n> +\t\t\t\t| stmt_enable\n> +\t\t\t\t\t\t{ $$ = $1; }\n> +\t\t\t\t| stmt_disable\n> +\t\t\t\t\t\t{ $$ = $1; }\n> \t\t\t\t| stmt_execsql\n> \t\t\t\t\t\t{ $$ = $1; }\n> \t\t\t\t| stmt_dynexecute\n> @@ -1033,6 +1040,34 @@\n> \t\t\t\t\t\t$$ = (PLpgSQL_stmt *)new;\n> \t\t\t\t\t}\n> \t\t\t\t;\n> +\n> +stmt_enable\t\t: K_ENABLE opt_privilege lno ';'\n> +\t\t\t\t{\n> +\t\t\t\t\tPLpgSQL_stmt_privilege *new;\n> +\n> +\t\t\t\t\tnew=malloc(sizeof(PLpgSQL_stmt_privilege));\n> +\n> +\t\t\t\t\tnew->cmd_type = PLPGSQL_STMT_ENABLE;\n> +\t\t\t\t\tnew->lineno = $3;\n> +\n> +\t\t\t\t\t$$ = (PLpgSQL_stmt *)new;\n> +\t\t\t\t}\n> +\n> +stmt_disable\t\t: K_DISABLE opt_privilege lno ';'\n> +\t\t\t\t{\n> +\t\t\t\t\tPLpgSQL_stmt_privilege *new;\n> +\n> +\t\t\t\t\tnew=malloc(sizeof(PLpgSQL_stmt_privilege));\n> +\n> +\t\t\t\t\tnew->cmd_type = PLPGSQL_STMT_DISABLE;\n> +\t\t\t\t\tnew->lineno = $3;\n> +\n> +\t\t\t\t\t$$ = (PLpgSQL_stmt *)new;\n> +\t\t\t\t}\n> +\n> +opt_privilege :\n> +\t| K_PRIVILEGE\n> +;\n> \n> stmt_raise\t\t: K_RAISE lno raise_level raise_msg raise_params ';'\n> \t\t\t\t\t{\n> diff -ur postgresql-7.1.2/src/pl/plpgsql/src/pl_exec.c postgresql-7.1.2-patch/src/pl/plpgsql/src/pl_exec.c\n> --- postgresql-7.1.2/src/pl/plpgsql/src/pl_exec.c\tWed Jun 20 20:07:45 2001\n> +++ postgresql-7.1.2-patch/src/pl/plpgsql/src/pl_exec.c\tWed Jun 20 19:48:18 2001\n> @@ -99,6 +99,8 @@\n> \t\t\t PLpgSQL_stmt_exit * stmt);\n> static int exec_stmt_return(PLpgSQL_execstate * estate,\n> \t\t\t\t PLpgSQL_stmt_return * stmt);\n> +static int exec_stmt_privilege(PLpgSQL_execstate * estate,\n> +\t\t\t\tPLpgSQL_stmt_privilege * stmt);\n> static int exec_stmt_raise(PLpgSQL_execstate * estate,\n> \t\t\t\tPLpgSQL_stmt_raise * stmt);\n> static int exec_stmt_execsql(PLpgSQL_execstate * estate,\n> @@ -220,6 +222,12 @@\n> \t\t\t\t\tcase PLPGSQL_STMT_RETURN:\n> \t\t\t\t\t\tstmttype = \"return\";\n> \t\t\t\t\t\tbreak;\n> +\t\t\t\t\tcase PLPGSQL_STMT_ENABLE:\n> +\t\t\t\t\t\tstmttype = \"enable\";\n> +\t\t\t\t\t\tbreak;\n> +\t\t\t\t\tcase PLPGSQL_STMT_DISABLE:\n> +\t\t\t\t\t\tstmttype = \"disable\";\n> +\t\t\t\t\t\tbreak;\n> \t\t\t\t\tcase PLPGSQL_STMT_RAISE:\n> \t\t\t\t\t\tstmttype = \"raise\";\n> \t\t\t\t\t\tbreak;\n> @@ -265,6 +273,8 @@\n> \testate.retistuple = func->fn_retistuple;\n> \testate.retisset = func->fn_retset;\n> \testate.exitlabel = NULL;\n> +\testate.save_uid = InvalidOid;\n> +\testate.fn_oid = func->fn_oid;\n> \n> \testate.found_varno = func->found_varno;\n> \testate.ndatums = func->ndatums;\n> @@ -385,6 +395,9 @@\n> \t\telog(ERROR, \"control reaches end of function without RETURN\");\n> \t}\n> \n> +\tif (estate.save_uid!=InvalidOid)\n> +\t\tSetUserId(estate.save_uid);\n> +\n> \t/*\n> \t * We got a return value - process it\n> \t */\n> @@ -565,6 +578,8 @@\n> \testate.retistuple = func->fn_retistuple;\n> \testate.retisset = func->fn_retset;\n> \testate.exitlabel = NULL;\n> +\testate.save_uid = InvalidOid;\n> +\testate.fn_oid = func->fn_oid;\n> \n> \testate.found_varno = func->found_varno;\n> \testate.ndatums = func->ndatums;\n> @@ -742,6 +757,9 @@\n> \t\telog(ERROR, \"control reaches end of trigger procedure without RETURN\");\n> \t}\n> \n> +\tif (estate.save_uid!=InvalidOid)\n> +\t\tSetUserId(estate.save_uid);\n> +\n> \t/*\n> \t * Check that the returned tuple structure has the same attributes,\n> \t * the relation that fired the trigger has.\n> @@ -986,6 +1004,11 @@\n> \t\t\trc = exec_stmt_return(estate, (PLpgSQL_stmt_return *) stmt);\n> \t\t\tbreak;\n> \n> +\t\tcase PLPGSQL_STMT_ENABLE:\n> +\t\tcase PLPGSQL_STMT_DISABLE:\n> +\t\t\trc = exec_stmt_privilege(estate, (PLpgSQL_stmt_privilege *) stmt);\n> +\t\t\tbreak;\n> +\n> \t\tcase PLPGSQL_STMT_RAISE:\n> \t\t\trc = exec_stmt_raise(estate, (PLpgSQL_stmt_raise *) stmt);\n> \t\t\tbreak;\n> @@ -1536,6 +1559,41 @@\n> \t\t\t\t\t\t\t\t\t&(estate->rettype));\n> \n> \treturn PLPGSQL_RC_RETURN;\n> +}\n> +\n> +/* ----------\n> + * exec_stmt_privilege Changes user ID to/from\n> + * that of the function owner's\n> + * ----------\n> + */\n> +\n> +static int\n> +exec_stmt_privilege(PLpgSQL_execstate * estate, PLpgSQL_stmt_privilege * stmt)\n> +{\n> +\tHeapTuple procedureTuple;\n> +\tForm_pg_proc procedureStruct;\n> +\n> +\tif (stmt->cmd_type==PLPGSQL_STMT_ENABLE)\n> +\t{\n> +\t\tif (estate->save_uid!=InvalidOid) return PLPGSQL_RC_OK; /* Already enabled */\n> +\t\tprocedureTuple = SearchSysCache(PROCOID, ObjectIdGetDatum(estate->fn_oid), 0, 0, 0);\n> +\n> +\t\tif (!HeapTupleIsValid(procedureTuple))\n> +\t\t\telog(ERROR, \"exec_stmt_privilege: cache lookup failed\");\n> +\n> +\t\tprocedureStruct = (Form_pg_proc) GETSTRUCT(procedureTuple);\n> +\n> +\t\testate->save_uid = GetUserId();\n> +\t\tSetUserId(procedureStruct->proowner);\n> +\t\tReleaseSysCache(procedureTuple);\n> +\t} else\n> +\t{\n> +\t\tif (estate->save_uid==InvalidOid) return PLPGSQL_RC_OK; /* Already disabled */\n> +\t\tSetUserId(estate->save_uid);\n> +\t\testate->save_uid = InvalidOid;\n> +\t}\n> +\n> +\treturn PLPGSQL_RC_OK;\n> }\n> \n> \n> diff -ur postgresql-7.1.2/src/pl/plpgsql/src/pl_funcs.c postgresql-7.1.2-patch/src/pl/plpgsql/src/pl_funcs.c\n> --- postgresql-7.1.2/src/pl/plpgsql/src/pl_funcs.c\tWed Jun 20 20:07:45 2001\n> +++ postgresql-7.1.2-patch/src/pl/plpgsql/src/pl_funcs.c\tWed Jun 20 20:05:14 2001\n> @@ -382,6 +382,7 @@\n> static void dump_select(PLpgSQL_stmt_select * stmt);\n> static void dump_exit(PLpgSQL_stmt_exit * stmt);\n> static void dump_return(PLpgSQL_stmt_return * stmt);\n> +static void dump_privilege(PLpgSQL_stmt_privilege * stmt);\n> static void dump_raise(PLpgSQL_stmt_raise * stmt);\n> static void dump_execsql(PLpgSQL_stmt_execsql * stmt);\n> static void dump_dynexecute(PLpgSQL_stmt_dynexecute * stmt);\n> @@ -435,6 +436,10 @@\n> \t\tcase PLPGSQL_STMT_RETURN:\n> \t\t\tdump_return((PLpgSQL_stmt_return *) stmt);\n> \t\t\tbreak;\n> +\t\tcase PLPGSQL_STMT_ENABLE:\n> +\t\tcase PLPGSQL_STMT_DISABLE:\n> +\t\t\tdump_privilege((PLpgSQL_stmt_privilege *) stmt);\n> +\t\t\tbreak;\n> \t\tcase PLPGSQL_STMT_RAISE:\n> \t\t\tdump_raise((PLpgSQL_stmt_raise *) stmt);\n> \t\t\tbreak;\n> @@ -647,6 +652,16 @@\n> \t\t\tdump_expr(stmt->expr);\n> \t}\n> \tprintf(\"\\n\");\n> +}\n> +\n> +static void\n> +dump_privilege(PLpgSQL_stmt_privilege * stmt)\n> +{\n> +\tdump_ind();\n> +\tif (stmt->cmd_type==PLPGSQL_STMT_ENABLE)\n> +\t\tprintf(\"ENABLE PRIVILEGE\\n\");\n> +\telse\n> +\t\tprintf(\"DISABLE PRIVILEGE\\n\");\n> }\n> \n> static void\n> diff -ur postgresql-7.1.2/src/pl/plpgsql/src/plpgsql.h postgresql-7.1.2-patch/src/pl/plpgsql/src/plpgsql.h\n> --- postgresql-7.1.2/src/pl/plpgsql/src/plpgsql.h\tWed Jun 20 20:07:45 2001\n> +++ postgresql-7.1.2-patch/src/pl/plpgsql/src/plpgsql.h\tWed Jun 20 20:08:57 2001\n> @@ -94,7 +94,9 @@\n> \tPLPGSQL_STMT_EXECSQL,\n> \tPLPGSQL_STMT_DYNEXECUTE,\n> \tPLPGSQL_STMT_DYNFORS,\n> -\tPLPGSQL_STMT_GETDIAG\n> +\tPLPGSQL_STMT_GETDIAG,\n> +\tPLPGSQL_STMT_ENABLE,\n> +\tPLPGSQL_STMT_DISABLE\n> };\n> \n> \n> @@ -387,6 +389,11 @@\n> \tint\t\t\tretrecno;\n> }\t\t\tPLpgSQL_stmt_return;\n> \n> +typedef struct\n> +{ /* ENABLE/DISABLE statement */\n> + int cmd_type;\n> + int lineno;\n> +} PLpgSQL_stmt_privilege;\n> \n> typedef struct\n> {\t\t\t\t\t\t\t\t/* RAISE statement\t\t\t*/\n> @@ -464,6 +471,8 @@\n> \tint\t\t\tfound_varno;\n> \tint\t\t\tndatums;\n> \tPLpgSQL_datum **datums;\n> +\tOid\t\tsave_uid;\n> +\tOid\t\tfn_oid;\n> }\t\t\tPLpgSQL_execstate;\n> \n> \n> Only in postgresql-7.1.2/src/pl/plpgsql/src: plpgsql.h.orig\n> Only in postgresql-7.1.2/src/pl/plpgsql/src: plpgsql.h.rej\n> diff -ur postgresql-7.1.2/src/pl/plpgsql/src/scan.l postgresql-7.1.2-patch/src/pl/plpgsql/src/scan.l\n> --- postgresql-7.1.2/src/pl/plpgsql/src/scan.l\tWed Jun 20 20:07:45 2001\n> +++ postgresql-7.1.2-patch/src/pl/plpgsql/src/scan.l\tWed Jun 20 19:48:18 2001\n> @@ -115,6 +115,9 @@\n> null\t\t\t{ return K_NULL;\t\t\t}\n> perform\t\t\t{ return K_PERFORM;\t\t\t}\n> raise\t\t\t{ return K_RAISE;\t\t\t}\n> +enable\t\t\t{ return K_ENABLE;\t\t\t}\n> +disable\t\t{ return K_DISABLE;\t\t\t}\n> +privilege\t\t{ return K_PRIVILEGE;\t\t\t}\n> record\t\t\t{ return K_RECORD;\t\t\t}\n> rename\t\t\t{ return K_RENAME;\t\t\t}\n> result_oid\t\t{ return K_RESULT_OID;\t\t}\n\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 3: if posting/reading through Usenet, please send an appropriate\n> subscribe-nomail command to majordomo@postgresql.org so that your\n> message can get through to the mailing list cleanly\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Sat, 23 Jun 2001 22:46:09 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] Re: Setuid functions"
},
{
"msg_contents": "\nAs a matter of interest, whatever happened to Perter's & Jan's plans for\nsetuid functions?\n\n From memory, Jan's proposal was shelved in favour of something Peter had\npreviously proposed, is that right?\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.B.N. 75 008 659 498) | /(@) ______---_\nTel: (+61) 0500 83 82 81 | _________ \\\nFax: (+61) 0500 83 82 82 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n",
"msg_date": "Sun, 24 Jun 2001 13:47:58 +1000",
"msg_from": "Philip Warner <pjw@rhyme.com.au>",
"msg_from_op": false,
"msg_subject": "Re: Setuid functions"
},
{
"msg_contents": "Philip Warner writes:\n\n> As a matter of interest, whatever happened to Perter's & Jan's plans for\n> setuid functions?\n\nIf someone wants to implement them, be my guest. I originally needed them\nfor fixing the RI permission problems, but they couldn't be used for that\nafter all.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Sun, 24 Jun 2001 13:28:00 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: Setuid functions"
},
{
"msg_contents": "At 13:28 24/06/01 +0200, Peter Eisentraut wrote:\n>\n>If someone wants to implement them, be my guest. I originally needed them\n>for fixing the RI permission problems, but they couldn't be used for that\n>after all.\n>\n\nThey were part of a larger permissions overhaul that Jan proposed - IIRC,\nat the time you objected, citing your prior proposal. Are you now saying\nyou are happy with Jan's original proposal? Or just the setuid functions?\n\n\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.B.N. 75 008 659 498) | /(@) ______---_\nTel: (+61) 0500 83 82 81 | _________ \\\nFax: (+61) 0500 83 82 82 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n",
"msg_date": "Sun, 24 Jun 2001 21:32:25 +1000",
"msg_from": "Philip Warner <pjw@rhyme.com.au>",
"msg_from_op": false,
"msg_subject": "Re: Setuid functions"
},
{
"msg_contents": "Philip Warner writes:\n\n> >If someone wants to implement them, be my guest. I originally needed them\n> >for fixing the RI permission problems, but they couldn't be used for that\n> >after all.\n>\n> They were part of a larger permissions overhaul that Jan proposed - IIRC,\n> at the time you objected, citing your prior proposal. Are you now saying\n> you are happy with Jan's original proposal? Or just the setuid functions?\n\nThe idea of setuid functions has surely existed much longer than that\nproposal, and the implementation is more or less \"obvious\" for someone\nknowledgeable.\n\nThe proposal as a whole was rather vague and went amiss of the goal to\nbecome SQL compliant, IIRC.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Sun, 24 Jun 2001 13:55:22 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: Setuid functions"
},
{
"msg_contents": "Tom Lane writes:\n\n> Overall, the only objection I can see to doing things this way is that\n> we have to do it over again for each function language (eg, adding such\n> a thing to SQL functions is doable, but much more tedious than for\n> plpgsql). But it seems more flexible than the pg_proc-attribute\n> approach.\n\nBoth approaches could be complementary, like they are in Unix as well.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Sun, 24 Jun 2001 13:56:13 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] Re: Setuid functions "
},
{
"msg_contents": "Philip Warner wrote:\n> At 13:28 24/06/01 +0200, Peter Eisentraut wrote:\n> >\n> >If someone wants to implement them, be my guest. I originally needed them\n> >for fixing the RI permission problems, but they couldn't be used for that\n> >after all.\n> >\n>\n> They were part of a larger permissions overhaul that Jan proposed - IIRC,\n> at the time you objected, citing your prior proposal. Are you now saying\n> you are happy with Jan's original proposal? Or just the setuid functions?\n\n More a bunch of ideas instead of a fully thought through\n proposal. But IIRC we wanted to attack the overhaul of the\n access control system while doing schemas - no?\n\n\nJan\n\n--\n\n#======================================================================#\n# It's easier to get forgiveness for being wrong than for being right. #\n# Let's break this rule - forgive me. #\n#================================================== JanWieck@Yahoo.com #\n\n\n\n_________________________________________________________\nDo You Yahoo!?\nGet your free @yahoo.com address at http://mail.yahoo.com\n\n",
"msg_date": "Mon, 25 Jun 2001 09:15:04 -0400 (EDT)",
"msg_from": "Jan Wieck <JanWieck@Yahoo.com>",
"msg_from_op": false,
"msg_subject": "Re: Setuid functions"
}
] |
[
{
"msg_contents": "I know this topic was discussed a few months ago, but I'm wondering if any\ndecisions have been reached on if, how, and when setuid functions and triggers\nmight be implemented. If not, I have an idea to throw at it.\n\nThanks,\nMark\n",
"msg_date": "Wed, 13 Jun 2001 14:32:48 -0400",
"msg_from": "Mark Volpe <volpe.mark@epa.gov>",
"msg_from_op": true,
"msg_subject": "Setuid functions"
}
] |
[
{
"msg_contents": "\tAfter the comment by someone about the UPDATE being responsible for\nthe reason for vacuuming (sorry, I didn't know that), I looked into a stored\nprocedure that gets triggered during an insert. The stored procedure does an\nUPDATE on another table, for every insert. So inserting 100,000 items into\nthe table causes an update on 100,000 items in another table. I noticed that\nthe other table's file size gets very large (right now it's over a megabyte\nand only 10% complete inserting), even though there are only about 5 items\nin that table. Since that table has the UPDATE happening to it, it's getting\nlarge. A vacuum chops it down to 8K.\n\tI tried increasing the buffer size, and that made the 100,000\ninserts (with the corresponding update) go longer before hitting the barrier\nand slowing down tremendously (until another vacuum is done).\n\n\tSince vacuum isn't tied to a time, but rather the size of the\nbuffers? or the indices? it would seem plausible to do as another person had\nmentioned and have vacuum kick off when the buffers are xx% full.\n\nMike\n\n\n\n-----Original Message-----\nFrom: Zeugswetter Andreas SB [mailto:ZeugswetterA@wien.spardat.at]\nSent: Wednesday, June 13, 2001 1:04 AM\nTo: 'Mike Cianflone'; Hackers List\nSubject: AW: [HACKERS] vacuum\n\n\n\n> \tIs there a relative consensus for how often to run vacuum? I have a\n> table of about 8 columns that I fill with 100,000 items simply via a \"\\i\n> alarms.sql\". After 1,000 items or so it gets extremely slow to fill with\n> data, and will take over a day to fill the entire thing unless I run\nvacuum\n> once a minute.\n\nYou will have to tell us, what exactly your alarms.sql does, and what\nindexes \nyour table has. Above behavior is certainly not to be expected in general,\nespecially the \"vacuum once a minute\" is highly suspicious.\n\nFor a series of insert only statements, the vacuum is not supposed to help\nat \nall, thus there must be an update hidden somewhere. \n\nAndreas\n\n---------------------------(end of broadcast)---------------------------\nTIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org\n",
"msg_date": "Wed, 13 Jun 2001 12:16:43 -0700",
"msg_from": "Mike Cianflone <mcianflone@littlefeet-inc.com>",
"msg_from_op": true,
"msg_subject": "RE: vacuum"
},
{
"msg_contents": "Mike Cianflone writes:\n\n> \tAfter the comment by someone about the UPDATE being responsible for\n> the reason for vacuuming (sorry, I didn't know that), I looked into a stored\n> procedure that gets triggered during an insert. The stored procedure does an\n> UPDATE on another table, for every insert. So inserting 100,000 items into\n> the table causes an update on 100,000 items in another table. I noticed that\n> the other table's file size gets very large (right now it's over a megabyte\n> and only 10% complete inserting), even though there are only about 5 items\n> in that table. Since that table has the UPDATE happening to it, it's getting\n> large. A vacuum chops it down to 8K.\n\nAn UPDATE basically acts as \"append and mark old record obsolete\". This\nis the so-called non-overwriting storage manager which keeps all data,\neven deleted data, indefinitely until you run vacuum (hence the name).\n\n> \tI tried increasing the buffer size, and that made the 100,000\n> inserts (with the corresponding update) go longer before hitting the barrier\n> and slowing down tremendously (until another vacuum is done).\n\nIncreasing the buffer size will keep the data in memory longer before\npushing it out to disk. The net result will be the same though.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Wed, 13 Jun 2001 22:55:45 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "RE: vacuum"
},
{
"msg_contents": "\nNow that you've narrowed it down to a specific table, at least you can\nspecifically vacuum just that table and ignore the rest of the database\n...might help a bit?\n\nOn Wed, 13 Jun 2001, Mike Cianflone wrote:\n\n> \tAfter the comment by someone about the UPDATE being responsible for\n> the reason for vacuuming (sorry, I didn't know that), I looked into a stored\n> procedure that gets triggered during an insert. The stored procedure does an\n> UPDATE on another table, for every insert. So inserting 100,000 items into\n> the table causes an update on 100,000 items in another table. I noticed that\n> the other table's file size gets very large (right now it's over a megabyte\n> and only 10% complete inserting), even though there are only about 5 items\n> in that table. Since that table has the UPDATE happening to it, it's getting\n> large. A vacuum chops it down to 8K.\n> \tI tried increasing the buffer size, and that made the 100,000\n> inserts (with the corresponding update) go longer before hitting the barrier\n> and slowing down tremendously (until another vacuum is done).\n>\n> \tSince vacuum isn't tied to a time, but rather the size of the\n> buffers? or the indices? it would seem plausible to do as another person had\n> mentioned and have vacuum kick off when the buffers are xx% full.\n>\n> Mike\n>\n>\n>\n> -----Original Message-----\n> From: Zeugswetter Andreas SB [mailto:ZeugswetterA@wien.spardat.at]\n> Sent: Wednesday, June 13, 2001 1:04 AM\n> To: 'Mike Cianflone'; Hackers List\n> Subject: AW: [HACKERS] vacuum\n>\n>\n>\n> > \tIs there a relative consensus for how often to run vacuum? I have a\n> > table of about 8 columns that I fill with 100,000 items simply via a \"\\i\n> > alarms.sql\". After 1,000 items or so it gets extremely slow to fill with\n> > data, and will take over a day to fill the entire thing unless I run\n> vacuum\n> > once a minute.\n>\n> You will have to tell us, what exactly your alarms.sql does, and what\n> indexes\n> your table has. Above behavior is certainly not to be expected in general,\n> especially the \"vacuum once a minute\" is highly suspicious.\n>\n> For a series of insert only statements, the vacuum is not supposed to help\n> at\n> all, thus there must be an update hidden somewhere.\n>\n> Andreas\n>\n> ---------------------------(end of broadcast)---------------------------\n> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org\n>\n> ---------------------------(end of broadcast)---------------------------\n> TIP 6: Have you searched our list archives?\n>\n> http://www.postgresql.org/search.mpl\n>\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org\nprimary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org\n\n",
"msg_date": "Wed, 13 Jun 2001 18:24:10 -0300 (ADT)",
"msg_from": "The Hermit Hacker <scrappy@hub.org>",
"msg_from_op": false,
"msg_subject": "RE: vacuum"
},
{
"msg_contents": "On Wed, Jun 13, 2001 at 06:24:10PM -0300, The Hermit Hacker wrote:\n> \n> Now that you've narrowed it down to a specific table, at least you can\n> specifically vacuum just that table and ignore the rest of the database\n> ...might help a bit?\n\nEven better: since he's loading a script anyway, the script could start\na transaction, disable the trigger, load the data, bulk UPDATE the other\ntable, and re-enable the trigger. I bet it takes only a few minutes to\ndo the whole thing that way.\n\nRoss\n\n> \n> On Wed, 13 Jun 2001, Mike Cianflone wrote:\n> \n> > \tAfter the comment by someone about the UPDATE being responsible for\n> > the reason for vacuuming (sorry, I didn't know that), I looked into a stored\n> > procedure that gets triggered during an insert. The stored procedure does an\n> > UPDATE on another table, for every insert. So inserting 100,000 items into\n> > the table causes an update on 100,000 items in another table. I noticed that\n> > the other table's file size gets very large (right now it's over a megabyte\n> > and only 10% complete inserting), even though there are only about 5 items\n> > in that table. Since that table has the UPDATE happening to it, it's getting\n> > large. A vacuum chops it down to 8K.\n> > \tI tried increasing the buffer size, and that made the 100,000\n> > inserts (with the corresponding update) go longer before hitting the barrier\n> > and slowing down tremendously (until another vacuum is done).\n> >\n> > \tSince vacuum isn't tied to a time, but rather the size of the\n> > buffers? or the indices? it would seem plausible to do as another person had\n> > mentioned and have vacuum kick off when the buffers are xx% full.\n> >\n> > Mike\n> >\n> >\n> >\n> > -----Original Message-----\n> > From: Zeugswetter Andreas SB [mailto:ZeugswetterA@wien.spardat.at]\n> > Sent: Wednesday, June 13, 2001 1:04 AM\n> > To: 'Mike Cianflone'; Hackers List\n> > Subject: AW: [HACKERS] vacuum\n> >\n> >\n> >\n> > > \tIs there a relative consensus for how often to run vacuum? I have a\n> > > table of about 8 columns that I fill with 100,000 items simply via a \"\\i\n> > > alarms.sql\". After 1,000 items or so it gets extremely slow to fill with\n> > > data, and will take over a day to fill the entire thing unless I run\n> > vacuum\n> > > once a minute.\n> >\n> > You will have to tell us, what exactly your alarms.sql does, and what\n> > indexes\n> > your table has. Above behavior is certainly not to be expected in general,\n> > especially the \"vacuum once a minute\" is highly suspicious.\n> >\n> > For a series of insert only statements, the vacuum is not supposed to help\n> > at\n> > all, thus there must be an update hidden somewhere.\n> >\n> > Andreas\n> >\n> > ---------------------------(end of broadcast)---------------------------\n> > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org\n> >\n> > ---------------------------(end of broadcast)---------------------------\n> > TIP 6: Have you searched our list archives?\n> >\n> > http://www.postgresql.org/search.mpl\n> >\n> \n> Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy\n> Systems Administrator @ hub.org\n> primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org\n> \n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 3: if posting/reading through Usenet, please send an appropriate\n> subscribe-nomail command to majordomo@postgresql.org so that your\n> message can get through to the mailing list cleanly\n",
"msg_date": "Tue, 19 Jun 2001 14:25:18 -0500",
"msg_from": "\"Ross J. Reedstrom\" <reedstrm@rice.edu>",
"msg_from_op": false,
"msg_subject": "Re: vacuum"
}
] |
[
{
"msg_contents": "\n\n\n>I will point out that \"you Australians\", and, well, \"us 'mericans\", are\n>the only countries without the sense to choose unique conventions for\n>time zone names.\n\nI once had a long discussion about that on the timezone mailing lists.\nIf I remember right I think the upshot is that these are not the only\nconflicts, they're probably just the only conflicts you have run across.\n\n>It sounds like having a second lookup table for the Australian rules is\n>a possibility, and this sounds fairly reasonable to me. Btw, is there an\n>Australian convention for referring to North American time zones for\n>those zones with naming conflicts?\n\nWell aren't there long names for all the zones like Australia/NSW,\nAustralia/QLD, Australia/VIC etc?\nI have at times heard people refer to AEST meaning Australian Eastern standard\ntime. I agree it's a big\nmess but I couldn't even convince the timezone people there was even a problem.\nOh well.\n\n\n\n",
"msg_date": "Thu, 14 Jun 2001 11:21:46 +1000",
"msg_from": "chris.bitmead@health.gov.au",
"msg_from_op": true,
"msg_subject": "Re: [PATCHES] Australian timezone configure option"
},
{
"msg_contents": "On Thu, Jun 14, 2001 at 11:21:46AM +1000, chris.bitmead@health.gov.au wrote:\n> >I will point out that \"you Australians\", and, well, \"us 'mericans\", are\n> >the only countries without the sense to choose unique conventions for\n> >time zone names.\n> \n> I once had a long discussion about that on the timezone mailing lists.\n> If I remember right I think the upshot is that these are not the only\n> conflicts, they're probably just the only conflicts you have run across.\n\nThere's no end...\n\n> >It sounds like having a second lookup table for the Australian rules is\n> >a possibility, and this sounds fairly reasonable to me. Btw, is there an\n> >Australian convention for referring to North American time zones for\n> >those zones with naming conflicts?\n> \n> Well aren't there long names for all the zones like Australia/NSW,\n> Australia/QLD, Australia/VIC etc? I have at times heard people refer\n> to AEST meaning Australian Eastern standard time. I agree it's a big\n> mess but I couldn't even convince the timezone people there was even a\n> problem. Oh well.\n\nEverybody knows there's a problem, but it's not the problem you\nthink it is, so inventing standard names wouldn't solve it even\nif you could get all the tin-pot politicians to agree on them.\n\nThe problem is that a time zone isn't a geographic construct, it's\na political one. What law was in effect on the date of the time\nmentioned? (Does the time even have a date associated?) We can't\nhave symbolic names for all the various versions of time zone \nproclamations made at various places. Until recently, in England\nyou didn't even know when Summer time would begin until a month or \ntwo ahead.\n\nIn practice, a time zone annotation isn't a computationally meaningful\nvalue. It's a hint to a person (e.g. \"on at 8PM Eastern, 7PM Central\").\nAs such, if it would be useful, it is just another database column\nto use in a report. If you have any reason to be unambiguous about \nthe time, then UTC or a local time with an offset from UTC is the best \nyou can do. Sometimes the offset might not match how the wall clock is \nset e.g. if the local law was changed without a corresponding software \nupdate, but it's right often enough to make people complacent.\n\nIs it frustrating? Of course. If the politicians could be persuaded\nto stop playing god and leave the clocks the hell alone, we could \nleave off wasting our time on it. \n\nNathan Myers\nncm@zembu.com\n",
"msg_date": "Wed, 20 Jun 2001 13:48:04 -0700",
"msg_from": "ncm@zembu.com (Nathan Myers)",
"msg_from_op": false,
"msg_subject": "Re: Re: [PATCHES] Australian timezone configure option"
}
] |
[
{
"msg_contents": "I've found a corrupted document in PostgreSQL 7.1.2, more specificaly\n\nsrc/bin/pgaccess/doc/html/tutorial/copyright.html\n\nThat list is the correct place to 'bug'? \n\nA Conectiva Snapshot user found the problem\n(http://bugzilla.conectiva.com/show_bug.cgi?id=3577).\n\n\nSorry for the bad english.\n\nSergio Bruder\n\n-- \n ( \t\t\n )) (tm)\thttp://sergio.bruder.net\n|\"\"|-. \t\thttp://pontobr.org\n|__|-' \t\tbruder@conectiva.com.br, sergio@bruder.net\nwe are concerned about the GNU General Public License (GPL)\n-- Microsoft press release\n------------------------------------------------------------------------------\npub 1024D/0C7D9F49 2000-05-26 Sergio Devojno Bruder <bruder@conectiva.com.br>\n Key fingerprint = 983F DBDF FB53 FE55 87DF 71CA 6B01 5E44 0C7D 9F49\nsub 1024g/138DF93D 2000-05-26\n",
"msg_date": "Wed, 13 Jun 2001 22:57:33 -0300",
"msg_from": "Sergio Bruder <bruder@conectiva.com.br>",
"msg_from_op": true,
"msg_subject": "corrupted document in 7.1.2"
},
{
"msg_contents": "\nThanks. Fix applied.\n\n\n> I've found a corrupted document in PostgreSQL 7.1.2, more specificaly\n> \n> src/bin/pgaccess/doc/html/tutorial/copyright.html\n> \n> That list is the correct place to 'bug'? \n> \n> A Conectiva Snapshot user found the problem\n> (http://bugzilla.conectiva.com/show_bug.cgi?id=3577).\n> \n> \n> Sorry for the bad english.\n> \n> Sergio Bruder\n> \n> -- \n> ( \t\t\n> )) (tm)\thttp://sergio.bruder.net\n> |\"\"|-. \t\thttp://pontobr.org\n> |__|-' \t\tbruder@conectiva.com.br, sergio@bruder.net\n> we are concerned about the GNU General Public License (GPL)\n> -- Microsoft press release\n> ------------------------------------------------------------------------------\n> pub 1024D/0C7D9F49 2000-05-26 Sergio Devojno Bruder <bruder@conectiva.com.br>\n> Key fingerprint = 983F DBDF FB53 FE55 87DF 71CA 6B01 5E44 0C7D 9F49\n> sub 1024g/138DF93D 2000-05-26\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org\n> \n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 14 Jun 2001 00:23:51 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: corrupted document in 7.1.2"
},
{
"msg_contents": "Sergio Bruder <bruder@conectiva.com.br> writes:\n> I've found a corrupted document in PostgreSQL 7.1.2, more specificaly\n> src/bin/pgaccess/doc/html/tutorial/copyright.html\n\nNot only is it a mess now, but it seems it's always been a mess :-(.\nNone of the past CVS versions look very clean either.\n\nWho's the author of this file?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 00:26:32 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: corrupted document in 7.1.2 "
},
{
"msg_contents": "Sergio Bruder <bruder@conectiva.com.br> writes:\n> [bruder@mapi2 postgresql-7.1.2]$ file src/bin/pgaccess/doc/html/tutorial/copyright.html\n> src/bin/pgaccess/doc/html/tutorial/copyright.html: GNU tar archive\n> [bruder@mapi2 postgresql-7.1.2]$ tar -tvf src/bin/pgaccess/doc/html/tutorial/copyright.html \n> -rw-r--r-- root/root 1195 1999-07-13 02:19:00 index.html\n> -rw-r--r-- root/root 2354 1999-07-13 02:14:11 intro.html\n> -rw-r--r-- sarah/sarah 4442 1999-07-13 02:18:45 irix.html\n> -rw-r--r-- root/root 3442 1999-07-13 01:54:13 problems.html\n> -rw-r--r-- root/root 4087 1999-07-13 02:07:22 start.html\n\nOh-ho, so that's why it's full of nulls and so on. Looks like we should\nextract the component files in the master sources...\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 18 Jun 2001 15:42:38 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: corrupted document in 7.1.2 "
},
{
"msg_contents": "> Sergio Bruder <bruder@conectiva.com.br> writes:\n> > [bruder@mapi2 postgresql-7.1.2]$ file src/bin/pgaccess/doc/html/tutorial/copyright.html\n> > src/bin/pgaccess/doc/html/tutorial/copyright.html: GNU tar archive\n> > [bruder@mapi2 postgresql-7.1.2]$ tar -tvf src/bin/pgaccess/doc/html/tutorial/copyright.html \n> > -rw-r--r-- root/root 1195 1999-07-13 02:19:00 index.html\n> > -rw-r--r-- root/root 2354 1999-07-13 02:14:11 intro.html\n> > -rw-r--r-- sarah/sarah 4442 1999-07-13 02:18:45 irix.html\n> > -rw-r--r-- root/root 3442 1999-07-13 01:54:13 problems.html\n> > -rw-r--r-- root/root 4087 1999-07-13 02:07:22 start.html\n> \n> Oh-ho, so that's why it's full of nulls and so on. Looks like we should\n> extract the component files in the master sources...\n> \n\nThanks. Fixed. I untared the file, and copied copyright.html from the\ndirectory above.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Mon, 18 Jun 2001 17:32:44 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: corrupted document in 7.1.2"
}
] |
[
{
"msg_contents": "In order to be able to implement updateable result sets there needs to be a mechanism for determining if the underlying data has changed since the resultset was fetched. Short of retrieving the current data and comparing the entire row, can anyone think of a way possibly using the row version to determine if the data has been concurrently changed?\n\nDave\n\n\n\n\n\n\n\nIn order to be able to implement updateable result \nsets there needs to be a mechanism for determining if the underlying data has \nchanged since the resultset was fetched. Short of retrieving the current data \nand comparing the entire row, can anyone think of a way possibly using the row \nversion to determine if the data has been concurrently changed?\n \nDave",
"msg_date": "Wed, 13 Jun 2001 23:34:04 -0400",
"msg_from": "\"Dave Cramer\" <dave@fastcrypt.com>",
"msg_from_op": true,
"msg_subject": "Row Versioning, for jdbc updateable result sets"
}
] |
[
{
"msg_contents": "Here is a patch that allows people to delete the pg_temp* tables used as\ntemp tables. They are left around after a backend crash and the only\nway previously to remove them was to start postgres with the -O override\noption.\n\nI am wondering if pg_temp tables should even be seen as system tables by\nIsSystemRelationName(). We have to call them pg_ so user applications\ndon't display them, but other than that they aren't like system tables.\nComments?\n\nThere are no tests to see if the table is actually in use. I can add\nthem if people want it.\n\n---------------------------------------------------------------------------\n\t\n\ttest=> CREATE TEMP TABLE test (x int);\n\tCREATE\n\ttest=> \\dS\n\t List of relations\n\t Name | Type | Owner \n\t----------------+---------+----------\n\t...\n\t pg_temp.6682.0 | table | postgres\n\t...\n\ttest=> DROP TABLE \"pg_temp.6682.0\";\n\tDROP\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n\nIndex: src/backend/catalog/aclchk.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/catalog/aclchk.c,v\nretrieving revision 1.50\ndiff -c -r1.50 aclchk.c\n*** src/backend/catalog/aclchk.c\t2001/06/09 23:21:54\t1.50\n--- src/backend/catalog/aclchk.c\t2001/06/14 04:06:32\n***************\n*** 32,37 ****\n--- 32,38 ----\n #include \"parser/parse_func.h\"\n #include \"utils/acl.h\"\n #include \"utils/syscache.h\"\n+ #include \"utils/temprel.h\"\n \n static int32 aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode);\n \n***************\n*** 437,443 ****\n \t */\n \tif ((mode & (ACL_INSERT | ACL_UPDATE | ACL_DELETE)) &&\n \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n! \t\tstrncmp(relname, \"pg_temp.\", strlen(\"pg_temp.\")) != 0 &&\n \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n \t{\n #ifdef ACLDEBUG\n--- 438,444 ----\n \t */\n \tif ((mode & (ACL_INSERT | ACL_UPDATE | ACL_DELETE)) &&\n \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n! \t\t!is_temp_relname(relname) &&\n \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n \t{\n #ifdef ACLDEBUG\nIndex: src/backend/catalog/heap.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/catalog/heap.c,v\nretrieving revision 1.167\ndiff -c -r1.167 heap.c\n*** src/backend/catalog/heap.c\t2001/06/12 05:55:49\t1.167\n--- src/backend/catalog/heap.c\t2001/06/14 04:06:38\n***************\n*** 281,288 ****\n \t\t * replace relname of caller with a unique name for a temp\n \t\t * relation\n \t\t */\n! \t\tsnprintf(relname, NAMEDATALEN, \"pg_temp.%d.%u\",\n! \t\t\t\t (int) MyProcPid, uniqueId++);\n \t}\n \n \t/*\n--- 281,288 ----\n \t\t * replace relname of caller with a unique name for a temp\n \t\t * relation\n \t\t */\n! \t\tsnprintf(relname, NAMEDATALEN, \"%s.%d.%u\",\n! \t\t\t\tPG_TEMP_REL_PREFIX, (int) MyProcPid, uniqueId++);\n \t}\n \n \t/*\n***************\n*** 874,910 ****\n }\n \n \n- /* ----------------------------------------------------------------\n- *\t\theap_drop_with_catalog\t- removes all record of named relation from catalogs\n- *\n- *\t\t1)\topen relation, check for existence, etc.\n- *\t\t2)\tremove inheritance information\n- *\t\t3)\tremove indexes\n- *\t\t4)\tremove pg_class tuple\n- *\t\t5)\tremove pg_attribute tuples and related descriptions\n- *\t\t\t\t6)\t\tremove pg_description tuples\n- *\t\t7)\tremove pg_type tuples\n- *\t\t8)\tRemoveConstraints ()\n- *\t\t9)\tunlink relation\n- *\n- * old comments\n- *\t\tExcept for vital relations, removes relation from\n- *\t\trelation catalog, and related attributes from\n- *\t\tattribute catalog (needed?). (Anything else?)\n- *\n- *\t\tget proper relation from relation catalog (if not arg)\n- *\t\tscan attribute catalog deleting attributes of reldesc\n- *\t\t\t\t(necessary?)\n- *\t\tdelete relation from relation catalog\n- *\t\t(How are the tuples of the relation discarded?)\n- *\n- *\t\tXXX Must fix to work with indexes.\n- *\t\tThere may be a better order for doing things.\n- *\t\tProblems with destroying a deleted database--cannot create\n- *\t\ta struct reldesc without having an open file descriptor.\n- * ----------------------------------------------------------------\n- */\n- \n /* --------------------------------\n *\t\tRelationRemoveInheritance\n *\n--- 874,879 ----\n***************\n*** 1334,1343 ****\n \theap_close(pg_type_desc, RowExclusiveLock);\n }\n \n! /* --------------------------------\n! *\t\theap_drop_with_catalog\n *\n! * --------------------------------\n */\n void\n heap_drop_with_catalog(const char *relname,\n--- 1303,1337 ----\n \theap_close(pg_type_desc, RowExclusiveLock);\n }\n \n! /* ----------------------------------------------------------------\n! *\t\theap_drop_with_catalog\t- removes all record of named relation from catalogs\n *\n! *\t\t1)\topen relation, check for existence, etc.\n! *\t\t2)\tremove inheritance information\n! *\t\t3)\tremove indexes\n! *\t\t4)\tremove pg_class tuple\n! *\t\t5)\tremove pg_attribute tuples and related descriptions\n! *\t\t\t\t6)\t\tremove pg_description tuples\n! *\t\t7)\tremove pg_type tuples\n! *\t\t8)\tRemoveConstraints ()\n! *\t\t9)\tunlink relation\n! *\n! * old comments\n! *\t\tExcept for vital relations, removes relation from\n! *\t\trelation catalog, and related attributes from\n! *\t\tattribute catalog (needed?). (Anything else?)\n! *\n! *\t\tget proper relation from relation catalog (if not arg)\n! *\t\tscan attribute catalog deleting attributes of reldesc\n! *\t\t\t\t(necessary?)\n! *\t\tdelete relation from relation catalog\n! *\t\t(How are the tuples of the relation discarded?)\n! *\n! *\t\tXXX Must fix to work with indexes.\n! *\t\tThere may be a better order for doing things.\n! *\t\tProblems with destroying a deleted database--cannot create\n! *\t\ta struct reldesc without having an open file descriptor.\n! * ----------------------------------------------------------------\n */\n void\n heap_drop_with_catalog(const char *relname,\n***************\n*** 1360,1367 ****\n \t * prevent deletion of system relations\n \t */\n \t/* allow temp of pg_class? Guess so. */\n! \tif (!istemp && !allow_system_table_mods &&\n! \t\tIsSystemRelationName(RelationGetRelationName(rel)))\n \t\telog(ERROR, \"System relation \\\"%s\\\" may not be dropped\",\n \t\t\t RelationGetRelationName(rel));\n \n--- 1354,1363 ----\n \t * prevent deletion of system relations\n \t */\n \t/* allow temp of pg_class? Guess so. */\n! \tif (!istemp &&\n! \t\t!allow_system_table_mods &&\n! \t\tIsSystemRelationName(RelationGetRelationName(rel)) &&\n! \t\t!is_temp_relname(RelationGetRelationName(rel)))\n \t\telog(ERROR, \"System relation \\\"%s\\\" may not be dropped\",\n \t\t\t RelationGetRelationName(rel));\n \nIndex: src/backend/commands/vacuum.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/commands/vacuum.c,v\nretrieving revision 1.196\ndiff -c -r1.196 vacuum.c\n*** src/backend/commands/vacuum.c\t2001/06/13 21:44:40\t1.196\n--- src/backend/commands/vacuum.c\t2001/06/14 04:06:40\n***************\n*** 491,497 ****\n \tvacuum_pages.num_pages = fraged_pages.num_pages = 0;\n \tscan_heap(vacrelstats, onerel, &vacuum_pages, &fraged_pages);\n \tif (IsIgnoringSystemIndexes() &&\n! \t\tIsSystemRelationName(RelationGetRelationName(onerel)))\n \t\treindex = true;\n \n \t/* Now open indices */\n--- 491,498 ----\n \tvacuum_pages.num_pages = fraged_pages.num_pages = 0;\n \tscan_heap(vacrelstats, onerel, &vacuum_pages, &fraged_pages);\n \tif (IsIgnoringSystemIndexes() &&\n! \t\tIsSystemRelationName(RelationGetRelationName(onerel)) &&\n! \t\t!is_temp_relname(RelationGetRelationName(onerel)))\n \t\treindex = true;\n \n \t/* Now open indices */\nIndex: src/backend/tcop/utility.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/tcop/utility.c,v\nretrieving revision 1.113\ndiff -c -r1.113 utility.c\n*** src/backend/tcop/utility.c\t2001/06/09 23:21:54\t1.113\n--- src/backend/tcop/utility.c\t2001/06/14 04:06:44\n***************\n*** 46,51 ****\n--- 46,52 ----\n #include \"utils/acl.h\"\n #include \"utils/ps_status.h\"\n #include \"utils/syscache.h\"\n+ #include \"utils/temprel.h\"\n #include \"access/xlog.h\"\n \n /*\n***************\n*** 120,126 ****\n \t\telog(ERROR, \"you do not own %s \\\"%s\\\"\",\n \t\t\t rentry->name, name);\n \n! \tif (!allowSystemTableMods && IsSystemRelationName(name))\n \t\telog(ERROR, \"%s \\\"%s\\\" is a system %s\",\n \t\t\t rentry->name, name, rentry->name);\n \n--- 121,128 ----\n \t\telog(ERROR, \"you do not own %s \\\"%s\\\"\",\n \t\t\t rentry->name, name);\n \n! \tif (!allowSystemTableMods && IsSystemRelationName(name) &&\n! \t\t!is_temp_relname(name))\n \t\telog(ERROR, \"%s \\\"%s\\\" is a system %s\",\n \t\t\t rentry->name, name, rentry->name);\n \nIndex: src/include/utils/temprel.h\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/include/utils/temprel.h,v\nretrieving revision 1.15\ndiff -c -r1.15 temprel.h\n*** src/include/utils/temprel.h\t2001/03/22 04:01:14\t1.15\n--- src/include/utils/temprel.h\t2001/06/14 04:06:47\n***************\n*** 16,21 ****\n--- 16,26 ----\n \n #include \"access/htup.h\"\n \n+ #define PG_TEMP_REL_PREFIX \"pg_temp\"\n+ \n+ #define is_temp_relname(relname) \\\n+ \t\t(!strncmp(relname, PG_TEMP_REL_PREFIX, strlen(PG_TEMP_REL_PREFIX)))\n+ \n extern void create_temp_relation(const char *relname,\n \t\t\t\t\t HeapTuple pg_class_tuple);\n extern void remove_temp_rel_by_relid(Oid relid);",
"msg_date": "Thu, 14 Jun 2001 00:17:14 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Removal of temp tables"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> I am wondering if pg_temp tables should even be seen as system tables by\n> IsSystemRelationName(). We have to call them pg_ so user applications\n> don't display them, but other than that they aren't like system tables.\n> Comments?\n\nThis oughta be discussed on pghackers, not just -patches. But my\nthought is that we need a three-way distinction; at least some of the\nIsSystemRelation checks presumably *should* accept temp relnames, else\nwe'd not have decided to do it that way in the first place.\n\nAnother point is that when we implement schemas (= Real Soon Now, I\ntrust), the whole business of temprels having different physical and\nlogical relnames will go away anyhow. Temp rels will become plain rels\nthat live in a temp schema. So it may not be worth adding further\ncomplexity to support the present approach. We'll just have to rip\nit out again ... better to expend the work on making schemas.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 00:52:06 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Removal of temp tables "
},
{
"msg_contents": "> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > I am wondering if pg_temp tables should even be seen as system tables by\n> > IsSystemRelationName(). We have to call them pg_ so user applications\n> > don't display them, but other than that they aren't like system tables.\n> > Comments?\n> \n> This oughta be discussed on pghackers, not just -patches. But my\n> thought is that we need a three-way distinction; at least some of the\n> IsSystemRelation checks presumably *should* accept temp relnames, else\n> we'd not have decided to do it that way in the first place.\n> \n> Another point is that when we implement schemas (= Real Soon Now, I\n> trust), the whole business of temprels having different physical and\n> logical relnames will go away anyhow. Temp rels will become plain rels\n> that live in a temp schema. So it may not be worth adding further\n> complexity to support the present approach. We'll just have to rip\n> it out again ... better to expend the work on making schemas.\n\nOK, the patch allows temp tables to be used in the places that need to\ndrop them. Not sure what else is needed. We don't want people creating\nthem tables with names like pg_temp because it could conflict with an\nexisting backend so it seems we will just need to open it up in special\nplaces.\n\nOther comments? \n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 14 Jun 2001 01:05:51 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: [PATCHES] Removal of temp tables"
},
{
"msg_contents": "Tom Lane writes:\n\n> Another point is that when we implement schemas (= Real Soon Now, I\n> trust), the whole business of temprels having different physical and\n> logical relnames will go away anyhow. Temp rels will become plain rels\n> that live in a temp schema.\n\nI don't think this is the right solution. You should be able to create\ntemporary tables in any schema you choose (and have permission to). After\nall, temporary tables are supposed to act like real tables expect for the\n\"temporary\" aspect.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Thu, 14 Jun 2001 17:15:07 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: [PATCHES] Removal of temp tables "
},
{
"msg_contents": "Peter Eisentraut <peter_e@gmx.net> writes:\n> Tom Lane writes:\n>> ... the whole business of temprels having different physical and\n>> logical relnames will go away anyhow. Temp rels will become plain rels\n>> that live in a temp schema.\n\n> I don't think this is the right solution. You should be able to create\n> temporary tables in any schema you choose (and have permission to). After\n> all, temporary tables are supposed to act like real tables expect for the\n> \"temporary\" aspect.\n\nIf we did that, temp table names would conflict with real table names.\nThe lack of conflicts is one of the (few ;-)) features of our current\ntemp table implementation that I really like. Furthermore, I read in\nSQL92 sec 4.9\n\n ... because global temporary ta-\n ble contents are distinct within SQL-sessions, and created local\n temporary tables are distinct within <module>s within SQL-sessions,\n the effective <schema name> of the schema in which the global tem-\n porary table or the created local temporary table is instantiated\n is an implementation-dependent <schema name> that may be thought\n of as having been effectively derived from the <schema name> of\n the schema in which the global temporary table or created local\n temporary table is defined and the implementation-dependent SQL-\n session identifier associated with the SQL-session. In addition,\n the effective <schema name> of the schema in which the created\n local temporary table is instantiated may be thought of as being\n further qualified by a unique implementation-dependent name associ-\n ated with the <module> in which the created local temporary table\n is referenced.\n\nThis appears to me to require that it be done in the way I suggest:\ntemp tables live in their own per-backend schema, or schemas.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 11:23:29 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCHES] Removal of temp tables "
},
{
"msg_contents": "> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > I am wondering if pg_temp tables should even be seen as system tables by\n> > IsSystemRelationName(). We have to call them pg_ so user applications\n> > don't display them, but other than that they aren't like system tables.\n> > Comments?\n> \n> This oughta be discussed on pghackers, not just -patches. But my\n> thought is that we need a three-way distinction; at least some of the\n> IsSystemRelation checks presumably *should* accept temp relnames, else\n> we'd not have decided to do it that way in the first place.\n> \n> Another point is that when we implement schemas (= Real Soon Now, I\n> trust), the whole business of temprels having different physical and\n> logical relnames will go away anyhow. Temp rels will become plain rels\n> that live in a temp schema. So it may not be worth adding further\n> complexity to support the present approach. We'll just have to rip\n> it out again ... better to expend the work on making schemas.\n\nHere is an updated patch that uses underscores in temp table names so\nthe DROP doesn't have to quote the table name:\n\n\tpg_temp_7199_0\n\nI will apply this in two days if there are no other comments.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n\nIndex: src/backend/catalog/aclchk.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/catalog/aclchk.c,v\nretrieving revision 1.50\ndiff -c -r1.50 aclchk.c\n*** src/backend/catalog/aclchk.c\t2001/06/09 23:21:54\t1.50\n--- src/backend/catalog/aclchk.c\t2001/06/14 16:33:47\n***************\n*** 32,37 ****\n--- 32,38 ----\n #include \"parser/parse_func.h\"\n #include \"utils/acl.h\"\n #include \"utils/syscache.h\"\n+ #include \"utils/temprel.h\"\n \n static int32 aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode);\n \n***************\n*** 437,443 ****\n \t */\n \tif ((mode & (ACL_INSERT | ACL_UPDATE | ACL_DELETE)) &&\n \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n! \t\tstrncmp(relname, \"pg_temp.\", strlen(\"pg_temp.\")) != 0 &&\n \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n \t{\n #ifdef ACLDEBUG\n--- 438,444 ----\n \t */\n \tif ((mode & (ACL_INSERT | ACL_UPDATE | ACL_DELETE)) &&\n \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n! \t\t!is_temp_relname(relname) &&\n \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n \t{\n #ifdef ACLDEBUG\nIndex: src/backend/catalog/heap.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/catalog/heap.c,v\nretrieving revision 1.167\ndiff -c -r1.167 heap.c\n*** src/backend/catalog/heap.c\t2001/06/12 05:55:49\t1.167\n--- src/backend/catalog/heap.c\t2001/06/14 16:33:51\n***************\n*** 281,288 ****\n \t\t * replace relname of caller with a unique name for a temp\n \t\t * relation\n \t\t */\n! \t\tsnprintf(relname, NAMEDATALEN, \"pg_temp.%d.%u\",\n! \t\t\t\t (int) MyProcPid, uniqueId++);\n \t}\n \n \t/*\n--- 281,288 ----\n \t\t * replace relname of caller with a unique name for a temp\n \t\t * relation\n \t\t */\n! \t\tsnprintf(relname, NAMEDATALEN, \"%s_%d_%u\",\n! \t\t\t\tPG_TEMP_REL_PREFIX, (int) MyProcPid, uniqueId++);\n \t}\n \n \t/*\n***************\n*** 874,910 ****\n }\n \n \n- /* ----------------------------------------------------------------\n- *\t\theap_drop_with_catalog\t- removes all record of named relation from catalogs\n- *\n- *\t\t1)\topen relation, check for existence, etc.\n- *\t\t2)\tremove inheritance information\n- *\t\t3)\tremove indexes\n- *\t\t4)\tremove pg_class tuple\n- *\t\t5)\tremove pg_attribute tuples and related descriptions\n- *\t\t\t\t6)\t\tremove pg_description tuples\n- *\t\t7)\tremove pg_type tuples\n- *\t\t8)\tRemoveConstraints ()\n- *\t\t9)\tunlink relation\n- *\n- * old comments\n- *\t\tExcept for vital relations, removes relation from\n- *\t\trelation catalog, and related attributes from\n- *\t\tattribute catalog (needed?). (Anything else?)\n- *\n- *\t\tget proper relation from relation catalog (if not arg)\n- *\t\tscan attribute catalog deleting attributes of reldesc\n- *\t\t\t\t(necessary?)\n- *\t\tdelete relation from relation catalog\n- *\t\t(How are the tuples of the relation discarded?)\n- *\n- *\t\tXXX Must fix to work with indexes.\n- *\t\tThere may be a better order for doing things.\n- *\t\tProblems with destroying a deleted database--cannot create\n- *\t\ta struct reldesc without having an open file descriptor.\n- * ----------------------------------------------------------------\n- */\n- \n /* --------------------------------\n *\t\tRelationRemoveInheritance\n *\n--- 874,879 ----\n***************\n*** 1334,1343 ****\n \theap_close(pg_type_desc, RowExclusiveLock);\n }\n \n! /* --------------------------------\n! *\t\theap_drop_with_catalog\n *\n! * --------------------------------\n */\n void\n heap_drop_with_catalog(const char *relname,\n--- 1303,1337 ----\n \theap_close(pg_type_desc, RowExclusiveLock);\n }\n \n! /* ----------------------------------------------------------------\n! *\t\theap_drop_with_catalog\t- removes all record of named relation from catalogs\n *\n! *\t\t1)\topen relation, check for existence, etc.\n! *\t\t2)\tremove inheritance information\n! *\t\t3)\tremove indexes\n! *\t\t4)\tremove pg_class tuple\n! *\t\t5)\tremove pg_attribute tuples and related descriptions\n! *\t\t\t\t6)\t\tremove pg_description tuples\n! *\t\t7)\tremove pg_type tuples\n! *\t\t8)\tRemoveConstraints ()\n! *\t\t9)\tunlink relation\n! *\n! * old comments\n! *\t\tExcept for vital relations, removes relation from\n! *\t\trelation catalog, and related attributes from\n! *\t\tattribute catalog (needed?). (Anything else?)\n! *\n! *\t\tget proper relation from relation catalog (if not arg)\n! *\t\tscan attribute catalog deleting attributes of reldesc\n! *\t\t\t\t(necessary?)\n! *\t\tdelete relation from relation catalog\n! *\t\t(How are the tuples of the relation discarded?)\n! *\n! *\t\tXXX Must fix to work with indexes.\n! *\t\tThere may be a better order for doing things.\n! *\t\tProblems with destroying a deleted database--cannot create\n! *\t\ta struct reldesc without having an open file descriptor.\n! * ----------------------------------------------------------------\n */\n void\n heap_drop_with_catalog(const char *relname,\n***************\n*** 1360,1367 ****\n \t * prevent deletion of system relations\n \t */\n \t/* allow temp of pg_class? Guess so. */\n! \tif (!istemp && !allow_system_table_mods &&\n! \t\tIsSystemRelationName(RelationGetRelationName(rel)))\n \t\telog(ERROR, \"System relation \\\"%s\\\" may not be dropped\",\n \t\t\t RelationGetRelationName(rel));\n \n--- 1354,1363 ----\n \t * prevent deletion of system relations\n \t */\n \t/* allow temp of pg_class? Guess so. */\n! \tif (!istemp &&\n! \t\t!allow_system_table_mods &&\n! \t\tIsSystemRelationName(RelationGetRelationName(rel)) &&\n! \t\t!is_temp_relname(RelationGetRelationName(rel)))\n \t\telog(ERROR, \"System relation \\\"%s\\\" may not be dropped\",\n \t\t\t RelationGetRelationName(rel));\n \nIndex: src/backend/commands/vacuum.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/commands/vacuum.c,v\nretrieving revision 1.196\ndiff -c -r1.196 vacuum.c\n*** src/backend/commands/vacuum.c\t2001/06/13 21:44:40\t1.196\n--- src/backend/commands/vacuum.c\t2001/06/14 16:33:53\n***************\n*** 491,497 ****\n \tvacuum_pages.num_pages = fraged_pages.num_pages = 0;\n \tscan_heap(vacrelstats, onerel, &vacuum_pages, &fraged_pages);\n \tif (IsIgnoringSystemIndexes() &&\n! \t\tIsSystemRelationName(RelationGetRelationName(onerel)))\n \t\treindex = true;\n \n \t/* Now open indices */\n--- 491,498 ----\n \tvacuum_pages.num_pages = fraged_pages.num_pages = 0;\n \tscan_heap(vacrelstats, onerel, &vacuum_pages, &fraged_pages);\n \tif (IsIgnoringSystemIndexes() &&\n! \t\tIsSystemRelationName(RelationGetRelationName(onerel)) &&\n! \t\t!is_temp_relname(RelationGetRelationName(onerel)))\n \t\treindex = true;\n \n \t/* Now open indices */\nIndex: src/backend/storage/file/fd.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/storage/file/fd.c,v\nretrieving revision 1.81\ndiff -c -r1.81 fd.c\n*** src/backend/storage/file/fd.c\t2001/06/11 04:12:29\t1.81\n--- src/backend/storage/file/fd.c\t2001/06/14 16:34:02\n***************\n*** 756,762 ****\n \t * transaction and database instance.\n \t */\n \tsnprintf(tempfilepath, sizeof(tempfilepath),\n! \t\t\t \"%s/%s%d.%ld\", PG_TEMP_FILES_DIR, PG_TEMP_FILE_PREFIX,\n \t\t\t MyProcPid, tempFileCounter++);\n \n \t/*\n--- 756,762 ----\n \t * transaction and database instance.\n \t */\n \tsnprintf(tempfilepath, sizeof(tempfilepath),\n! \t\t\t \"%s/%s%d_%ld\", PG_TEMP_FILES_DIR, PG_TEMP_FILE_PREFIX,\n \t\t\t MyProcPid, tempFileCounter++);\n \n \t/*\nIndex: src/backend/tcop/utility.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/tcop/utility.c,v\nretrieving revision 1.113\ndiff -c -r1.113 utility.c\n*** src/backend/tcop/utility.c\t2001/06/09 23:21:54\t1.113\n--- src/backend/tcop/utility.c\t2001/06/14 16:34:02\n***************\n*** 46,51 ****\n--- 46,52 ----\n #include \"utils/acl.h\"\n #include \"utils/ps_status.h\"\n #include \"utils/syscache.h\"\n+ #include \"utils/temprel.h\"\n #include \"access/xlog.h\"\n \n /*\n***************\n*** 120,126 ****\n \t\telog(ERROR, \"you do not own %s \\\"%s\\\"\",\n \t\t\t rentry->name, name);\n \n! \tif (!allowSystemTableMods && IsSystemRelationName(name))\n \t\telog(ERROR, \"%s \\\"%s\\\" is a system %s\",\n \t\t\t rentry->name, name, rentry->name);\n \n--- 121,128 ----\n \t\telog(ERROR, \"you do not own %s \\\"%s\\\"\",\n \t\t\t rentry->name, name);\n \n! \tif (!allowSystemTableMods && IsSystemRelationName(name) &&\n! \t\t!is_temp_relname(name))\n \t\telog(ERROR, \"%s \\\"%s\\\" is a system %s\",\n \t\t\t rentry->name, name, rentry->name);\n \nIndex: src/include/utils/temprel.h\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/include/utils/temprel.h,v\nretrieving revision 1.15\ndiff -c -r1.15 temprel.h\n*** src/include/utils/temprel.h\t2001/03/22 04:01:14\t1.15\n--- src/include/utils/temprel.h\t2001/06/14 16:34:03\n***************\n*** 16,21 ****\n--- 16,26 ----\n \n #include \"access/htup.h\"\n \n+ #define PG_TEMP_REL_PREFIX \"pg_temp\"\n+ \n+ #define is_temp_relname(relname) \\\n+ \t\t(!strncmp(relname, PG_TEMP_REL_PREFIX, strlen(PG_TEMP_REL_PREFIX)))\n+ \n extern void create_temp_relation(const char *relname,\n \t\t\t\t\t HeapTuple pg_class_tuple);\n extern void remove_temp_rel_by_relid(Oid relid);",
"msg_date": "Thu, 14 Jun 2001 12:36:48 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Removal of temp tables"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> Here is an updated patch that uses underscores in temp table names so\n> the DROP doesn't have to quote the table name:\n\nThat seems like a reasonable idea, but don't do it to temp file\nnames, ie, drop this part of the diff:\n\n> *** src/backend/storage/file/fd.c\t2001/06/11 04:12:29\t1.81\n> --- src/backend/storage/file/fd.c\t2001/06/14 16:34:02\n> ***************\n> *** 756,762 ****\n> \t * transaction and database instance.\n> \t */\n> \tsnprintf(tempfilepath, sizeof(tempfilepath),\n> ! \t\t\t \"%s/%s%d.%ld\", PG_TEMP_FILES_DIR, PG_TEMP_FILE_PREFIX,\n> \t\t\t MyProcPid, tempFileCounter++);\n \n> \t/*\n> --- 756,762 ----\n> \t * transaction and database instance.\n> \t */\n> \tsnprintf(tempfilepath, sizeof(tempfilepath),\n> ! \t\t\t \"%s/%s%d_%ld\", PG_TEMP_FILES_DIR, PG_TEMP_FILE_PREFIX,\n> \t\t\t MyProcPid, tempFileCounter++);\n \n> \t/*\n\nThere's no reason to spell temp file names as if they were rel names,\nand probably it's best not to make them look the same.\n\nAlso, an item I've ranted about before:\n\n> + #define is_temp_relname(relname) \\\n> + \t\t(!strncmp(relname, PG_TEMP_REL_PREFIX, strlen(PG_TEMP_REL_PREFIX)))\n\nIt's bad style to treat the result of strcmp or strncmp as though it\nwere a boolean, cf\nhttp://fts.postgresql.org/db/mw/msg.html?mid=68294\nWrite (strncmp(...) == 0) instead.\n\n\nOtherwise the patch seems reasonable, although I wonder what your\nmotivation was for choosing these particular IsSystemRelationName calls\nto tweak. It looks like you did more than the minimum needed to allow\na DROP TABLE; why these extra ones and not others? (Not that I'm\nencouraging you to go around and hit every IsSystemRelationName call.\nIf you did, that'll just be more changes that I suspect we'll have to\nremove again in the long run. I'm just curious why you touched, for\nexample, VACUUM.)\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 13:13:04 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Removal of temp tables "
},
{
"msg_contents": "> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > Here is an updated patch that uses underscores in temp table names so\n> > the DROP doesn't have to quote the table name:\n> \n> That seems like a reasonable idea, but don't do it to temp file\n> names, ie, drop this part of the diff:\n> \n> > *** src/backend/storage/file/fd.c\t2001/06/11 04:12:29\t1.81\n> > --- src/backend/storage/file/fd.c\t2001/06/14 16:34:02\n> > ***************\n> > *** 756,762 ****\n> > \t * transaction and database instance.\n> > \t */\n> > \tsnprintf(tempfilepath, sizeof(tempfilepath),\n> > ! \t\t\t \"%s/%s%d.%ld\", PG_TEMP_FILES_DIR, PG_TEMP_FILE_PREFIX,\n> > \t\t\t MyProcPid, tempFileCounter++);\n> \n> > \t/*\n> > --- 756,762 ----\n> > \t * transaction and database instance.\n> > \t */\n> > \tsnprintf(tempfilepath, sizeof(tempfilepath),\n> > ! \t\t\t \"%s/%s%d_%ld\", PG_TEMP_FILES_DIR, PG_TEMP_FILE_PREFIX,\n> > \t\t\t MyProcPid, tempFileCounter++);\n> \n> > \t/*\n> \n> There's no reason to spell temp file names as if they were rel names,\n> and probably it's best not to make them look the same.\n\nI was wondering that. The old vacuum file detection patch had the sort\nfiles going into /pg_sorttemp and files called pid_. Your changes made\nit pg_tempfile directory and pg_temp file names. I like the older names\nthat made them clear they were _not_ temp tables. Seemed you wanted\nthem to have similar names for reasons I couldn't figure.\n\nI don't care if the sort files have dots so I will remove that part of\nthe patch, but I think we should consider making the sort files more\ndifferent than they are now --- dots vs. underscores.\n\n\n> Also, an item I've ranted about before:\n> \n> > + #define is_temp_relname(relname) \\\n> > + \t\t(!strncmp(relname, PG_TEMP_REL_PREFIX, strlen(PG_TEMP_REL_PREFIX)))\n> \n> It's bad style to treat the result of strcmp or strncmp as though it\n> were a boolean, cf\n> http://fts.postgresql.org/db/mw/msg.html?mid=68294\n> Write (strncmp(...) == 0) instead.\n\nOK, changed.\n\n> Otherwise the patch seems reasonable, although I wonder what your\n> motivation was for choosing these particular IsSystemRelationName calls\n> to tweak. It looks like you did more than the minimum needed to allow\n> a DROP TABLE; why these extra ones and not others? (Not that I'm\n> encouraging you to go around and hit every IsSystemRelationName call.\n> If you did, that'll just be more changes that I suspect we'll have to\n> remove again in the long run. I'm just curious why you touched, for\n> example, VACUUM.)\n\nI removed the vacuum part. I added it because it looked particularly\nbad to do REINDEX on temp tables but I have no reason to know that for\nsure.\n\nPatch attached.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 14 Jun 2001 13:25:37 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Removal of temp tables"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> I was wondering that. The old vacuum file detection patch had the sort\n> files going into /pg_sorttemp and files called pid_. Your changes made\n> it pg_tempfile directory and pg_temp file names. I like the older names\n> that made them clear they were _not_ temp tables. Seemed you wanted\n> them to have similar names for reasons I couldn't figure.\n\nI'm not wedded to those names; if you have a better idea, let's hear it.\nI changed it because I didn't like the use of the word \"sort\"; temp\nfiles are not used only for sorts, but for several other things, and so\nI wanted to see them called temp files not sorttemp files. But if you\nwant to change them so that they look even less like the logical names\nof temp relations, that's OK with me.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 13:51:28 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Removal of temp tables "
},
{
"msg_contents": "> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > I was wondering that. The old vacuum file detection patch had the sort\n> > files going into /pg_sorttemp and files called pid_. Your changes made\n> > it pg_tempfile directory and pg_temp file names. I like the older names\n> > that made them clear they were _not_ temp tables. Seemed you wanted\n> > them to have similar names for reasons I couldn't figure.\n> \n> I'm not wedded to those names; if you have a better idea, let's hear it.\n> I changed it because I didn't like the use of the word \"sort\"; temp\n> files are not used only for sorts, but for several other things, and so\n> I wanted to see them called temp files not sorttemp files. But if you\n> want to change them so that they look even less like the logical names\n> of temp relations, that's OK with me.\n\nOK, I will do that. What else do we do with them except sorts? Seems\npid_ was a good file name because they are always based on pid in\nstorage/file/fd.c. The directory could be called simply 'tempfile' with\nno pg_. How is that?\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 14 Jun 2001 13:53:50 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Removal of temp tables"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> What else do we do with them except sorts?\n\nHash joins. Materialize nodes. Not to mention that sorting is used for\nthings that aren't obviously sorts (SELECT count(distinct foo), for\nexample).\n\n> Seems\n> pid_ was a good file name because they are always based on pid in\n> storage/file/fd.c. The directory could be called simply 'tempfile' with\n> no pg_. How is that?\n\nYou had that to begin with, and I changed it because I thought it was a\nbad idea. The directory name and file name should both make perfectly\nclear that the files are temp files belonging to Postgres. For example,\nit would be unsafe to make pg_tempfiles be a symlink pointing to a temp\ndirectory shared with other apps if there was any risk of temp file name\ncollisions. (Not sure you'd do that anyway, because of security issues,\nbut let's not foreclose it with a poor choice of file names.) A purely\nnumeric file name for temp files is a particularly bad idea because it\nlooks too much like our numeric names for table data files. Don't\neliminate a hypothetical confusion factor between relnames and filenames\n(which are never seen in the same context anyway) by introducing one\nbetween filenames and other filenames.\n\nIf you don't like pg_temp here, maybe post_temp? pgsql_temp?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 14:10:45 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Removal of temp tables "
},
{
"msg_contents": "> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > What else do we do with them except sorts?\n> \n> Hash joins. Materialize nodes. Not to mention that sorting is used for\n> things that aren't obviously sorts (SELECT count(distinct foo), for\n> example).\n\nOh, I didn't know that. OK.\n\n> > Seems\n> > pid_ was a good file name because they are always based on pid in\n> > storage/file/fd.c. The directory could be called simply 'tempfile' with\n> > no pg_. How is that?\n> \n> You had that to begin with, and I changed it because I thought it was a\n> bad idea. The directory name and file name should both make perfectly\n> clear that the files are temp files belonging to Postgres. For example,\n> it would be unsafe to make pg_tempfiles be a symlink pointing to a temp\n> directory shared with other apps if there was any risk of temp file name\n> collisions. (Not sure you'd do that anyway, because of security issues,\n> but let's not foreclose it with a poor choice of file names.) A purely\n> numeric file name for temp files is a particularly bad idea because it\n> looks too much like our numeric names for table data files. Don't\n> eliminate a hypothetical confusion factor between relnames and filenames\n> (which are never seen in the same context anyway) by introducing one\n> between filenames and other filenames.\n\nOK, I see, you think it could share a directory with another app. Now I\nsee why you used pg_temp.\n\n> \n> If you don't like pg_temp here, maybe post_temp? pgsql_temp?\n\nOK, pgsql_temp works for me. Everytime I see pg_ I think system table. \nI will use pgsql_temp for directory and file names.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 14 Jun 2001 14:18:29 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Removal of temp tables"
},
{
"msg_contents": "> You had that to begin with, and I changed it because I thought it was a\n> bad idea. The directory name and file name should both make perfectly\n> clear that the files are temp files belonging to Postgres. For example,\n> it would be unsafe to make pg_tempfiles be a symlink pointing to a temp\n> directory shared with other apps if there was any risk of temp file name\n> collisions. (Not sure you'd do that anyway, because of security issues,\n> but let's not foreclose it with a poor choice of file names.) A purely\n> numeric file name for temp files is a particularly bad idea because it\n> looks too much like our numeric names for table data files. Don't\n> eliminate a hypothetical confusion factor between relnames and filenames\n> (which are never seen in the same context anyway) by introducing one\n> between filenames and other filenames.\n> \n> If you don't like pg_temp here, maybe post_temp? pgsql_temp?\n\nWhat if I call the directory tmp or pgsql_tmp and the files\npgsql_pid_#.#?\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 14 Jun 2001 15:46:41 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Removal of temp tables"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n>> If you don't like pg_temp here, maybe post_temp? pgsql_temp?\n\n> What if I call the directory tmp or pgsql_tmp and the files\n> pgsql_pid_#.#?\n\nWhy are you so eager not to call temp files \"temp\"? If you want to\nspell it \"pgsql_tmp\" or \"pg_temporary\" or something different from\n\"pg_temp\", that's fine, but I really think the files ought to clearly\nlabel themselves as temporary. \"pid\" is not a clear label. With a\nname like that, people might even think they are lock files.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 16:15:03 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Removal of temp tables "
},
{
"msg_contents": "> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> >> If you don't like pg_temp here, maybe post_temp? pgsql_temp?\n> \n> > What if I call the directory tmp or pgsql_tmp and the files\n> > pgsql_pid_#.#?\n> \n> Why are you so eager not to call temp files \"temp\"? If you want to\n> spell it \"pgsql_tmp\" or \"pg_temporary\" or something different from\n> \"pg_temp\", that's fine, but I really think the files ought to clearly\n> label themselves as temporary. \"pid\" is not a clear label. With a\n> name like that, people might even think they are lock files.\n\nI wanted to call them pid so people knew what the file number meant.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 14 Jun 2001 16:17:36 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Removal of temp tables"
},
{
"msg_contents": "> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> >> If you don't like pg_temp here, maybe post_temp? pgsql_temp?\n> \n> > What if I call the directory tmp or pgsql_tmp and the files\n> > pgsql_pid_#.#?\n> \n> Why are you so eager not to call temp files \"temp\"? If you want to\n> spell it \"pgsql_tmp\" or \"pg_temporary\" or something different from\n> \"pg_temp\", that's fine, but I really think the files ought to clearly\n> label themselves as temporary. \"pid\" is not a clear label. With a\n> name like that, people might even think they are lock files.\n\nOK, here is the new version with directories and files called pgsql_tmp.\nThat doesn't look like it holds temp tables.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n\nIndex: src/backend/catalog/aclchk.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/catalog/aclchk.c,v\nretrieving revision 1.50\ndiff -c -r1.50 aclchk.c\n*** src/backend/catalog/aclchk.c\t2001/06/09 23:21:54\t1.50\n--- src/backend/catalog/aclchk.c\t2001/06/15 00:01:48\n***************\n*** 32,37 ****\n--- 32,38 ----\n #include \"parser/parse_func.h\"\n #include \"utils/acl.h\"\n #include \"utils/syscache.h\"\n+ #include \"utils/temprel.h\"\n \n static int32 aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode);\n \n***************\n*** 437,443 ****\n \t */\n \tif ((mode & (ACL_INSERT | ACL_UPDATE | ACL_DELETE)) &&\n \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n! \t\tstrncmp(relname, \"pg_temp.\", strlen(\"pg_temp.\")) != 0 &&\n \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n \t{\n #ifdef ACLDEBUG\n--- 438,444 ----\n \t */\n \tif ((mode & (ACL_INSERT | ACL_UPDATE | ACL_DELETE)) &&\n \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n! \t\t!is_temp_relname(relname) &&\n \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n \t{\n #ifdef ACLDEBUG\nIndex: src/backend/catalog/heap.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/catalog/heap.c,v\nretrieving revision 1.167\ndiff -c -r1.167 heap.c\n*** src/backend/catalog/heap.c\t2001/06/12 05:55:49\t1.167\n--- src/backend/catalog/heap.c\t2001/06/15 00:01:49\n***************\n*** 281,288 ****\n \t\t * replace relname of caller with a unique name for a temp\n \t\t * relation\n \t\t */\n! \t\tsnprintf(relname, NAMEDATALEN, \"pg_temp.%d.%u\",\n! \t\t\t\t (int) MyProcPid, uniqueId++);\n \t}\n \n \t/*\n--- 281,288 ----\n \t\t * replace relname of caller with a unique name for a temp\n \t\t * relation\n \t\t */\n! \t\tsnprintf(relname, NAMEDATALEN, \"%s_%d_%u\",\n! \t\t\t\tPG_TEMP_REL_PREFIX, (int) MyProcPid, uniqueId++);\n \t}\n \n \t/*\n***************\n*** 874,910 ****\n }\n \n \n- /* ----------------------------------------------------------------\n- *\t\theap_drop_with_catalog\t- removes all record of named relation from catalogs\n- *\n- *\t\t1)\topen relation, check for existence, etc.\n- *\t\t2)\tremove inheritance information\n- *\t\t3)\tremove indexes\n- *\t\t4)\tremove pg_class tuple\n- *\t\t5)\tremove pg_attribute tuples and related descriptions\n- *\t\t\t\t6)\t\tremove pg_description tuples\n- *\t\t7)\tremove pg_type tuples\n- *\t\t8)\tRemoveConstraints ()\n- *\t\t9)\tunlink relation\n- *\n- * old comments\n- *\t\tExcept for vital relations, removes relation from\n- *\t\trelation catalog, and related attributes from\n- *\t\tattribute catalog (needed?). (Anything else?)\n- *\n- *\t\tget proper relation from relation catalog (if not arg)\n- *\t\tscan attribute catalog deleting attributes of reldesc\n- *\t\t\t\t(necessary?)\n- *\t\tdelete relation from relation catalog\n- *\t\t(How are the tuples of the relation discarded?)\n- *\n- *\t\tXXX Must fix to work with indexes.\n- *\t\tThere may be a better order for doing things.\n- *\t\tProblems with destroying a deleted database--cannot create\n- *\t\ta struct reldesc without having an open file descriptor.\n- * ----------------------------------------------------------------\n- */\n- \n /* --------------------------------\n *\t\tRelationRemoveInheritance\n *\n--- 874,879 ----\n***************\n*** 1334,1343 ****\n \theap_close(pg_type_desc, RowExclusiveLock);\n }\n \n! /* --------------------------------\n! *\t\theap_drop_with_catalog\n *\n! * --------------------------------\n */\n void\n heap_drop_with_catalog(const char *relname,\n--- 1303,1337 ----\n \theap_close(pg_type_desc, RowExclusiveLock);\n }\n \n! /* ----------------------------------------------------------------\n! *\t\theap_drop_with_catalog\t- removes all record of named relation from catalogs\n *\n! *\t\t1)\topen relation, check for existence, etc.\n! *\t\t2)\tremove inheritance information\n! *\t\t3)\tremove indexes\n! *\t\t4)\tremove pg_class tuple\n! *\t\t5)\tremove pg_attribute tuples and related descriptions\n! *\t\t\t\t6)\t\tremove pg_description tuples\n! *\t\t7)\tremove pg_type tuples\n! *\t\t8)\tRemoveConstraints ()\n! *\t\t9)\tunlink relation\n! *\n! * old comments\n! *\t\tExcept for vital relations, removes relation from\n! *\t\trelation catalog, and related attributes from\n! *\t\tattribute catalog (needed?). (Anything else?)\n! *\n! *\t\tget proper relation from relation catalog (if not arg)\n! *\t\tscan attribute catalog deleting attributes of reldesc\n! *\t\t\t\t(necessary?)\n! *\t\tdelete relation from relation catalog\n! *\t\t(How are the tuples of the relation discarded?)\n! *\n! *\t\tXXX Must fix to work with indexes.\n! *\t\tThere may be a better order for doing things.\n! *\t\tProblems with destroying a deleted database--cannot create\n! *\t\ta struct reldesc without having an open file descriptor.\n! * ----------------------------------------------------------------\n */\n void\n heap_drop_with_catalog(const char *relname,\n***************\n*** 1360,1367 ****\n \t * prevent deletion of system relations\n \t */\n \t/* allow temp of pg_class? Guess so. */\n! \tif (!istemp && !allow_system_table_mods &&\n! \t\tIsSystemRelationName(RelationGetRelationName(rel)))\n \t\telog(ERROR, \"System relation \\\"%s\\\" may not be dropped\",\n \t\t\t RelationGetRelationName(rel));\n \n--- 1354,1363 ----\n \t * prevent deletion of system relations\n \t */\n \t/* allow temp of pg_class? Guess so. */\n! \tif (!istemp &&\n! \t\t!allow_system_table_mods &&\n! \t\tIsSystemRelationName(RelationGetRelationName(rel)) &&\n! \t\t!is_temp_relname(RelationGetRelationName(rel)))\n \t\telog(ERROR, \"System relation \\\"%s\\\" may not be dropped\",\n \t\t\t RelationGetRelationName(rel));\n \nIndex: src/backend/storage/file/fd.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/storage/file/fd.c,v\nretrieving revision 1.81\ndiff -c -r1.81 fd.c\n*** src/backend/storage/file/fd.c\t2001/06/11 04:12:29\t1.81\n--- src/backend/storage/file/fd.c\t2001/06/15 00:01:52\n***************\n*** 54,61 ****\n \n \n /* Filename components for OpenTemporaryFile */\n! #define PG_TEMP_FILES_DIR \"pg_tempfiles\"\n! #define PG_TEMP_FILE_PREFIX \"pg_temp\"\n \n \n /*\n--- 54,61 ----\n \n \n /* Filename components for OpenTemporaryFile */\n! #define PG_TEMP_FILES_DIR \"pgsql_tmp\"\n! #define PG_TEMP_FILE_PREFIX \"pgsql_tmp\"\n \n \n /*\nIndex: src/backend/tcop/utility.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/tcop/utility.c,v\nretrieving revision 1.113\ndiff -c -r1.113 utility.c\n*** src/backend/tcop/utility.c\t2001/06/09 23:21:54\t1.113\n--- src/backend/tcop/utility.c\t2001/06/15 00:01:52\n***************\n*** 46,51 ****\n--- 46,52 ----\n #include \"utils/acl.h\"\n #include \"utils/ps_status.h\"\n #include \"utils/syscache.h\"\n+ #include \"utils/temprel.h\"\n #include \"access/xlog.h\"\n \n /*\n***************\n*** 120,126 ****\n \t\telog(ERROR, \"you do not own %s \\\"%s\\\"\",\n \t\t\t rentry->name, name);\n \n! \tif (!allowSystemTableMods && IsSystemRelationName(name))\n \t\telog(ERROR, \"%s \\\"%s\\\" is a system %s\",\n \t\t\t rentry->name, name, rentry->name);\n \n--- 121,128 ----\n \t\telog(ERROR, \"you do not own %s \\\"%s\\\"\",\n \t\t\t rentry->name, name);\n \n! \tif (!allowSystemTableMods && IsSystemRelationName(name) &&\n! \t\t!is_temp_relname(name))\n \t\telog(ERROR, \"%s \\\"%s\\\" is a system %s\",\n \t\t\t rentry->name, name, rentry->name);\n \nIndex: src/include/utils/temprel.h\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/include/utils/temprel.h,v\nretrieving revision 1.15\ndiff -c -r1.15 temprel.h\n*** src/include/utils/temprel.h\t2001/03/22 04:01:14\t1.15\n--- src/include/utils/temprel.h\t2001/06/15 00:01:53\n***************\n*** 16,21 ****\n--- 16,26 ----\n \n #include \"access/htup.h\"\n \n+ #define PG_TEMP_REL_PREFIX \"pg_temp\"\n+ \n+ #define is_temp_relname(relname) \\\n+ \t\t(strncmp(relname, PG_TEMP_REL_PREFIX, strlen(PG_TEMP_REL_PREFIX)) == 0)\n+ \n extern void create_temp_relation(const char *relname,\n \t\t\t\t\t HeapTuple pg_class_tuple);\n extern void remove_temp_rel_by_relid(Oid relid);",
"msg_date": "Thu, 14 Jun 2001 20:06:27 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Re: Removal of temp tables"
}
] |
[
{
"msg_contents": "Hello Robert (Bob?),\n\nThank you for your answer. I will surely make a wide use the COALESCE \nfunction in my scripts.\nI also noticed the same behaviour in PL/pgSQL:\n\nCREATE FUNCTION \"xxxxxxxxxxxxxx\" (text, text)\nRETURNS text\nAS 'BEGIN\n\nRETURN $1 || ' ' || $2;\nEND;\n'\nLANGUAGE 'plpgsql'\n\nCorrect me if I am wrong:\n\nIt seems that a NULL value is not passed to the function ...\n... or is it that a NULL value is not taken into account by PL/pgSQL.\n\nThank you all for the COALESCE trick.\n\nGreetings from Jean-Michel POURE, Paris, France\npgAdmin development team\n\n",
"msg_date": "Thu, 14 Jun 2001 11:34:03 +0200",
"msg_from": "Jean-Michel POURE <jm.poure@freesurf.fr>",
"msg_from_op": true,
"msg_subject": "Re: SELECT Field1 || Field2 FROM Table"
},
{
"msg_contents": "plpgsql is a bit tricky.\n\nIn 7.0, if an argument to a function was null, function did not execute at\nall, and the result was assumed null.\n\nIn 7.1, you can control this behaviour by declaring function as 'strict'\nor 'nostrict'. ex: create function(...) as '...' with (strict) gets old\nbehaviour, nostrict will do what you want.\n\nOn Thu, 14 Jun 2001, Jean-Michel POURE wrote:\n\n> Hello Robert (Bob?),\n> \n> Thank you for your answer. I will surely make a wide use the COALESCE \n> function in my scripts.\n> I also noticed the same behaviour in PL/pgSQL:\n> \n> CREATE FUNCTION \"xxxxxxxxxxxxxx\" (text, text)\n> RETURNS text\n> AS 'BEGIN\n> \n> RETURN $1 || ' ' || $2;\n> END;\n> '\n> LANGUAGE 'plpgsql'\n> \n> Correct me if I am wrong:\n> \n> It seems that a NULL value is not passed to the function ...\n> ... or is it that a NULL value is not taken into account by PL/pgSQL.\n> \n> Thank you all for the COALESCE trick.\n> \n> Greetings from Jean-Michel POURE, Paris, France\n> pgAdmin development team\n> \n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 4: Don't 'kill -9' the postmaster\n> \n> \n\n",
"msg_date": "Thu, 14 Jun 2001 10:39:32 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": false,
"msg_subject": "Re: Re: SELECT Field1 || Field2 FROM Table"
}
] |
[
{
"msg_contents": "I know you guys want to focus on 7.1 or 7.2, and yes I am trying to move to\n7.1, but it won't happen overnight.\n\nWe have a serious problem with 7.0.3 and data corruption. We have a program\nthat compares records in two tables. It creates a set of SQL scripts that\neither update, insert, or delelte records based on the comparison of the two\ntables. These scripts are then run against multiple database servers, which are\nslaves.\n\nSome of these scripts get pretty big, and take a while to run (10s of thousands\nof records are affected). After we run the scripts the database seems fine.\nThen we run two SQL scripts which create some summary tables. After we run the\nscripts, it looks like the database is corrupt.\n\nOddly enough, if we run vacuum prior to running these scripts, the database\ndoes not seem to get corrupted. \n\nAll I really need to know is if anyone has seen anything in the code which\nwould explain this, and if so, do you know if is fixed in 7.1.x?\n\nThe scripts look like:\n<<<<<<<<<<<<< stattbl.sql >>>\n\ndrop table musicstat ;\n \n-- This crap is to find oldest new release\n \ncreate temp table lastnr ( name varchar, value date );\ninsert into lastnr select 'LASTNRUPDATE' as \"name\", min(\nto_date(released,'MM/DD/YYYY')) as \"value\" from new_ztitles where released !=\n'n/a' ;\nselect name, released as \"value\" into musicstat from new_ztitles, lastnr where\nto_date(released, 'MM/DD/YYYY') = lastnr.value limit 1;\n \n-- Count number of songs\ninsert into musicstat select 'tracks' as \"name\", count(*) as \"value\" from\nzsong;\n \n-- Count number of albums\ninsert into musicstat select 'albums' as \"name\", count(*) as \"value\" from\nztitles;\n \n-- Count number of artists\ninsert into musicstat select 'artists' as \"name\", count(*) as \"value\" from\ndartists;\n \ninsert into musicstat select 'dotclick_albums' as \"name\", count(*) as \"value\"\nfrom dotclicktitle ;\ninsert into musicstat select 'dotclick_songs' as \"name\", count(*) as \"value\"\nfrom dotclicksong ;\ninsert into musicstat select 'deleted songs' as \"name\", count(*) as \"value\"\nfrom old_zsong ;\ninsert into musicstat select 'deleted titles' as \"name\", count(*) as \"value\"\nfrom old_ztitles ;\ninsert into musicstat select 'new titles' as \"name\", count(*) as \"value\" from\nztitles where acd = 'A';\n \ninsert into musicstat select 'new songs' as \"name\", count(*) as \"value\" from\nzsong, ztitles\n where ztitles.acd = 'A' and zsong.muzenbr = ztitles.muzenbr;\n \ninsert into musicstat select 'updated albums' as \"name\", count( distinct(\nmuzenbr)) as \"value\" from zsong\n where acd = 'U' ;\n \ninsert into musicstat select 'new artists' as \"name\", count(*) as \"value\" from\ntartists, dartists\n where tartists.artist = dartists.artist ;\n \n \ninsert into musicstat (name,value) values('CONCERTGO' , '1' );\n\n<<<<<<<<< end >>>>>>>>>>>>>>>>>\n<<<<<<<< newrel >>>>>>>>>>>>>>\ndrop table new_ztitles ;\ndrop table new_releases ;\n \ncreate table new_ztitles as select * from ztitles T\nwhere T.origrel > (date_part('year','now'::abstime)-1)\nand to_date(T.released, 'MM/DD/YYYY') > ('now'::abstime - '30 days'::reltime)\nand T.datasrc = 1;\n \ncreate index newztitles_muzenbr\n on new_ztitles (muzenbr);\n \ncreate table new_releases as select T.origrel, T.released, T.title, T.muzenbr,\nT.artistid,\nT.performer2 as artist, S.song, S.trackid\nfrom new_ztitles T, zsong S where S.muzenbr = T.muzenbr\nand S.datasrc = 1\norder by performer2;\n \n-- new releases indexes\ncreate index new_rel_artist_lower\n on new_releases (varchar_lower(artist) );\ncreate index new_rel_artist_meta\n on new_releases (metatext(artist) );\ncreate index new_rel_artist_strip\n on new_releases (strip(artist) );\ncreate index new_rel_title_lower\n on new_releases (varchar_lower(title) );\ncreate index new_rel_title_meta\n on new_releases (metatext(title) );\ncreate index new_rel_title_strip\n on new_releases (strip(title) );\ncreate index new_rel_song_lower\n on new_releases (varchar_lower(song) );\ncreate index new_rel_song_meta\n on new_releases (metatext(song) );\ncreate index new_rel_song_strip\n on new_releases (strip(song) );\n \n-- new_ztitles indexes\ncreate index newztitles_artistid\n on new_ztitles (artistid);\n \ncreate index newztitles_cat3\n on new_ztitles(cat3);\n<<<<<<<<end>>>>>>>>>>>>>\n",
"msg_date": "Thu, 14 Jun 2001 08:47:15 -0400",
"msg_from": "mlw <markw@mohawksoft.com>",
"msg_from_op": true,
"msg_subject": "7.0.3 database corruption"
},
{
"msg_contents": "mlw wrote:\n> \n> I know you guys want to focus on 7.1 or 7.2, and yes I am trying to move to\n> 7.1, but it won't happen overnight.\n> \n> We have a serious problem with 7.0.3 and data corruption. We have a program\n> that compares records in two tables. It creates a set of SQL scripts that\n> either update, insert, or delelte records based on the comparison of the two\n> tables. These scripts are then run against multiple database servers, which are\n> slaves.\n> \n> Some of these scripts get pretty big, and take a while to run (10s of thousands\n> of records are affected). After we run the scripts the database seems fine.\n> Then we run two SQL scripts which create some summary tables. After we run the\n> scripts, it looks like the database is corrupt.\n> \n> Oddly enough, if we run vacuum prior to running these scripts, the database\n> does not seem to get corrupted.\n> \n> All I really need to know is if anyone has seen anything in the code which\n> would explain this, and if so, do you know if is fixed in 7.1.x?\n\n\nThere certainly are bugs in 7.0.3 - I can describe at least two:\n\n1. an index on varchar(8) (an user name) gets corrupted so that some\nnames are \n no longer found when searching by index - they are still there when\ndoing an\n unqualified select and come back after reindex for the qualified one.\n\n1a. \"FATAL: bits falling of the end of world\" or something like it in\nlogs and \n then broken db connection after that\n\n2. Some kind of stuck locks - a single backend stuck in \"INSERT waiting\"\nor \n \"DELETE waiting\" state. This happens sporadically and requires a db\nsystem \n restart to go away\n\n\n-------------\nHannu\n",
"msg_date": "Thu, 14 Jun 2001 15:28:54 +0200",
"msg_from": "Hannu Krosing <hannu@tm.ee>",
"msg_from_op": false,
"msg_subject": "Re: 7.0.3 database corruption"
},
{
"msg_contents": "> mlw wrote:\n>> After we run the\n>> scripts, it looks like the database is corrupt.\n\nIt's impossible to say anything useful with such an undescriptive\ndescription of the problem.\n\nHannu Krosing <hannu@tm.ee> writes:\n> There certainly are bugs in 7.0.3 - I can describe at least two:\n\nI would really like to see a reproducible example of index corruption\nin 7.0.*. We've heard such reports often enough to know the problem\nis real, but without a test case in hand it's difficult to do much about\nit.\n\n> 2. Some kind of stuck locks - a single backend stuck in \"INSERT waiting\"\n\n7.0.*'s deadlock detection algorithm is known to have some holes, but\ndeadlock couldn't be the explanation for just a single stuck backend.\nAgain, any chance of looking at an example?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 10:01:15 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: 7.0.3 database corruption "
},
{
"msg_contents": "Tom Lane wrote:\n> \n> > mlw wrote:\n> >> After we run the\n> >> scripts, it looks like the database is corrupt.\n> \n> It's impossible to say anything useful with such an undescriptive\n> description of the problem.\n> \n> Hannu Krosing <hannu@tm.ee> writes:\n> > There certainly are bugs in 7.0.3 - I can describe at least two:\n> \n> I would really like to see a reproducible example of index corruption\n> in 7.0.*. We've heard such reports often enough to know the problem\n> is real, but without a test case in hand it's difficult to do much about\n> it.\n\nI know ;( Unfortunately this has happened only a few times on some quite \nbusy servers receiving a workload of quite varied queries.\n\n> > 2. Some kind of stuck locks - a single backend stuck in \"INSERT waiting\"\n> \n> 7.0.*'s deadlock detection algorithm is known to have some holes, but\n> deadlock couldn't be the explanation for just a single stuck backend.\n\nthat's what \"ps ax| grep post\" output looks like in my logs\n\nSun Jun 10 06:31:00 EET 2001\n 828 ? S 0:02 /usr/bin/postmaster -i -o -F\n26652 ? S 5:20 /usr/bin/postgres localhost gamer casino idle\n30082 ? S 0:20 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n30084 ? S 1:26 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31565 ? S 0:43 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31595 ? S 0:19 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31596 ? S 0:21 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31597 ? S 0:31 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31598 ? S 1:39 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31600 ? S 0:17 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31608 ? S 0:24 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31612 ? S 0:24 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n32080 ? S 0:43 /usr/bin/postgres localhost gamer casino\nUPDATE waiti\n32706 ? S 0:10 /usr/bin/postgres localhost gamer casino idle\n 302 ? S 0:00 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n 361 ? S 0:00 sh -c date;ps ax|grep post\n 364 ? S 0:00 grep post\n\nCHECKING WAITING PIDS: ['32080']\nSun Jun 10 06:31:10 EET 2001\n 828 ? S 0:02 /usr/bin/postmaster -i -o -F\n26652 ? S 5:20 /usr/bin/postgres localhost gamer casino idle\n30082 ? S 0:20 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n30084 ? S 1:26 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31565 ? S 0:43 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31595 ? S 0:19 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31596 ? S 0:21 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31597 ? S 0:31 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31598 ? S 1:39 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31600 ? S 0:17 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31608 ? S 0:24 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n31612 ? S 0:24 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n32080 ? S 0:43 /usr/bin/postgres localhost gamer casino\nUPDATE waiti\n32706 ? S 0:10 /usr/bin/postgres localhost gamer casino idle\n 302 ? S 0:00 /usr/bin/postgres 127.0.0.1 nobody casino\nidle\n 365 ? S 0:00 sh -c date;ps ax|grep post\n 368 ? S 0:00 grep post\n\nPROCESS 32080 STILL WAITING, RESTART TIME\n\n\n> Again, any chance of looking at an example?\n\nI could send you tails of postgres logfiles that are rotated on\ndetecting \nthe INSERT/UPDATE wait condition that does not go away in 10 sec. \nHow long logfiles (time) would be enough ?\n\nThere seems to be no general pattern that leads to it though ;(\n\n---------------\nHannu\n",
"msg_date": "Thu, 14 Jun 2001 16:34:48 +0200",
"msg_from": "Hannu Krosing <hannu@tm.ee>",
"msg_from_op": false,
"msg_subject": "Re: 7.0.3 database corruption"
},
{
"msg_contents": "Hannu Krosing <hannu@tm.ee> writes:\n> I could send you tails of postgres logfiles that are rotated on\n> detecting \n> the INSERT/UPDATE wait condition that does not go away in 10 sec. \n> How long logfiles (time) would be enough ?\n\nDo the logs show the queries being executed? The queries forming\nthe current transaction of the stuck backend, and all the transactions\nthat have occurred since that transaction started, would be useful\nto look at.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 10:37:57 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: 7.0.3 database corruption "
}
] |
[
{
"msg_contents": "I've a minor issue with building 7.1.[12] and I was wondering if anyone's\naddressed it yet (that anyone knows of...)\n\n> The problem at hand is that you must be at the top of the source\n> tree to build 7.1.1 and 7.1.2 and you cannot do it from a\n> \"staging\" directory separate from it. This works for MOST of\n> the package but not for a small bit of it.\n> \n> Example.\n> /home/pgsql> ls\n> postgresql-7.1.2.tar.gz\n> postgresql-7.1.2/\n> Stage/\n> \n> To build the code, you must be in postgresql-7.1.2 and you\n> cannot be in Stage.\n\nThanks for all your time.\n",
"msg_date": "Thu, 14 Jun 2001 09:18:40 -0400",
"msg_from": "Michael C Tiernan <mtiernan@genuity.com>",
"msg_from_op": true,
"msg_subject": "Building 7.1.2 issue."
}
] |
[
{
"msg_contents": "Attached please find a patch to cast (convert) the MONEY type to any one\nof the following types:\n\n INT2, INT4, INT8, FLOAT4, FLOAT8\n\nThe patch is against PostgreSQL v7.0.3 and creates files in a new\ndirectory named contrib/money/. I'm pretty sure it won't compile\nagainst v7.1, but it won't be too hard to fix. (I'll do this when I\nupgrade to v7.1 at work, which will hopefully happen sooner rather than\nlater.)\n\nI wrote this because I needed to convert MONEY to a standard decimal\nvalue and didn't want to do it on the client in Perl, and I didn't want\nto use a plpgsql function that used string parsing. Both solutions were\ntoo inefficient for my needs.\n\n http://postgresql.bteg.net/mhonarc/pgsql-general/2000-01/msg00446.html\n\nI wouldn't have used the MONEY type in the first place if I had known it\nwas deprecated, but I didn't see this notice in the v7.0.3 documentation\ntwo to three months ago when designing the database. Oh well, my loss\nis your gain. :^)\n\nI've attempted to set the Reply-To field to pgsql-hackers, but please\ncopy me on any posts as well.\n\nComments welcome!\n\nDave",
"msg_date": "Thu, 14 Jun 2001 09:31:06 -0500",
"msg_from": "\"David D. Kilzer\" <ddkilzer@lubricants-oil.com>",
"msg_from_op": true,
"msg_subject": "[PATCH] Contrib C source for casting MONEY to INT[248] and FLOAT[48]"
},
{
"msg_contents": "\"David D. Kilzer\" <ddkilzer@lubricants-oil.com> writes:\n> Attached please find a patch to cast (convert) the MONEY type to any one\n> of the following types:\n> INT2, INT4, INT8, FLOAT4, FLOAT8\n\nHmm. It strikes me as a rather bad idea to introduce implicit casting\nof MONEY to all these other types --- I suspect that's going to create\na bunch of parsing ambiguities.\n\n> I wrote this because I needed to convert MONEY to a standard decimal\n> value and didn't want to do it on the client in Perl, and I didn't want\n> to use a plpgsql function that used string parsing.\n\nSeems like a better answer is to use NUMERIC instead of MONEY in the\nfirst place...\n\n\t\t\tregards, tom lane\n",
"msg_date": "Tue, 19 Jun 2001 10:20:18 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCHES] [PATCH] Contrib C source for casting MONEY to INT[248]\n\tand FLOAT[48]"
},
{
"msg_contents": "On Tue, Jun 19, 2001 at 10:20:18AM -0400, Tom Lane wrote:\n\n> \"David D. Kilzer\" <ddkilzer@lubricants-oil.com> writes:\n> > Attached please find a patch to cast (convert) the MONEY type to any one\n> > of the following types:\n> > INT2, INT4, INT8, FLOAT4, FLOAT8\n> \n> Hmm. It strikes me as a rather bad idea to introduce implicit casting\n> of MONEY to all these other types --- I suspect that's going to create\n> a bunch of parsing ambiguities.\n\nWell, that's why the patch puts the code under contrib/. I meant this\nto be optional code that could be added to PostgreSQL if people needed\nthe functionality, i.e., for transition work. I'm sorry if that wasn't\nclear in my original post.\n\nShould I have not submitted this code to the pgsql-patches list?\n\n> > I wrote this because I needed to convert MONEY to a standard decimal\n> > value and didn't want to do it on the client in Perl, and I didn't want\n> > to use a plpgsql function that used string parsing.\n> \n> Seems like a better answer is to use NUMERIC instead of MONEY in the\n> first place...\n\nThe reason for this (in my case) was covered in the next paragraph:\n\n> > I wouldn't have used the MONEY type in the first place if I had known it\n> > was deprecated, but I didn't see this notice in the v7.0.3 documentation\n> > two to three months ago when designing the database.\n\nSo for those of us who accidentally used the MONEY type (or had legacy\ntables that used the MONEY type), these functions (especially the\nFLOAT8 type conversion) are extremely useful for transition work.\n\nI don't really care if the code is included with future PostgreSQL\nreleases or not. I just wanted to save other people some time if or\nwhen they decide to transition off the MONEY type.\n\nDave\n",
"msg_date": "Tue, 19 Jun 2001 10:03:55 -0500",
"msg_from": "\"David D. Kilzer\" <ddkilzer@lubricants-oil.com>",
"msg_from_op": true,
"msg_subject": "Re: [PATCH] Contrib C source for casting MONEY to INT[248] and\n\tFLOAT[48]"
},
{
"msg_contents": "\nTom outlined the problems with this patch. We want to remove Money and\nhave it be part of Numeric.\n\n> Attached please find a patch to cast (convert) the MONEY type to any one\n> of the following types:\n> \n> INT2, INT4, INT8, FLOAT4, FLOAT8\n> \n> The patch is against PostgreSQL v7.0.3 and creates files in a new\n> directory named contrib/money/. I'm pretty sure it won't compile\n> against v7.1, but it won't be too hard to fix. (I'll do this when I\n> upgrade to v7.1 at work, which will hopefully happen sooner rather than\n> later.)\n> \n> I wrote this because I needed to convert MONEY to a standard decimal\n> value and didn't want to do it on the client in Perl, and I didn't want\n> to use a plpgsql function that used string parsing. Both solutions were\n> too inefficient for my needs.\n> \n> http://postgresql.bteg.net/mhonarc/pgsql-general/2000-01/msg00446.html\n> \n> I wouldn't have used the MONEY type in the first place if I had known it\n> was deprecated, but I didn't see this notice in the v7.0.3 documentation\n> two to three months ago when designing the database. Oh well, my loss\n> is your gain. :^)\n> \n> I've attempted to set the Reply-To field to pgsql-hackers, but please\n> copy me on any posts as well.\n> \n> Comments welcome!\n> \n> Dave\n\n[ Attachment, skipping... ]\n\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 2: you can get off all lists at once with the unregister command\n> (send \"unregister YourEmailAddressHere\" to majordomo@postgresql.org)\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Tue, 19 Jun 2001 20:00:51 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCHES] [PATCH] Contrib C source for casting MONEY to INT[248]\n\tand FLOAT[48]"
},
{
"msg_contents": "NOTE 1: Do not use the MONEY type in the first place as it is deprecated!\n\nNOTE 2: These MONEY casting routines are provided as a convenience for\nthose wishing to convert tables that use the MONEY type to a better data\ntype like FLOAT8 or NUMERIC(16,2), for example. Also, because these\nroutines are written in C, they may help provide a smooth transition\nfrom the MONEY data type to another type with only a small (or\nnegligible) performance hit.\n\nNOTE 3: These routines will not convert directly from MONEY to NUMERIC,\nbut you can accomplish the same goal by casting to FLOAT8 first. Here\nis a contrived example:\n\n template1> select 3.14::money::float8::numeric(16,2);\n\n\nNot sure if anyone found these MONEY conversion routines useful, but I\nfound a bug in them. If you tried to cast a NULL value of type MONEY,\nan error would be produced (instead of returning NULL, which is the\ncorrect thing to do).\n\nApply the attached patch in the contrib/money/ directory after first\napplying the initial patch:\n\n # patch -p0 < money.diff\n\nN.B. There must be some black magic going on in the bowels of \nPostgreSQL-7.0.x for the int2 and int4 routines, as they return values\ninstead of pointers to values, but the database correctly guesses between\na NULL return value and a 0 (zero) return value, which are identical as\nfar as a C compiler is concerned. Guess that's one reason for the change\nto the 'Datum' return type in PostgreSQL-7.1.x!\n\nDave\n\n\nOn Thu, Jun 14, 2001 at 09:31:06AM -0500, David D. Kilzer wrote:\n\n> Attached please find a patch to cast (convert) the MONEY type to any one\n> of the following types:\n> \n> INT2, INT4, INT8, FLOAT4, FLOAT8\n> \n> The patch is against PostgreSQL v7.0.3 and creates files in a new\n> directory named contrib/money/. I'm pretty sure it won't compile\n> against v7.1, but it won't be too hard to fix. (I'll do this when I\n> upgrade to v7.1 at work, which will hopefully happen sooner rather than\n> later.)\n> \n> I wrote this because I needed to convert MONEY to a standard decimal\n> value and didn't want to do it on the client in Perl, and I didn't want\n> to use a plpgsql function that used string parsing. Both solutions were\n> too inefficient for my needs.\n> \n> http://postgresql.bteg.net/mhonarc/pgsql-general/2000-01/msg00446.html\n> \n> I wouldn't have used the MONEY type in the first place if I had known it\n> was deprecated, but I didn't see this notice in the v7.0.3 documentation\n> two to three months ago when designing the database. Oh well, my loss\n> is your gain. :^)\n> \n> I've attempted to set the Reply-To field to pgsql-hackers, but please\n> copy me on any posts as well.\n> \n> Comments welcome!\n> \n> Dave",
"msg_date": "Wed, 27 Jun 2001 15:44:49 -0500",
"msg_from": "\"David D. Kilzer\" <ddkilzer@lubricants-oil.com>",
"msg_from_op": true,
"msg_subject": "Re: [PATCH] Contrib C source for casting MONEY to INT[248] and\n\tFLOAT[48]"
}
] |
[
{
"msg_contents": "If we did this the straightforward way (exchange authentication packets\nafter fork()) then rogue clients could connect, start a backend, twiddle\nthumbs, never finish the authentication exchange, meanwhile having filled\nup the limit on the number of connections. Somehow the backends would\nhave to report back to the postmaster that the authentication passed.\nBut then an attacker could easily fill up the system's process table with\nthis approach. If you in turn put a cap on that to save your system at\nlarge, you're back to having DoS'ed your database server.\n\nThen you would have to put a timeout on the completion of the\nauthentication sequence. This would be a fairly tricky thing to configure\ngiven the various choices of ways to authenticate, including interactive\nones.\n\nISTM that there is some merit in having authentication happen *before*\ndoing much else, especially allocating per-connection resources.\n\nComments?\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Thu, 14 Jun 2001 18:31:54 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": true,
"msg_subject": "Doing authentication in backend"
},
{
"msg_contents": "Peter Eisentraut <peter_e@gmx.net> writes:\n> If we did this the straightforward way (exchange authentication packets\n> after fork()) then rogue clients could connect, start a backend, twiddle\n> thumbs, never finish the authentication exchange, meanwhile having filled\n> up the limit on the number of connections.\n\nTrue, but don't fool yourself that a similar DOS attack is not possible\nnow. The resource limit that an attacker can hit now is the maximum\nnumber of open file descriptors for the single postmaster process, which\nmay be quite a lot lower than the maximum number of process table\nentries, depending on how your system is configured.\n\nAlso note that we could easily fix things so that the max-number-of-\nbackends limit is not checked until we have passed the authentication\nprocedure. A PM child that's still busy authenticating doesn't have\nto count.\n\n\n> ISTM that there is some merit in having authentication happen *before*\n> doing much else, especially allocating per-connection resources.\n\nSure, which is why the postmaster is written the way it is. But you\nhave to be willing to code the postmaster in a way that prevents it from\nblocking on behalf of one client. We don't have that now for IDENT,\nwe are about to not have it for PAM, and I don't see a lot of enthusiasm\nout there for adhering to those coding rules with the rigidity needed to\nrealize the theoretical benefit.\n\nAnother problem with the present setup is total cost of servicing each\nconnection request. We've seen several complaints about connection-\nrefused problems under heavy load, occurring because the single\npostmaster process simply can't service the requests quickly enough to\nkeep its accept() queue from overflowing.\n\nForking the postmaster (without an exec) is a relatively cheap\noperation, since the PM has only a small amount of writable data and\nvery few open files. I believe forking before authenticating would\nimprove the accept-queue-overflow problem by reducing the amount of\nwork done before the PM can accept() another connection request.\n\nMoreover, if we went over to fork-before-authenticate, we could rip out\nall the poor man's multitasking code that's in the postmaster. That\nwould make the PM simpler, more understandable, and ultimately more\nreliable.\n\nSo on the whole I think changing would be a win.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 13:42:26 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Doing authentication in backend "
},
{
"msg_contents": "Tom Lane writes:\n\n> Also note that we could easily fix things so that the max-number-of-\n> backends limit is not checked until we have passed the authentication\n> procedure. A PM child that's still busy authenticating doesn't have\n> to count.\n\nHow does the postmaster know? And if the postmaster does get to know,\nwhat does it do with children it has \"accidentally\" allowed in excess?\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Thu, 14 Jun 2001 22:34:08 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": true,
"msg_subject": "Re: Doing authentication in backend "
},
{
"msg_contents": "Peter Eisentraut <peter_e@gmx.net> writes:\n> Tom Lane writes:\n>> Also note that we could easily fix things so that the max-number-of-\n>> backends limit is not checked until we have passed the authentication\n>> procedure. A PM child that's still busy authenticating doesn't have\n>> to count.\n\n> How does the postmaster know? And if the postmaster does get to know,\n> what does it do with children it has \"accidentally\" allowed in excess?\n\nThe postmaster doesn't have to know, nor should it be in the business of\nenforcing the MaxBackends limit. It should just spawn off children\n(though maybe we should put a limit on total children, somewhat higher\nthan MaxBackends, as a crude form of preventing runaway resource usage\nunder a DOS attack).\n\nA spawned child will first proceed with the authorization cycle; if it\nfails, it just exits. If it succeeds, it will then try to become a\nbackend. When it tries to insert an entry into the PROC array, if\nthere's not an available slot then you lose (send \"too many clients\"\nfailure message to client, and exit). We might have to reorganize the\ncode a little bit so that this exit happens cleanly before anything else\nis done to shared memory, but it's surely doable.\n\nThe PM itself has no real need to distinguish children that are active\nbackends from those that are still doing authentication, AFAICS.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 16:49:35 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Doing authentication in backend "
},
{
"msg_contents": "On Thu, Jun 14, 2001 at 01:42:26PM -0400, Tom Lane wrote:\n> Also note that we could easily fix things so that the max-number-of-\n> backends limit is not checked until we have passed the authentication\n> procedure. A PM child that's still busy authenticating doesn't have\n> to count.\n\nAnd impose a very short timeout on authentication.\n\n> Another problem with the present setup is total cost of servicing each\n> connection request. We've seen several complaints about connection-\n> refused problems under heavy load, occurring because the single\n> postmaster process simply can't service the requests quickly enough to\n> keep its accept() queue from overflowing.\n\nThis last could also be addressed (along with Solaris's Unix Sockets \nproblem!) by changing the second argument to listen(2) from the current \nSOMAXCONN -- which is 5 in Solaris 2.7 -- to 127. See the six-page\ndiscussion in Stevens UNPv1 beginning at page 93.\n\nThis is not to say we shouldn't fork before authentication, for\nthe above and other reasons, but the fix to listen(2)'s argument \nshould happen anyway.\n\nNathan Myers\nncm@zembu.com\n",
"msg_date": "Fri, 15 Jun 2001 16:51:36 -0700",
"msg_from": "ncm@zembu.com (Nathan Myers)",
"msg_from_op": false,
"msg_subject": "Re: Doing authentication in backend"
},
{
"msg_contents": "ncm@zembu.com (Nathan Myers) writes:\n> On Thu, Jun 14, 2001 at 01:42:26PM -0400, Tom Lane wrote:\n>> Also note that we could easily fix things so that the max-number-of-\n>> backends limit is not checked until we have passed the authentication\n>> procedure. A PM child that's still busy authenticating doesn't have\n>> to count.\n\n> And impose a very short timeout on authentication.\n\nYes. There's no time limit at present, but it will be easy to add one\nafter we change to fork-before-authenticate (since each PM child can\nhave its own itimer).\n\n> This last could also be addressed (along with Solaris's Unix Sockets \n> problem!) by changing the second argument to listen(2) from the current \n> SOMAXCONN -- which is 5 in Solaris 2.7 -- to 127. See the six-page\n> discussion in Stevens UNPv1 beginning at page 93.\n\nUnfortunately I only have Stevens' first edition, and it doesn't seem\nto have any such advice in it. Why is it a good idea to ignore the\nplatform's specification of SOMAXCONN? Seems like on non-broken\nplatforms, that would do more harm than good.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sat, 16 Jun 2001 13:02:15 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Doing authentication in backend "
},
{
"msg_contents": "On Sat, Jun 16, 2001 at 01:02:15PM -0400, Tom Lane wrote:\n> ncm@zembu.com (Nathan Myers) writes:\n> > On Thu, Jun 14, 2001 at 01:42:26PM -0400, Tom Lane wrote:\n> > This last could also be addressed (along with Solaris's Unix Sockets \n> > problem!) by changing the second argument to listen(2) from the current \n> > SOMAXCONN -- which is 5 in Solaris 2.7 -- to 127. See the six-page\n> > discussion in Stevens UNPv1 beginning at page 93.\n> \n> Unfortunately I only have Stevens' first edition, and it doesn't seem\n> to have any such advice in it. Why is it a good idea to ignore the\n> platform's specification of SOMAXCONN? Seems like on non-broken\n> platforms, that would do more harm than good.\n\nThe second edition is easily worth the price, for any number of reasons.\n\nDo you want me to type in all six pages? (I'll fax you a copy if you\nask.) He includes graphs of sample daemon transaction rates for \ndifferent settings of that argument, from SOMAXCONN on up, as well \nas analyses of what is going on, including diagrams.\n\nThe short description is that half-completed connections occupy \na sort of foyer or vestibule (my terms). The second argument to \nlisten(2), usually called \"backlog\", is defined vaguely in Posix \nand therefore has various meanings on different systems, but is \nsupposed to limit how many half-open connections are allowed to \nwait there. \n\nI don't have the book at home, but IIRC, Solarix's interpretation \nis unusually strict, which causes it to reject connections much \nmore aggressively for a given value. Independently of that, the \nlow value that was originally suggested just turned out to be a \nbad guess. The mistake got worse as longer, fatter pipes got \ndeployed and protocols that did more opens got popular.\n\nPosix says that a backlog value more than the platform's maximum\ngets folded, so there is no danger in exceeding it. On Solaris 2.7, \nSOMAXCONN is still 5 in the headers, but larger values are both legal \nand effective. A parameter might reasonably be added to the config \nfile to crank the backlog value down on installations where kernel\nmemory is scarce and other daemons must compete with PG for connection \nresources.\n\nI have seen reports that it is this strict interpretation, and the\ntoo-low backlog passed to listen(2), that accounts for reports of\nUnix sockets working poorly on Solaris. (Certainly it is hard to \nbelieve that Sun could not make their Unix sockets work right!)\n\nNathan Myers\nncm@zembu.com\n",
"msg_date": "Sun, 17 Jun 2001 02:58:09 -0700",
"msg_from": "ncm@zembu.com (Nathan Myers)",
"msg_from_op": false,
"msg_subject": "Re: Doing authentication in backend"
}
] |
[
{
"msg_contents": "I notice that the signal handlers in postmaster.c do quite a lot of work,\nmuch more than what they teach you in school they should do. While\nfprintf, elog, and ctime may simply lead to annoyances, forking off the\nWAL helper processes seems to be quite a lot.\n\nISTM that most of these, esp. pmdie(), can be written more like the SIGHUP\nhandler, i.e., set a global variable and evaluate right after the\nselect(). This would at least give me a better feeling when I send \"Fast\nShutdown request at %s\" etc. through elog(), which is what they should do\nfor consistent message formatting.\n\nComments?\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Thu, 14 Jun 2001 19:39:18 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": true,
"msg_subject": "What (not) to do in signal handlers"
},
{
"msg_contents": "> I notice that the signal handlers in postmaster.c do quite a lot of work,\n> much more than what they teach you in school they should do. While\n> fprintf, elog, and ctime may simply lead to annoyances, forking off the\n> WAL helper processes seems to be quite a lot.\n> \n> ISTM that most of these, esp. pmdie(), can be written more like the SIGHUP\n> handler, i.e., set a global variable and evaluate right after the\n> select(). This would at least give me a better feeling when I send \"Fast\n> Shutdown request at %s\" etc. through elog(), which is what they should do\n> for consistent message formatting.\n\nAgreed. If we don't loop around to check the variable soon we have\nbigger problems that the signal handlers.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 14 Jun 2001 13:51:16 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: What (not) to do in signal handlers"
},
{
"msg_contents": "Peter Eisentraut <peter_e@gmx.net> writes:\n> I notice that the signal handlers in postmaster.c do quite a lot of work,\n> much more than what they teach you in school they should do.\n\nYes, they're pretty ugly. However, we have not recently heard any\ncomplaints suggesting problems with it. Since we block signals\neverywhere except just around the select() for new input, there's not\nreally any risk of recursive resource use AFAICS.\n\n> ISTM that most of these, esp. pmdie(), can be written more like the SIGHUP\n> handler, i.e., set a global variable and evaluate right after the\n> select().\n\nI would love to see it done that way, *if* you can show me a way to\nguarantee that the signal response will happen promptly. AFAIK there's\nno portable way to ensure that we don't end up sitting and waiting for a\nnew client message before we get past the select(). If we could release\nthe signal mask just as an atomic part of the select operation, then\nit'd work, but only some platforms support that. This has been\ndiscussed before, look in the archives.\n\nSIGHUP is okay because we don't really care whether the postmaster\nrereads the config file right away or only when it's about to process a\nnew request, anyhow. But for other sorts of signals we need to be sure\nthat there can't be an indefinite delay before the signal is acted on.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 14:18:40 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: What (not) to do in signal handlers "
},
{
"msg_contents": "On Thu, Jun 14, 2001 at 02:18:40PM -0400, Tom Lane wrote:\n> Peter Eisentraut <peter_e@gmx.net> writes:\n> > I notice that the signal handlers in postmaster.c do quite a lot of work,\n> > much more than what they teach you in school they should do.\n> \n> Yes, they're pretty ugly. However, we have not recently heard any\n> complaints suggesting problems with it. Since we block signals\n> everywhere except just around the select() for new input, there's not\n> really any risk of recursive resource use AFAICS.\n> \n> > ISTM that most of these, esp. pmdie(), can be written more like the SIGHUP\n> > handler, i.e., set a global variable and evaluate right after the\n> > select().\n> \n> I would love to see it done that way, *if* you can show me a way to\n> guarantee that the signal response will happen promptly. AFAIK there's\n> no portable way to ensure that we don't end up sitting and waiting for a\n> new client message before we get past the select(). \n\nIt could open a pipe, and write(2) a byte to it in the signal handler, \nand then have select(2) watch that pipe. (SIGHUP could use the same pipe.)\nWriting to and reading from your own pipe can be a recipe for deadlock, \nbut here it would be safe if the signal handler knows not to get too far\nahead of select. (The easy way would be to allow no more than one byte\nin the pipe per signal handler.)\n\nOf course this is still a system call in a signal handler, but it can't\n(modulo coding bugs) fail. See Stevens, \"Unix Network Programming, \nVol. 2, Interprocess Communication\", p. 91, Figure 5.10, \"Functions \nthat are async-signal-safe\". The figure lists write() among others.\nSample code implementing the above appears on page 94. Examples using \nother techniques (sigwait, nonblocking mq_receive) are presented also.\n\nA pipe per backend might be considered pretty expensive. Does UNIX \nallocate a pipe buffer before there's anything to put in it?\n\nNathan Myers\nncm@zembu.com\n",
"msg_date": "Thu, 14 Jun 2001 12:57:13 -0700",
"msg_from": "ncm@zembu.com (Nathan Myers)",
"msg_from_op": false,
"msg_subject": "Re: What (not) to do in signal handlers"
},
{
"msg_contents": "ncm@zembu.com (Nathan Myers) writes:\n> It could open a pipe, and write(2) a byte to it in the signal handler, \n> and then have select(2) watch that pipe. (SIGHUP could use the same pipe.)\n> Of course this is still a system call in a signal handler, but it can't\n> (modulo coding bugs) fail.\n\nHm. That's one way, but is it really any cleaner than our existing\ntechnique? Since you still need to assume you can do a system call\nin a signal handler, it doesn't seem like a real gain in\nbulletproofness to me.\n\n> A pipe per backend might be considered pretty expensive.\n\nPipe per postmaster, no? That doesn't seem like a huge cost. I'd be\nmore concerned about the two extra kernel calls (write and read) per\nsignal received, actually.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 16:27:14 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: What (not) to do in signal handlers "
},
{
"msg_contents": "Tom Lane <tgl@sss.pgh.pa.us> writes:\n\n> ncm@zembu.com (Nathan Myers) writes:\n> > It could open a pipe, and write(2) a byte to it in the signal handler, \n> > and then have select(2) watch that pipe. (SIGHUP could use the same pipe.)\n> > Of course this is still a system call in a signal handler, but it can't\n> > (modulo coding bugs) fail.\n> \n> Hm. That's one way, but is it really any cleaner than our existing\n> technique? Since you still need to assume you can do a system call\n> in a signal handler, it doesn't seem like a real gain in\n> bulletproofness to me.\n\nDoing write() in a signal handler is safe; doing fprintf() (and\nfriends) is not. POSIX specifies async-signal-safe functions, of\nwhich write() is one. I'd be very surprised if any Unix that people\nare using today had reentrancy problems with write(). All bets are\noff with fprintf() and the other stdio functions--they are not\nguaranteed async-signal-safe, and production code should never call\nthem in a signal handler. Stevens is very thorough on this subject.\n\n> > A pipe per backend might be considered pretty expensive.\n> \n> Pipe per postmaster, no? That doesn't seem like a huge cost. I'd be\n> more concerned about the two extra kernel calls (write and read) per\n> signal received, actually.\n\nThat's definitely an issue, but signals are (generally) pretty rare\nbeasts, unless you're doing signal-driven I/O or some such.\n\n-Doug\n-- \nThe rain man gave me two cures; he said jump right in,\nThe first was Texas medicine--the second was just railroad gin,\nAnd like a fool I mixed them, and it strangled up my mind,\nNow people just get uglier, and I got no sense of time... --Dylan\n",
"msg_date": "14 Jun 2001 16:58:33 -0400",
"msg_from": "Doug McNaught <doug@wireboard.com>",
"msg_from_op": false,
"msg_subject": "Re: What (not) to do in signal handlers"
},
{
"msg_contents": "Doug McNaught <doug@wireboard.com> writes:\n> Tom Lane <tgl@sss.pgh.pa.us> writes:\n>> Hm. That's one way, but is it really any cleaner than our existing\n>> technique? Since you still need to assume you can do a system call\n>> in a signal handler, it doesn't seem like a real gain in\n>> bulletproofness to me.\n\n> Doing write() in a signal handler is safe; doing fprintf() (and\n> friends) is not.\n\nIf we were calling the signal handlers from random places, then I'd\nagree. But we're not: we use sigblock to ensure that signals are only\nserviced at the place in the postmaster main loop where select() is\ncalled. So there's no actual risk of reentrant use of non-reentrant\nlibrary functions.\n\nPlease recall that in practice the postmaster is extremely reliable.\nThe single bug we have seen with the signal handlers in recent releases\nwas the problem that they were clobbering errno, which was easily fixed\nby saving/restoring errno. This same bug would have arisen (though at\nsuch low probability we'd likely never have solved it) in a signal\nhandler that only invoked write(). So I find it difficult to buy the\nargument that there's any net gain in robustness to be had here.\n\nIn short: this code isn't broken, and so I'm not convinced we should\n\"fix\" it.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 17:10:58 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: What (not) to do in signal handlers "
},
{
"msg_contents": "On Thu, Jun 14, 2001 at 04:27:14PM -0400, Tom Lane wrote:\n> ncm@zembu.com (Nathan Myers) writes:\n> > It could open a pipe, and write(2) a byte to it in the signal handler, \n> > and then have select(2) watch that pipe. (SIGHUP could use the same pipe.)\n> > Of course this is still a system call in a signal handler, but it can't\n> > (modulo coding bugs) fail.\n> \n> Hm. That's one way, but is it really any cleaner than our existing\n> technique? Since you still need to assume you can do a system call\n> in a signal handler, it doesn't seem like a real gain in\n> bulletproofness to me.\n\nQuoting Stevens (UNPv2, p. 90),\n\n Posix uses the term *async-signal-safe* to describe the functions that\n may be called from a signal handler. Figure 5.10 lists these Posix\n functions, along with a few that were added by Unix98.\n\n Functions not listed may not be called from a signal andler. Note that\n none of the standard I/O functions ... are listed. Of call the IPC\n functions covered in this text, only sem_post, read, and write are\n listed (we are assuming the latter two would be used with pipes and\n FIFOs).\n\nRestricting the handler to use those in the approved list seems like an \nautomatic improvement to me, even in the apparent absence of evidence \nof problems on those platforms that happen to get tested most. \n\n> > A pipe per backend might be considered pretty expensive.\n> \n> Pipe per postmaster, no? That doesn't seem like a huge cost. \n\nI haven't looked at how complex the signal handling in the backends is;\nmaybe they don't need anything this fancy. (OTOH, maybe they should be \nusing a pipe to communicate with postmaster, instead of using signals.)\n\n> I'd be\n> more concerned about the two extra kernel calls (write and read) per\n> signal received, actually.\n\nAre there so many signals flying around? The signal handler would check \na flag before writing, so a storm of signals would result in only one \ncall to write, and one call to read, per select loop.\n\nNathan Myers\nncm@zembu.com\n",
"msg_date": "Thu, 14 Jun 2001 14:12:06 -0700",
"msg_from": "ncm@zembu.com (Nathan Myers)",
"msg_from_op": false,
"msg_subject": "Re: What (not) to do in signal handlers"
},
{
"msg_contents": "Tom Lane <tgl@sss.pgh.pa.us> writes:\n\n> In short: this code isn't broken, and so I'm not convinced we should\n> \"fix\" it.\n\nPoint well taken. I was basically arguing from general principles. ;)\n\n-Doug\n-- \nThe rain man gave me two cures; he said jump right in,\nThe first was Texas medicine--the second was just railroad gin,\nAnd like a fool I mixed them, and it strangled up my mind,\nNow people just get uglier, and I got no sense of time... --Dylan\n",
"msg_date": "14 Jun 2001 17:12:23 -0400",
"msg_from": "Doug McNaught <doug@wireboard.com>",
"msg_from_op": false,
"msg_subject": "Re: What (not) to do in signal handlers"
},
{
"msg_contents": "On Thu, Jun 14, 2001 at 05:10:58PM -0400, Tom Lane wrote:\n> Doug McNaught <doug@wireboard.com> writes:\n> > Tom Lane <tgl@sss.pgh.pa.us> writes:\n> >> Hm. That's one way, but is it really any cleaner than our existing\n> >> technique? Since you still need to assume you can do a system call\n> >> in a signal handler, it doesn't seem like a real gain in\n> >> bulletproofness to me.\n> \n> > Doing write() in a signal handler is safe; doing fprintf() (and\n> > friends) is not.\n> \n> If we were calling the signal handlers from random places, then I'd\n> agree. But we're not: we use sigblock to ensure that signals are only\n> serviced at the place in the postmaster main loop where select() is\n> called. So there's no actual risk of reentrant use of non-reentrant\n> library functions.\n> \n> Please recall that in practice the postmaster is extremely reliable.\n> The single bug we have seen with the signal handlers in recent releases\n> was the problem that they were clobbering errno, which was easily fixed\n> by saving/restoring errno. This same bug would have arisen (though at\n> such low probability we'd likely never have solved it) in a signal\n> handler that only invoked write(). So I find it difficult to buy the\n> argument that there's any net gain in robustness to be had here.\n> \n> In short: this code isn't broken, and so I'm not convinced we should\n> \"fix\" it.\n \nFormally speaking, it *is* broken: we depend on semantics that are\ndocumented as unportable and undefined. In a sense, we have been so \nunlucky as not to have perceived, thus far, the undefined effects. \n\nThis is no different from depending on finding a NUL at *(char*)0, or \non being able to say \"free(p); p = p->next;\". Yes, it appears to work,\nat the moment, on some platforms, but that doesn't make it correct.\n\nIt may not be terribly urgent to fix it right now, but that's far from\n\"isn't broken\". It at least merits a TODO entry.\n\nNathan Myers\nncm@zembu.com\n\n",
"msg_date": "Thu, 14 Jun 2001 16:20:46 -0700",
"msg_from": "ncm@zembu.com (Nathan Myers)",
"msg_from_op": false,
"msg_subject": "Re: What (not) to do in signal handlers"
}
] |
[
{
"msg_contents": "Hiroshi asked me to reproduce the problem WRT Access 97 and NULLs. I\ncould not. A couple of years ago the problem was appearing on the\ninterfaces list as some users using ODBC were experiencing the problem.\nAfter about 1/2 day trying to reproduce it under a new operating system,\nupgrades of MDAC etc. I finally gave up. However, I did find this\nexplanation as to why on the Microsoft Knowledge Base:\n\nhttp://support.microsoft.com/support/kb/articles/Q237/9/92.ASP\n\nI'm not quite sure of the sequence of events and conditions at this\npoint. But it appears that if someone uses the Form's filter function,\nit makes a call into the Jet, which generates what it thinks is an ODBC\ncompatible query, submits the query to the ODBC driver, which forwards\nit on to the database. Depending upon your version of MDAC and the Jet\nengine, the Forms filter function will *not* exhibit the behavior. If it\ncan be pinned down, then we (we meaning you guys ;-)) can rip out the \"\n= NULL \" hack and simply tell users that encounter the problem to\nupgrade their MDAC components. If someone knows under what condition\nAccess 97 would be running under Jet 3.5 vs. Jet 4.0, and whether an\nupgrade of the downloadable MDAC components includes Jet upgrades, it\nwould help.\n\nMike Mascari\nmascarm@mascari.com\n",
"msg_date": "Thu, 14 Jun 2001 16:03:53 -0400",
"msg_from": "Mike Mascari <mascarm@mascari.com>",
"msg_from_op": true,
"msg_subject": "Update on Access 97 and = NULL"
},
{
"msg_contents": "Mike Mascari <mascarm@mascari.com> writes:\n> However, I did find this\n> explanation as to why on the Microsoft Knowledge Base:\n\n> http://support.microsoft.com/support/kb/articles/Q237/9/92.ASP\n\nInteresting. Apparently, at this point our \"Microsoft-compatible\"\nhack is arguably *failing* to be Microsoft-compatible.\n\nThe KB article is carefully written to make it sound like the only\n\"foo = NULL\" queries out there are mistakes made by users; but wasn't\nthe original issue that Access97 itself would generate a bogus query?\n\nI'm confused about which component is what here ... what exactly is\nthe relationship between Access, Jet, MDAC, etc?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 19:18:26 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Update on Access 97 and = NULL "
},
{
"msg_contents": "Tom Lane wrote:\n> \n> Mike Mascari <mascarm@mascari.com> writes:\n> > However, I did find this\n> > explanation as to why on the Microsoft Knowledge Base:\n> \n> > http://support.microsoft.com/support/kb/articles/Q237/9/92.ASP\n> \n> Interesting. Apparently, at this point our \"Microsoft-compatible\"\n> hack is arguably *failing* to be Microsoft-compatible.\n> \n> The KB article is carefully written to make it sound like the only\n> \"foo = NULL\" queries out there are mistakes made by users; but wasn't\n> the original issue that Access97 itself would generate a bogus query?\n\nYes it was. Its been a couple of years but IIRC it was using the either\nFilter tool or the Find tool in Forms which generated the bad query.\nODBC in Access also automatically requires the data in the current Form\nby default every 1500 seconds. That's why in the archive there was a\npost from someone saying that things worked fine until the Form was idle\nfor around 20 minutes. The guy turned ODBC logging on and saw Access was\nsending the = NULL query.\n\n> I'm confused about which component is what here ... what exactly is\n> the relationship between Access, Jet, MDAC, etc?\n\nI believe the layers are like this:\n\nAccess 97 -> Jet -> OLE DB Provider -> PostgreSQL ODBC ->\n..wire..\nPostgreSQL\n\nwhere OLE DB Provider is an MDAC component. If that is the case, then it\nwould seem the problem is with Access 97 itself (or us, see below). And\nI might not be seeing it any more because I'm running Access 97 Service\nRelease 2.\n\nAnother possibility, one that Hiroshi suggested and that can be seen in\nthe ODBC log files, is that Access 97 is using prepared statements which\neventually call the ODBC driver's SQLPrepare() function like this:\n\nSQLPrepare(hstmt, \"UPDATE employees SET salary = ? WHERE employeeid =\n?\", SQL_NTS);\n\nand later, a call to:\n\nSQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_FLOAT, SQL_REAL, \n\t\t 7, 0, &salary, 0, &salaryind);\nSQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,\n10, 0,\n &employee, 0, &employeeind);\n\nIf the last parameter is set to SQL_NULL_DATA, then that means that the\nlast parameter is NULL. That means that the query must be rewritten by\nthe driver to \"IS NULL\" instead of \"= NULL\". Unfortunately, it *appears*\nour ODBC driver doesn't do that. In bind.c it stores in the parameter\nindicator in the 'used' data member of the StatementClass structure.\nThen in convert.c in the function:\n\nint copy_statement_with_parameters(StatementClass *stmt)\n\nis has this piece of code:\n\nif (used == SQL_NULL_DATA) {\n\tCVT_APPEND_STR(\"NULL\");\n\tcontinue;\n}\n\nwhich just appends a NULL to the growing statement it is constructing.\nTherefore, the ODBC driver would generate:\n\n\"UPDATE employees SET salary = 2000 WHERE employeeid = NULL\"\n\nSo it appears that the driver is definitely doing the wrong thing with\nparameters. Whether or not that is the direct cause, I don't know. I\nsuspect that older versions of the Jet accepted this form of query for\nthe same reason. It could potentially be difficult to do the right\nthing. \n\nNow I'm lost and don't know who to blame :-(\n\nMike Mascari\nmascarm@mascari.com\n",
"msg_date": "Thu, 14 Jun 2001 21:45:00 -0400",
"msg_from": "Mike Mascari <mascarm@mascari.com>",
"msg_from_op": true,
"msg_subject": "Re: Update on Access 97 and = NULL"
},
{
"msg_contents": "> -----Original Message-----\n> From: Mike Mascari [mailto:mascarm@mascari.com]\n> \n> Tom Lane wrote:\n> > \n> > Mike Mascari <mascarm@mascari.com> writes:\n> > > However, I did find this\n> > > explanation as to why on the Microsoft Knowledge Base:\n> > \n> > > http://support.microsoft.com/support/kb/articles/Q237/9/92.ASP\n> > \n> > Interesting. Apparently, at this point our \"Microsoft-compatible\"\n> > hack is arguably *failing* to be Microsoft-compatible.\n> > \n> > The KB article is carefully written to make it sound like the only\n> > \"foo = NULL\" queries out there are mistakes made by users; but wasn't\n> > the original issue that Access97 itself would generate a bogus query?\n> \n\n[snip]\n\n> \n> Another possibility, one that Hiroshi suggested and that can be seen in\n> the ODBC log files, is that Access 97 is using prepared statements which\n> eventually call the ODBC driver's SQLPrepare() function like this:\n> \n> SQLPrepare(hstmt, \"UPDATE employees SET salary = ? WHERE employeeid =\n> ?\", SQL_NTS);\n> \n> and later, a call to:\n> \n> SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_FLOAT, SQL_REAL, \n> \t\t 7, 0, &salary, 0, &salaryind);\n> SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,\n> 10, 0,\n> &employee, 0, &employeeind);\n> \n> If the last parameter is set to SQL_NULL_DATA, then that means that the\n> last parameter is NULL. That means that the query must be rewritten by\n> the driver to \"IS NULL\" instead of \"= NULL\". Unfortunately, it *appears*\n> our ODBC driver doesn't do that. \n\nYou are right. I'd like to fix it.\nWhen could we translate \"= NULL\" into \"IS NULL\" ?\n\n SELECT statement OK ?\n SET xxxx = NULL NG \n , xxxx = NULL NG ?\n otherwise OK ?\n.....\n\nComments ?\n\nregards,\nHiroshi Inoue\n",
"msg_date": "Fri, 15 Jun 2001 19:28:07 +0900",
"msg_from": "\"Hiroshi Inoue\" <Inoue@tpf.co.jp>",
"msg_from_op": false,
"msg_subject": "RE: Update on Access 97 and = NULL"
},
{
"msg_contents": "\"Hiroshi Inoue\" <Inoue@tpf.co.jp> writes:\n>> If the last parameter is set to SQL_NULL_DATA, then that means that the\n>> last parameter is NULL. That means that the query must be rewritten by\n>> the driver to \"IS NULL\" instead of \"= NULL\". Unfortunately, it *appears*\n>> our ODBC driver doesn't do that. \n\nThis sounds like a plausible explanation.\n\n> You are right. I'd like to fix it.\n> When could we translate \"= NULL\" into \"IS NULL\" ?\n\nHmm ... before we go marching off in that direction, it would be a good\nidea to verify that this is *really* what is supposed to happen. Is\nthere any ODBC standard that we can consult to confirm that binding a\nNULL parameter should cause that to happen? My suspicion is that it's\njust as much a spec violation if the ODBC driver does it as if the\nbackend does it. Note that the KB article tells users they must fix\ntheir queries, not that the ODBC layer will take care of it.\n\nBut, taking that assumption as correct for the moment ---\n\nGiven the choice of having the ODBC driver do this or letting the\nbackend do it, I'd have to say that I prefer leaving it in the backend,\nbecause the ODBC driver just doesn't have enough understanding of SQL\nsyntax to be able to get it right. It would take a major upgrade of the\ndriver's SQL parser before I'd have any confidence in the translation\nbeing done correctly.\n\nYet ... in the long run that does need to happen, I think. Some day\nit'd be nice to see ODBC contain a full parser similar to ecpg's.\nWhat I'm wondering about that is how we can reduce the maintenance load.\nMichael Meskes spends a great deal of work trying to keep ecpg's grammar\nin sync with the backend, and I fear it's a losing battle. Is there\nsome way we could automatically generate backend/ecpg/ODBC parsers from\na common source?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 15 Jun 2001 09:45:57 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Update on Access 97 and = NULL "
},
{
"msg_contents": "> -----Original Message-----\n> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]\n>\n> \"Hiroshi Inoue\" <Inoue@tpf.co.jp> writes:\n> >> If the last parameter is set to SQL_NULL_DATA, then that means that the\n> >> last parameter is NULL. That means that the query must be rewritten by\n> >> the driver to \"IS NULL\" instead of \"= NULL\". Unfortunately, it\n> *appears*\n> >> our ODBC driver doesn't do that.\n>\n> This sounds like a plausible explanation.\n>\n> > You are right. I'd like to fix it.\n> > When could we translate \"= NULL\" into \"IS NULL\" ?\n>\n[snip]\n>\n> But, taking that assumption as correct for the moment ---\n>\n> Given the choice of having the ODBC driver do this or letting the\n> backend do it, I'd have to say that I prefer leaving it in the backend,\n> because the ODBC driver just doesn't have enough understanding of SQL\n> syntax to be able to get it right. It would take a major upgrade of the\n> driver's SQL parser before I'd have any confidence in the translation\n> being done correctly.\n>\n\nOK agreed.\n\n> Yet ... in the long run that does need to happen, I think. Some day\n> it'd be nice to see ODBC contain a full parser similar to ecpg's.\n\nHmm I fear the strong binding between the driver and the server.\nWould the parser always be backward compatible ?\n\nregards,\nHiroshi Inoue\n\n",
"msg_date": "Sat, 16 Jun 2001 10:05:38 +0900",
"msg_from": "\"Hiroshi Inoue\" <Inoue@tpf.co.jp>",
"msg_from_op": false,
"msg_subject": "RE: Update on Access 97 and = NULL "
},
{
"msg_contents": "Hiroshi Inoue wrote:\n> \n> > Yet ... in the long run that does need to happen, I think. Some day\n> > it'd be nice to see ODBC contain a full parser similar to ecpg's.\n> \n> Hmm I fear the strong binding between the driver and the server.\n> Would the parser always be backward compatible ?\n> \nAFAIK, we would need a completely new ODBC-SQL parser that perses the \nquery and then reconstructs it in PostgreSQL-SQL before passing it\nforward\nunless it is for \"pass-thru\" queries that are the only ones meant to be \nsent directly.\n\n--------------\nHannu\n",
"msg_date": "Mon, 18 Jun 2001 12:29:22 +0200",
"msg_from": "Hannu Krosing <hannu@tm.ee>",
"msg_from_op": false,
"msg_subject": "Re: Update on Access 97 and = NULL"
},
{
"msg_contents": "Hannu Krosing wrote:\n> \n> Hiroshi Inoue wrote:\n> >\n> > > Yet ... in the long run that does need to happen, I think. Some day\n> > > it'd be nice to see ODBC contain a full parser similar to ecpg's.\n> >\n> > Hmm I fear the strong binding between the driver and the server.\n> > Would the parser always be backward compatible ?\n> >\n> AFAIK, we would need a completely new ODBC-SQL parser that perses the\n> query and then reconstructs it in PostgreSQL-SQL before passing it\n> forward\n> unless it is for \"pass-thru\" queries that are the only ones meant to be\n> sent directly.\n> \n\nHow could we know it's a \"pass-thru\" query ?\n\nregards,\nHiroshi Inoue\n",
"msg_date": "Tue, 19 Jun 2001 08:48:43 +0900",
"msg_from": "Hiroshi Inoue <Inoue@tpf.co.jp>",
"msg_from_op": false,
"msg_subject": "Re: Update on Access 97 and = NULL"
}
] |
[
{
"msg_contents": "Attached is a patch that explains to optimizer that its possible to use\nindex when performing a << b where a is an inet/cidr value and b is a\nconstant.\n\nIndexpath generated for such an expression is this:\n(a > network(b)) and (a <= set_masklen(broadcast(b, 32)))\n\nSince this is my first time delving in the guts of postgres, someone\ndefinitely should review it :)\n\nI mostly based my code on prefix_quals function for string types.\n\nThanks",
"msg_date": "Thu, 14 Jun 2001 16:30:14 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "[PATCH] indexability of << operator for inet/cidr"
},
{
"msg_contents": "Alex Pilosov <alex@pilosoft.com> writes:\n> Indexpath generated for such an expression is this:\n> (a > network(b)) and (a <= set_masklen(broadcast(b, 32)))\n\nWhat happens to that set_masklen thing for IPv6?\n\nIf the network.c code were exporting a function that made this value,\nI'd not worry; but I don't like wiring an IPv4 assumption into code far\naway in the planner. Can't we do better here? Perhaps move the\ngeneration of the indexscan bound values into a subroutine in network.c?\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 19:03:23 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] indexability of << operator for inet/cidr "
},
{
"msg_contents": "Your patch has been added to the PostgreSQL unapplied patches list at:\n\n\thttp://candle.pha.pa.us/cgi-bin/pgpatches\n\nI will try to apply it within the next 48 hours.\n\n> Attached is a patch that explains to optimizer that its possible to use\n> index when performing a << b where a is an inet/cidr value and b is a\n> constant.\n> \n> Indexpath generated for such an expression is this:\n> (a > network(b)) and (a <= set_masklen(broadcast(b, 32)))\n> \n> Since this is my first time delving in the guts of postgres, someone\n> definitely should review it :)\n> \n> I mostly based my code on prefix_quals function for string types.\n> \n> Thanks\n> \n\nContent-Description: \n\n[ Attachment, skipping... ]\n\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 5: Have you checked our extensive FAQ?\n> \n> http://www.postgresql.org/users-lounge/docs/faq.html\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Thu, 14 Jun 2001 19:05:10 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] indexability of << operator for inet/cidr"
},
{
"msg_contents": "On Thu, 14 Jun 2001, Tom Lane wrote:\n\n> Alex Pilosov <alex@pilosoft.com> writes:\n> > Indexpath generated for such an expression is this:\n> > (a > network(b)) and (a <= set_masklen(broadcast(b, 32)))\n> \n> What happens to that set_masklen thing for IPv6?\n> \n> If the network.c code were exporting a function that made this value,\n> I'd not worry; but I don't like wiring an IPv4 assumption into code far\n> away in the planner. Can't we do better here? Perhaps move the\n> generation of the indexscan bound values into a subroutine in network.c?\n\nGood point. I already rewrote it, but I am going to send it in tomorrow, I\nwant to resync to HEAD, since some of network.c was taken in and I want to\nhave a clean patch for you guys :)\n\n\nThanks\n-alex\n\n",
"msg_date": "Fri, 15 Jun 2001 00:35:13 -0400 (EDT)",
"msg_from": "Alex Pilosov <alex@pilosoft.com>",
"msg_from_op": true,
"msg_subject": "Re: [PATCH] indexability of << operator for inet/cidr "
},
{
"msg_contents": "\nPatch removed from queue, awaiting updated version.\n\n> Attached is a patch that explains to optimizer that its possible to use\n> index when performing a << b where a is an inet/cidr value and b is a\n> constant.\n> \n> Indexpath generated for such an expression is this:\n> (a > network(b)) and (a <= set_masklen(broadcast(b, 32)))\n> \n> Since this is my first time delving in the guts of postgres, someone\n> definitely should review it :)\n> \n> I mostly based my code on prefix_quals function for string types.\n> \n> Thanks\n> \n\nContent-Description: \n\n[ Attachment, skipping... ]\n\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 5: Have you checked our extensive FAQ?\n> \n> http://www.postgresql.org/users-lounge/docs/faq.html\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Fri, 15 Jun 2001 09:56:45 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [PATCH] indexability of << operator for inet/cidr"
}
] |
[
{
"msg_contents": "Per previous discussions, I have modified initdb to revoke public read\naccess on pg_statistic (you can still read it if you're superuser,\nof course) and instead added a view pg_stats, which will show the\nstatistics rows only for tables that current_user has read access to.\nThis uses the has_table_privilege function just contributed by Joe\nConway.\n\nThe view also tries to be slightly more user-friendly than a raw look at\npg_statistic. It joins to pg_class and pg_attribute to get the names of\ntables and columns, and it presents the various kinds of statistics\nintelligently labeled. (Thus, the view has wired into it exactly the\nsort of assumptions we agreed not to make in pg_statistic itself.\nPeter E. may be unhappy with me here. But it seems to me that we can\nchange/extend the view definition when we add new kinds of statistics\nentries.)\n\nThe actual definition looks like\n\nregression=# \\d pg_stats\n View \"pg_stats\"\n Attribute | Type | Modifier\n-------------------+---------+----------\n tablename | name |\n attname | name |\n null_frac | real |\n avg_width | integer |\n n_distinct | real |\n most_common_vals | text[] |\n most_common_freqs | real[] |\n histogram_bounds | text[] |\n correlation | real |\nView definition: SELECT c.relname AS tablename, a.attname, s.stanullfrac AS null_frac, s.stawidth AS avg_width, s.stadistinct AS n_distinct, CASE WHEN (1 = s.stakind1) THEN s.stavalues1 WHEN (1 = s.stakind2) THEN s.stavalues2 WHEN (1 = s.stakind3) THEN s.stavalues3 WHEN (1 = s.stakind4) THEN s.stavalues4 ELSE NULL::\"_text\" END AS most_common_vals, CASE WHEN (1 = s.stakind1) THEN s.stanumbers1 WHEN (1 = s.stakind2) THEN s.stanumbers2 WHEN (1 = s.stakind3) THEN s.stanumbers3 WHEN (1 = s.stakind4) THEN s.stanumbers4 ELSE NULL::\"_float4\" END AS most_common_freqs, CASE WHEN (2 = s.stakind1) THEN s.stavalues1 WHEN (2 = s.stakind2) THEN s.stavalues2 WHEN (2 = s.stakind3) THEN s.stavalues3 WHEN (2 = s.stakind4) THEN s.stavalues4 ELSE NULL::\"_text\" END AS histogram_bounds, CASE WHEN (3 = s.stakind1) THEN s.stanumbers1[1] WHEN (3 = s.stakind2) THEN s.stanumbers2[1] WHEN (3 = s.stakind3) THEN s.stanumbers3[1] WHEN (3 = s.stakind4) THEN s.stanumbers4[1] ELSE NULL::float4 END AS correlat!\nion FROM pg_class c, pg_attribute a, pg_statistic s WHERE ((((c.oid = s.starelid) AND (c.oid = a.attrelid)) AND (a.attnum = s.staattnum)) AND has_table_privilege(c.oid, 'select'::text));\n\nand a sample result is:\n\nregression=# select * from pg_stats where tablename = 'tenk1' and attname = 'unique1';\n tablename | attname | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation\n-----------+---------+-----------+-----------+------------+------------------+-------------------+----------------------------------------------------------------------------+-------------\n tenk1 | unique1 | 0 | 4 | -1 | | | {\"1\",\"966\",\"1939\",\"2937\",\"3955\",\"4994\",\"5957\",\"6934\",\"8002\",\"9044\",\"9996\"} | 0.0256536\n(1 row)\n\n(See the current include/catalog/pg_statistic.h file for more info about\nwhat the columns mean.)\n\nComments? Any suggestions on column names, layout, anything? None of\nthis is set in stone as far as I'm concerned, it's just a first cut.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 14 Jun 2001 18:09:23 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": true,
"msg_subject": "pg_stats view added to CVS tip"
},
{
"msg_contents": "Tom Lane writes:\n\n> The view also tries to be slightly more user-friendly than a raw look at\n> pg_statistic. It joins to pg_class and pg_attribute to get the names of\n> tables and columns, and it presents the various kinds of statistics\n> intelligently labeled. (Thus, the view has wired into it exactly the\n> sort of assumptions we agreed not to make in pg_statistic itself.\n> Peter E. may be unhappy with me here. But it seems to me that we can\n> change/extend the view definition when we add new kinds of statistics\n> entries.)\n\nFor informational views this is okay AFAICS; the SQL information schema is\nfull of this kind of thing. When you want to present alternative\ninformation you add a new column and return null in the old ones.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Sat, 16 Jun 2001 17:39:37 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: pg_stats view added to CVS tip"
}
] |
[
{
"msg_contents": "The following patch improves the descriptions in pg_hba.conf,\npg_password, and pg_ident.conf. I found pg_hba.conf particularly\nconfusing so I hope this new version is clearer for our users.\n\nOne change is that there was no mention that crypt can not be used with\nsecondary passwords, and little mention that usernames alone can be used\nin those secondary password files.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n\nIndex: doc/src/sgml/ref/pg_passwd.sgml\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/pg_passwd.sgml,v\nretrieving revision 1.6\ndiff -c -r1.6 pg_passwd.sgml\n*** doc/src/sgml/ref/pg_passwd.sgml\t2001/02/20 01:16:49\t1.6\n--- doc/src/sgml/ref/pg_passwd.sgml\t2001/06/14 23:50:39\n***************\n*** 16,22 ****\n \n <refnamediv>\n <refname>pg_passwd</refname>\n! <refpurpose>Manipulate a text password file</refpurpose>\n </refnamediv>\n \n <refsynopsisdiv>\n--- 16,22 ----\n \n <refnamediv>\n <refname>pg_passwd</refname>\n! <refpurpose>Manipulate a secondary password file</refpurpose>\n </refnamediv>\n \n <refsynopsisdiv>\n***************\n*** 29,58 ****\n <refsect1 id=\"app-pg-passwd-description\">\n <title>Description</title>\n <para>\n! <application>pg_passwd</application> is a tool to manipulate a flat\n! text password file for the purpose of using that file to control\n! client authentication of the\n! <productname>PostgreSQL</productname> server. More information\n about setting up this authentication mechanism can be found in the\n <citetitle>Administrator's Guide</citetitle>.\n </para>\n \n <para>\n! The form of a text password file is one entry per line; the fields\n! of each entry are separated by colons. The first field is the user\n! name, the second field is the encrypted password. Other fields are\n ignored (to allow password files to be shared between applications\n! that use similar formats). The functionality of the\n! <application>pg_passwd</application> utility is to enable a user to\n! interactively add entries to such a file, to alter passwords of\n! existing entries, and to take care of encrypting the passwords.\n </para>\n \n <para>\n! Supply the name of the password file as argument to the <application>pg_passwd</application>\n! command. To be of use for client authentication the file needs to\n! be located in the server's data directory, and the base name of\n! the file needs to be specified in the\n <filename>pg_hba.conf</filename> access control file.\n \n <screen>\n--- 29,56 ----\n <refsect1 id=\"app-pg-passwd-description\">\n <title>Description</title>\n <para>\n! <application>pg_passwd</application> is a tool for manipulating flat\n! text password files. These files can control client authentication of\n! the <productname>PostgreSQL</productname> server. More information\n about setting up this authentication mechanism can be found in the\n <citetitle>Administrator's Guide</citetitle>.\n </para>\n \n <para>\n! The format of a text password file is one entry per line; the fields\n! of each entry are separated by colons. The first field is the user\n! name, the second field is the encrypted password. Other fields are\n ignored (to allow password files to be shared between applications\n! that use similar formats). <application>pg_passwd</application>\n! enables users to interactively add entries to such a file, to alter\n! passwords of existing entries, and to encrypt such passwords.\n </para>\n \n <para>\n! Supply the name of the password file as argument to the\n! <application>pg_passwd</application> command. To be used by\n! PostgreSQL, the file needs to be located in the server's data\n! directory, and the base name of the file needs to be specified in the\n <filename>pg_hba.conf</filename> access control file.\n \n <screen>\n***************\n*** 90,100 ****\n \n <note>\n <para>\n! It is also useful to have entries in a password file with an empty\n! password field. (This is different from an empty password.)\n! These entries cannot be managed by\n! <application>pg_passwd</application>, but it is always possible to\n! edit password files manually.\n </para>\n </note>\n </refsect1>\n--- 88,98 ----\n \n <note>\n <para>\n! It is also useful to have entries in a password file with empty\n! password fields. (This is different from an empty password.) Such\n! entries allow you to restrict users who can access the system. These\n! entries cannot be managed by <application>pg_passwd</application>,\n! but you can edit password files manually.\n </para>\n </note>\n </refsect1>\nIndex: src/backend/libpq/password.c\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/libpq/password.c,v\nretrieving revision 1.36\ndiff -c -r1.36 password.c\n*** src/backend/libpq/password.c\t2001/03/22 03:59:30\t1.36\n--- src/backend/libpq/password.c\t2001/06/14 23:50:43\n***************\n*** 76,84 ****\n \t\t\tFreeFile(pw_file);\n \n \t\t\t/*\n! \t\t\t * If the password is empty of \"+\" then we use the regular\n \t\t\t * pg_shadow passwords. If we use crypt then we have to use\n! \t\t\t * pg_shadow passwords no matter what.\n \t\t\t */\n \t\t\tif (port->auth_method == uaCrypt\n \t\t\t\t|| test_pw == NULL || test_pw[0] == '\\0'\n--- 76,86 ----\n \t\t\tFreeFile(pw_file);\n \n \t\t\t/*\n! \t\t\t * If the password is empty or \"+\" then we use the regular\n \t\t\t * pg_shadow passwords. If we use crypt then we have to use\n! \t\t\t * pg_shadow passwords no matter what. This is because\n! \t\t\t * the current code needs non-encrypted passwords to\n! \t\t\t * encrypt with a random salt.\n \t\t\t */\n \t\t\tif (port->auth_method == uaCrypt\n \t\t\t\t|| test_pw == NULL || test_pw[0] == '\\0'\nIndex: src/backend/libpq/pg_hba.conf.sample\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/libpq/pg_hba.conf.sample,v\nretrieving revision 1.17\ndiff -c -r1.17 pg_hba.conf.sample\n*** src/backend/libpq/pg_hba.conf.sample\t2000/11/21 20:44:32\t1.17\n--- src/backend/libpq/pg_hba.conf.sample\t2001/06/14 23:50:43\n***************\n*** 1,188 ****\n- #\n- # PostgreSQL HOST ACCESS CONTROL FILE\n- #\n- # \n- # This file controls what hosts are allowed to connect to what databases\n- # and specifies how users on a particular host are identified. It is read\n- # by the PostgreSQL postmaster each time a host tries to make a connection\n- # to a database.\n- #\n- # Each line (terminated by a newline character) is a record. A record\n- # cannot be continued across two lines.\n- # \n- # There are 3 kinds of records:\n- # 1) comment: Starts with #.\n- # 2) empty: Contains nothing excepting spaces and tabs.\n- # 3) record: anything else. \n- # Only record lines are significant.\n- #\n- # A record consists of tokens separated by spaces or tabs. Spaces and\n- # tabs at the beginning and end of a record are ignored, as are extra\n- # spaces and tabs between two tokens.\n- #\n- # The first token in a record is the record type. The interpretation of\n- # the rest of the record depends on the record type.\n- \n- \n- # Record type \"host\"\n- # ------------------\n # \n! # This record identifies a set of network hosts that are permitted to\n! # connect to databases via IP connections. No hosts are permitted to connect\n! # over IP except as specified by a \"host\" record.\n! #\n # Format:\n # \n! # host DBNAME IP_ADDRESS ADDRESS_MASK AUTHTYPE [AUTH_ARGUMENT]\n # \n! # DBNAME is the name of a PostgreSQL database, or \"all\" to indicate all\n! # databases, or \"sameuser\" to restrict a user's access to a database with\n! # the same name as the user.\n! #\n! # IP_ADDRESS and ADDRESS_MASK are a standard dotted decimal IP address\n! # and mask to identify a set of hosts. These hosts are allowed to connect\n! # to the database(s) identified by DBNAME. Note that the IP address must\n! # be specified numerically, not as a domain name.\n! #\n! # AUTHTYPE and AUTH_ARGUMENT are described below.\n! #\n # There can be multiple \"host\" records, possibly with overlapping sets of\n! # host addresses. The postmaster scans to find the first entry that matches\n! # the connecting host IP address and the requested database name. This\n! # entry's AUTHTYPE will then be used to verify or reject the connection.\n! # If no entry matches the host+database, the connection is rejected.\n! \n! \n! # Record type \"hostssl\"\n! # ---------------------\n! #\n! # The format of this record is identical to that of \"host\".\n! #\n # This record identifies a set of network hosts that are permitted to\n! # connect to databases over secure SSL IP connections. Note that a \"host\"\n! # record will also allow SSL connections; write \"hostssl\" if you want to\n! # accept *only* SSL-secured connections from this host or hosts.\n! #\n # This keyword is only available if the server was compiled with SSL\n # support enabled.\n! \n! \n! # Record type \"local\"\n! # ------------------\n # \n # This record identifies the authentication to use when connecting to\n! # the server via a local UNIX socket. UNIX-socket connections will be\n # allowed only if this record type appears.\n! #\n # Format:\n # \n- # local DBNAME AUTHTYPE [AUTH_ARGUMENT]\n- #\n- # The format is the same as that of the \"host\" record type except that\n- # the IP_ADDRESS and ADDRESS_MASK are omitted.\n- #\n # As with \"host\" records, the first \"local\" record matching the requested\n! # database name controls whether the connection is allowed.\n! \n! \n! # Authentication Types (AUTHTYPE)\n! # -------------------------------\n! #\n! # AUTHTYPE is a keyword indicating the method used to authenticate the\n! # user, i.e. to determine that the user is authorized to connect under\n! # the PostgreSQL username supplied in the connection request. A\n! # different AUTHTYPE can be specified for each record in the file.\n! #\n! # trust: \tNo authentication is done. Trust that the user has the\n! # \t\tauthority to use whatever username he specifies.\n! #\n # password:\tAuthentication is done by matching a password supplied\n! # \t\tin clear by the host. If AUTH_ARGUMENT is specified then\n! # \t\tthe password is compared with the user's entry in that\n! # \t\tfile (in the $PGDATA directory). These per-host password\n! #\t\tfiles can be maintained with the pg_passwd(1) utility.\n! #\t\tIf no AUTH_ARGUMENT appears then the password is compared\n! #\t\twith the user's entry in the pg_shadow table.\n! #\n! # crypt: \tSame as 'password', but authentication is done by\n! # \t\tencrypting the password sent over the network.\n! #\n # ident: \tAuthentication is done by the ident server on the remote\n! # \t\thost, via the ident (RFC 1413) protocol. An AUTH_ARGUMENT\n! #\t\tis required: it is a map name to be found in the\n! #\t\t$PGDATA/pg_ident.conf file. The connection is accepted\n! #\t\tif pg_ident.conf contains an entry for this map name with\n! #\t\tthe ident-supplied username and the requested PostgreSQL\n! #\t\tusername. The special map name \"sameuser\" indicates an\n! #\t\timplied map (not sought in pg_ident.conf) that maps every\n! #\t\tident username to the identical PostgreSQL username.\n! #\n # krb4: \tKerberos V4 authentication is used.\n! #\n # krb5: \tKerberos V5 authentication is used.\n! #\n! # reject: \tReject the connection.\n! #\n! # Local (UNIX socket) connections support only AUTHTYPEs \"trust\",\n! # \"password\", \"crypt\", and \"reject\".\n! \n! \n # Examples\n! # --------\n! #\n! # TYPE DATABASE IP_ADDRESS MASK AUTHTYPE MAP\n! # \n! # Allow any user on the local system to connect to any\n! # database under any username, but only via an IP connection:\n! #\n! # host all 127.0.0.1 255.255.255.255 trust \n! #\n! # The same, over Unix-socket connections:\n! #\n # local all trust\n! #\n # Allow any user from any host with IP address 192.168.93.x to\n! # connect to database \"template1\" as the same username that ident on that\n! # host identifies him as (typically his Unix username):\n! #\n! # host template1 192.168.93.0 255.255.255.0 ident sameuser\n # \n # Allow a user from host 192.168.12.10 to connect to database \"template1\"\n # if the user's password in pg_shadow is correctly supplied:\n! #\n # host template1 192.168.12.10 255.255.255.255 crypt\n! #\n # In the absence of preceding \"host\" lines, these two lines will reject\n! # all connection attempts from 192.168.54.1 (since that entry will be\n! # matched first), but allow Kerberos V5-validated connections from anywhere\n! # else on the Internet. The zero mask means that no bits of the host IP\n! # address are considered, so it matches any host:\n! #\n # host all 192.168.54.1 255.255.255.255 reject\n # host all 0.0.0.0 0.0.0.0 krb5\n! #\n! # Allow users from 192.168.x.x hosts to connect to any database, if they\n! # pass the ident check. If, for example, ident says the user is \"bryanh\"\n! # and he requests to connect as PostgreSQL user \"guest1\", the connection\n! # is allowed if there is an entry in pg_ident.conf for map \"omicron\" that\n! # says \"bryanh\" is allowed to connect as \"guest1\":\n! #\n! # host all 192.168.0.0 255.255.0.0 ident omicron\n! #\n! \n! \n # Put your actual configuration here\n! # ----------------------------------\n! \n! # This default configuration allows any local user to connect as any\n # PostgreSQL username, over either UNIX domain sockets or IP:\n! \n! local all trust\n! host all 127.0.0.1 255.255.255.255 trust\n! \n # If you want to allow non-local connections, you will need to add more\n! # \"host\" records (and don't forget to start the postmaster with \"-i\"!).\n! \n! # CAUTION: if you are on a multiple-user machine, the above default\n! # configuration is probably too liberal for you --- change it to use\n # something other than \"trust\" authentication.\n--- 1,217 ----\n # \n! # PostgreSQL HOST-BASED ACCESS (HBA) CONTROL FILE\n! # \n! # \n! # This file controls:\n! # \n! # \to which hosts are allowed to connect\n! # \to how users are authenticated on each host\n! # \to databases accessible by each host\n! # \n! # It is read by the PostgreSQL postmaster each time a host tries to make a\n! # connection to a database.\n! # \n! # Each line is a new record. Records cannot be continued across multiple\n! # lines. Lines beginning with # (comments) and blank lines are ignored. A\n! # record consists of tokens separated by multiple spaces or tabs.\n! # \n! # The first token of a record indicates its type. The remainder of the\n! # record is interpreted based on its type.\n! # \n! # Record Types\n! # ============\n! # \n! # There are three types of records:\n! # \n! # \to host\n! # \to hostssl\n! # \to local\n! # \n! # host\n! # ----\n! # \n! # This record identifies the networked hosts that are permitted to connect\n! # via IP connections.\n! # \n # Format:\n # \n! # host DBNAME IP_ADDRESS ADDRESS_MASK AUTH_TYPE [AUTH_ARGUMENT]\n # \n! # DBNAME can be:\n! # \n! # \to the name of a PostgreSQL database\n! # \to \"all\" to indicate all databases\n! # \to \"sameuser\" to allow access only to databases with the same\n! # \t name as the connecting user\n! # \n! # IP_ADDRESS and ADDRESS_MASK are standard dotted decimal IP address and\n! # mask values. IP addresses can only be specified numerically, not as\n! # domain or host names.\n! # \n! # AUTH_TYPE and AUTH_ARGUMENT are described below.\n! # \n # There can be multiple \"host\" records, possibly with overlapping sets of\n! # host addresses. The postmaster finds the first entry that matches the\n! # connecting host IP address and the requested database name. If no entry\n! # matches the database/hostname combination, the connection is rejected.\n! # \n! # \n! # hostssl\n! # -------\n! # \n! # The format of this record is identical to \"host\".\n! # \n # This record identifies a set of network hosts that are permitted to\n! # connect to databases over secure SSL IP connections. Note that a \"host\"\n! # record will also allow SSL connections. \"hostssl\" forces these\n! # hosts to use *only* SSL-secured connections.\n! # \n # This keyword is only available if the server was compiled with SSL\n # support enabled.\n! # \n! # \n! # local\n! # -----\n # \n # This record identifies the authentication to use when connecting to\n! # the server via a local UNIX domain socket. UNIX-socket connections are\n # allowed only if this record type appears.\n! # \n # Format:\n+ # \n+ # local DBNAME AUTH_TYPE [AUTH_ARGUMENT]\n+ # \n+ # This format is identical to the \"host\" record type except the IP_ADDRESS\n+ # and ADDRESS_MASK fields are omitted.\n # \n # As with \"host\" records, the first \"local\" record matching the requested\n! # database name is used.\n! # \n! # \n! # \n! # Authentication Types (AUTH_TYPE)\n! # ================================\n! # \n! # AUTH_TYPE indicates the method used to authenticate users. The username\n! # is specified in the connection request. A different AUTH_TYPE can be\n! # specified for each record in the file.\n! # \n! # trust: \tNo authentication is done. Any valid username is accepted,\n! # \t\tincluding the PostgreSQL superuser. This option should\n! # \t\tbe use only for machines where all users are truested.\n! # \n # password:\tAuthentication is done by matching a password supplied\n! # \t\tin clear by the host. If no AUTH_ARGUMENT is used, the\n! # \t\tpassword is compared with the user's entry in the\n! # \t\tpg_shadow table.\n! # \n! # \t\tIf AUTH_ARGUMENT is specified, the username is looked up\n! # \t\tin that file in the $PGDATA directory. If the username\n! # \t\texists but there is no password, the password is looked\n! # \t\tup in pg_shadow. If a password exists in the file, it is\n! # \t\tit used instead. These secondary files allow fine-grained\n! # \t\tcontrol over who can access which databases and whether\n! # \t\ta non-default passwords are required. The same file can be\n! # \t\tused in multiple records for easier administration.\n! # \t\tPassword files can be maintained with the pg_passwd(1)\n! # \t\tutility. Remember, these passwords override pg_shadow\n! # \t\tpasswords.\n! # \n! # crypt: \tSame as \"password\", but authentication is done by\n! # \t\tencrypting the password sent over the network. This is\n! # \t\talways preferable to \"password\" except for old clients\n! # \t\tthat don't support \"crypt\". Also, crypt can use\n! # \t\tusernames stored in secondary password files but not\n! # \t\tsecondary passwords.\n! # \n # ident: \tAuthentication is done by the ident server on the remote\n! # \t\thost. AUTH_ARGUMENT is required and maps names found in\n! # \t\tthe $PGDATA/pg_ident.conf file. The connection is\n! # \t\taccepted if the file contains an entry for this map\n! # \t\tname with the ident-supplied username and the requested\n! # \t\tPostgreSQL username. The special map name \"sameuser\"\n! # \t\tindicates an implied map (not in pg_ident.conf)\n! # \t\tthat maps each ident username to the identical\n! # \t\tPostgreSQL username.\n! # \n # krb4: \tKerberos V4 authentication is used.\n! # \n # krb5: \tKerberos V5 authentication is used.\n! # \n! # reject: \tReject the connection. This is used to reject certain hosts\n! # \t\tthat are part of a network specified later in the file.\n! # \t\tTo be effective, \"reject\" must appear before the later\n! # \t\tentries.\n! # \n! # Local UNIX-domain socket connections support only the AUTH_TYPEs of\n! # \"trust\", \"password\", \"crypt\", and \"reject\".\n! # \n! # \n! # \n # Examples\n! # ========\n! # \n! # \n! # Allow any user on the local system to connect to any database under any\n! # username using Unix-domain sockets (the default for local connections):\n! # TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE AUTH_ARGUMENT\n # local all trust\n! # \n! # The same using IP connections on the same machine:\n! # TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE AUTH_ARGUMENT\n! # host all 127.0.0.1 255.255.255.255 trust \n! # \n # Allow any user from any host with IP address 192.168.93.x to\n! # connect to database \"template1\" as the same username that ident reports\n! # for the connection (typically his Unix username):\n # \n+ # TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE AUTH_ARGUMENT\n+ # host template1 192.168.93.0 255.255.255.0 ident sameuser\n+ # \n # Allow a user from host 192.168.12.10 to connect to database \"template1\"\n # if the user's password in pg_shadow is correctly supplied:\n! # \n! # TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE AUTH_ARGUMENT\n # host template1 192.168.12.10 255.255.255.255 crypt\n! # \n # In the absence of preceding \"host\" lines, these two lines will reject\n! # all connection from 192.168.54.1 (since that entry will be matched\n! # first), but allow Kerberos V5-validated connections from anywhere else\n! # on the Internet. The zero mask means that no bits of the host IP address\n! # are considered, so it matches any host:\n! # \n! # \n! # TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE AUTH_ARGUMENT\n # host all 192.168.54.1 255.255.255.255 reject\n # host all 0.0.0.0 0.0.0.0 krb5\n! # \n! # Allow users from 192.168.x.x hosts to connect to any database if they\n! # pass the ident check. For example, if ident says the user is \"james\" and\n! # he requests to connect as PostgreSQL user \"guest\", the connection is\n! # allowed if there is an entry in $PGDATA/pg_ident.conf with map name \n! # \"phoenix\" that says \"james\" is allowed to connect as \"guest\":\n! # \n! # TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE AUTH_ARGUMENT\n! # host all 192.168.0.0 255.255.0.0 ident phoenix\n! # \n! # See $PGDATA/pg_ident.conf for more information on Ident maps.\n! # \n # Put your actual configuration here\n! # ==================================\n! # \n! # This default configuration allows any local user to connect with any\n # PostgreSQL username, over either UNIX domain sockets or IP:\n! # \n # If you want to allow non-local connections, you will need to add more\n! # \"host\" records. Also, remember IP connections are only enabled if you\n! # start the postmaster with the -i option.\n! # \n! # CAUTION: if you are on a multiple-user machine, the default\n! # configuration is probably too liberal for you. Change it to use\n # something other than \"trust\" authentication.\n+ # \n+ # TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE AUTH_ARGUMENT\n+ \n+ local all trust\n+ host all 127.0.0.1 255.255.255.255 trust\n+ \nIndex: src/backend/libpq/pg_ident.conf.sample\n===================================================================\nRCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/libpq/pg_ident.conf.sample,v\nretrieving revision 1.3\ndiff -c -r1.3 pg_ident.conf.sample\n*** src/backend/libpq/pg_ident.conf.sample\t2000/11/21 20:48:38\t1.3\n--- src/backend/libpq/pg_ident.conf.sample\t2001/06/14 23:50:43\n***************\n*** 1,29 ****\n! # This is the pg_ident.conf file, which is used with Postgres ident-based\n! # authentication (a subtype of host-based authentication).\n! \n! # This is a table of ident usernames (typically Unix usernames) and \n! # their corresponding Postgres usernames. For example, user \"bryanh\" on\n! # some particular remote system may equate to Postgres user \"guest1\".\n! \n! # This file contains multiple maps. Each has a name. The pg_hba.conf\n! # file determines what connections relate to this file and for those that\n! # do, which map to use.\n! \n! # Each record consists of 3 tokens:\n! #\n! # 1) map name\n! # 2) ident username\n! # 3) Postgres username\n! \n! # Note that it is possible for one user to map to multiple Postgres usernames.\n! # A user always has to specify when he connects what Postgres username he is\n! # using. This file is only used to validate that selection.\n! \n! # If you just need a one-to-one correspondence between usernames reported\n! # by ident and Postgres usernames, you don't need this file. Instead use\n! # the special map name \"sameuser\" in pg_hba.conf.\n! \n! #MAP IDENT POSTGRES USERNAME\n! \n! #testmap robert bob\n! #testmap lucy lucy\n--- 1,31 ----\n! # \n! # \t\tPostgreSQL IDENT-BASED AUTHENTICATION MAPS\n! # \n! # This file controls PostgreSQL ident-based authentication. It maps ident\n! # usernames (typically Unix usernames) to their corresponding PostgreSQL\n! # usernames. Entries are grouped by map name. Each record consists of\n! # three fields:\n! # \n! # \to map name\n! # \to ident username\n! # \to PostgreSQL username\n! # \n! # For example, the following entry equates user \"james\" on a remote system\n! # to PostgreSQL user \"guest\" in the map named \"phoenix\":\n! # \n! # MAP IDENT PGUSERNAME\n! # phoenix james guest\n! # \n! # \"phoenix\" can now be used by an \"ident\" record in $DATA/pg_hba.conf.\n! # \n! # Multiple maps may be specified in this file and used by pg_hba.conf.\n! # \n! # Note that it is possible for a remote user to map to multiple PostgreSQL\n! # usernames. The PostgreSQL username specified at connection time controls\n! # which one is used.\n! # \n! # If all ident usernames and PostgreSQL usernames are the same, you don't\n! # need this file. Instead, use the special map name \"sameuser\" in\n! # pg_hba.conf.\n! # \n! # MAP IDENT PGUSERNAME",
"msg_date": "Thu, 14 Jun 2001 20:05:06 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": true,
"msg_subject": "Improved pg_hba.conf description"
},
{
"msg_contents": "Hello.\n\nIf this is possible, I am looking for documentation on how to embed the\npostgresql database engine in a process.\n\nBest regards,\n\nLudovic\n\n",
"msg_date": "Tue, 19 Jun 2001 22:49:54 +0200",
"msg_from": "\"Ludovic PENET\" <lpenet@cubicsoft.com>",
"msg_from_op": false,
"msg_subject": "Embedding postgresql"
},
{
"msg_contents": "Ludovic PENET writes:\n\n> If this is possible, I am looking for documentation on how to embed the\n> postgresql database engine in a process.\n\nThis is not part of the plan.\n\n-- \nPeter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter\n\n",
"msg_date": "Wed, 20 Jun 2001 22:37:02 +0200 (CEST)",
"msg_from": "Peter Eisentraut <peter_e@gmx.net>",
"msg_from_op": false,
"msg_subject": "Re: Embedding postgresql"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.