threads
listlengths
1
2.99k
[ { "msg_contents": "\nMorning all...\n\n\tI haven't been ignoring the messages...will have it fixed by end\nof weekend...getting ADSL installed at home tomorrow afternoon, which\nmeans that I finally have enough bandwidth to work on the 'Net without\nfalling asleep ...:)\n\n\n", "msg_date": "Thu, 30 Jul 1998 14:50:35 -0400 (EDT)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "ANON-CVS..." } ]
[ { "msg_contents": "Hi,\n\nBelow is an example of my query, which returns no plan and produces\nFATAL 1: palloc failure: memory exhausted while postgres 'eats'\nalmost 113 Mb of RAM. This happens with pgsql 6.3.2+patches plus latest\nVadim's one on Linux 2.0.35 libc5. Sorry for variable names :-)\nI remember discussion prior 6.3.2 about optimization of join and\ntried various -f options but this doesn't helps.\nWhen I run postmaster in debug mode I noticed some complains about\ngeqo config file doesn't exists but not sure if this important.\nWhen I tried explain with less joins I got very bad plans with no\nindices used. Tables are not big - about 1000 records - just \na classificators (2 columns) and only work_flats has 31 columns.\nMost columns have int2, int4 types. So database looks very simple and\nI didn't expect any problem.\nOf course there are a bunch of indices and I did vacuum before query.\nCurrently I have to run a bunch of queries and do joins\nby hand (using perl) :-(\n\nDoes development version 6.4 has some improvements ? I tried\nlatest snapshot but couldn't run because of problem with initdb and\nmissing anonymous cvs account.\n\n\tRegards,\n\n\t\tOleg\n\nflats=> \\i test.sql\nexplain select\n a.ROOMS, b.STATION, a.STREET, a.HOUSE_NO, a.FLAT_NO,\n float8(a.PRICE)/1000.0, a.DO_METRO, c.SPOSOB_SH, a.FLOOR,\n e.HOUSE_TYPE_SHORT, a.HOUSE_FLOORS, float8(a.ALL_SQR)/100.0,\n float8(a.LIVE_SQR)/100.0, float8(a.KITCHEN)/100.0, f.SANUZEL_SHORT,\n a.SANUZEL_NO, a.BALKON, a.LODZHIA, a.HAVE_PHONE, a.HAVE_LIFT,\n a.HAVE_MUSOR, g.POL_SHORT, h.SOST_SHORT, i.STATUS_SHORT, a.COMMENT\nfrom WORK_FLATS a, METRO_STATIONS b, SPOSOB c, SERIALS d,\n HOUSE_TYPE e, SANUZELS f, POLS g, SOSTS h, STATUS i\nwhere b.STATION_ID = a.METRO_ID and c.SPOSOB_ID = a.DO_METRO_ID and\n a.SERIAL_ID = d.SERIAL_ID and d.HOUSE_TYPE_ID = e.HOUSE_TYPE_ID and\n f.SANUZEL_ID = a.SANUZEL and g.POL_ID = a.POL_ID and\n h.SOST_ID = a.SOST_ID and i.STATUS_ID = a.STATUS_ID and\n a.rooms = 1;\nFATAL 1: palloc failure: memory exhausted\n\n\n_____________________________________________________________\nOleg Bartunov, sci.researcher, hostmaster of AstroNet,\nSternberg Astronomical Institute, Moscow University (Russia)\nInternet: [email protected], http://www.sai.msu.su/~megera/\nphone: +007(095)939-16-83, +007(095)939-23-83\n\n", "msg_date": "Fri, 31 Jul 1998 03:52:24 +0400 (MSK DST)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": true, "msg_subject": "join problems: FATAL 1: palloc failure: memory exhausted " }, { "msg_contents": "Oleg Bartunov wrote:\n> \n> explain select\n> a.ROOMS, b.STATION, a.STREET, a.HOUSE_NO, a.FLAT_NO,\n> float8(a.PRICE)/1000.0, a.DO_METRO, c.SPOSOB_SH, a.FLOOR,\n> e.HOUSE_TYPE_SHORT, a.HOUSE_FLOORS, float8(a.ALL_SQR)/100.0,\n> float8(a.LIVE_SQR)/100.0, float8(a.KITCHEN)/100.0, f.SANUZEL_SHORT,\n> a.SANUZEL_NO, a.BALKON, a.LODZHIA, a.HAVE_PHONE, a.HAVE_LIFT,\n> a.HAVE_MUSOR, g.POL_SHORT, h.SOST_SHORT, i.STATUS_SHORT, a.COMMENT\n> from WORK_FLATS a, METRO_STATIONS b, SPOSOB c, SERIALS d,\n> HOUSE_TYPE e, SANUZELS f, POLS g, SOSTS h, STATUS i\n> where b.STATION_ID = a.METRO_ID and c.SPOSOB_ID = a.DO_METRO_ID and\n> a.SERIAL_ID = d.SERIAL_ID and d.HOUSE_TYPE_ID = e.HOUSE_TYPE_ID and\n> f.SANUZEL_ID = a.SANUZEL and g.POL_ID = a.POL_ID and\n> h.SOST_ID = a.SOST_ID and i.STATUS_ID = a.STATUS_ID and\n> a.rooms = 1;\n> FATAL 1: palloc failure: memory exhausted\n\nNow please try the same after\n\nSET GEQO TO 'off';\n\nVadim\n", "msg_date": "Fri, 31 Jul 1998 08:41:00 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] join problems: FATAL 1: palloc failure: memory\n exhausted" }, { "msg_contents": "Try changing the geqo parameters with SET GEQO and see if that helps.\n> Hi,\n> \n> Below is an example of my query, which returns no plan and produces\n> FATAL 1: palloc failure: memory exhausted while postgres 'eats'\n> almost 113 Mb of RAM. This happens with pgsql 6.3.2+patches plus latest\n> Vadim's one on Linux 2.0.35 libc5. Sorry for variable names :-)\n> I remember discussion prior 6.3.2 about optimization of join and\n> tried various -f options but this doesn't helps.\n> When I run postmaster in debug mode I noticed some complains about\n> geqo config file doesn't exists but not sure if this important.\n> When I tried explain with less joins I got very bad plans with no\n> indices used. Tables are not big - about 1000 records - just \n> a classificators (2 columns) and only work_flats has 31 columns.\n> Most columns have int2, int4 types. So database looks very simple and\n> I didn't expect any problem.\n> Of course there are a bunch of indices and I did vacuum before query.\n> Currently I have to run a bunch of queries and do joins\n> by hand (using perl) :-(\n> \n> Does development version 6.4 has some improvements ? I tried\n> latest snapshot but couldn't run because of problem with initdb and\n> missing anonymous cvs account.\n> \n> \tRegards,\n> \n> \t\tOleg\n> \n> flats=> \\i test.sql\n> explain select\n> a.ROOMS, b.STATION, a.STREET, a.HOUSE_NO, a.FLAT_NO,\n> float8(a.PRICE)/1000.0, a.DO_METRO, c.SPOSOB_SH, a.FLOOR,\n> e.HOUSE_TYPE_SHORT, a.HOUSE_FLOORS, float8(a.ALL_SQR)/100.0,\n> float8(a.LIVE_SQR)/100.0, float8(a.KITCHEN)/100.0, f.SANUZEL_SHORT,\n> a.SANUZEL_NO, a.BALKON, a.LODZHIA, a.HAVE_PHONE, a.HAVE_LIFT,\n> a.HAVE_MUSOR, g.POL_SHORT, h.SOST_SHORT, i.STATUS_SHORT, a.COMMENT\n> from WORK_FLATS a, METRO_STATIONS b, SPOSOB c, SERIALS d,\n> HOUSE_TYPE e, SANUZELS f, POLS g, SOSTS h, STATUS i\n> where b.STATION_ID = a.METRO_ID and c.SPOSOB_ID = a.DO_METRO_ID and\n> a.SERIAL_ID = d.SERIAL_ID and d.HOUSE_TYPE_ID = e.HOUSE_TYPE_ID and\n> f.SANUZEL_ID = a.SANUZEL and g.POL_ID = a.POL_ID and\n> h.SOST_ID = a.SOST_ID and i.STATUS_ID = a.STATUS_ID and\n> a.rooms = 1;\n> FATAL 1: palloc failure: memory exhausted\n> \n> \n> _____________________________________________________________\n> Oleg Bartunov, sci.researcher, hostmaster of AstroNet,\n> Sternberg Astronomical Institute, Moscow University (Russia)\n> Internet: [email protected], http://www.sai.msu.su/~megera/\n> phone: +007(095)939-16-83, +007(095)939-23-83\n> \n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 30 Jul 1998 21:37:28 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] join problems: FATAL 1: palloc failure: memory\n exhausted" }, { "msg_contents": "> Oleg Bartunov wrote:\n> > \n> > explain select\n> > a.ROOMS, b.STATION, a.STREET, a.HOUSE_NO, a.FLAT_NO,\n> > float8(a.PRICE)/1000.0, a.DO_METRO, c.SPOSOB_SH, a.FLOOR,\n> > e.HOUSE_TYPE_SHORT, a.HOUSE_FLOORS, float8(a.ALL_SQR)/100.0,\n> > float8(a.LIVE_SQR)/100.0, float8(a.KITCHEN)/100.0, f.SANUZEL_SHORT,\n> > a.SANUZEL_NO, a.BALKON, a.LODZHIA, a.HAVE_PHONE, a.HAVE_LIFT,\n> > a.HAVE_MUSOR, g.POL_SHORT, h.SOST_SHORT, i.STATUS_SHORT, a.COMMENT\n> > from WORK_FLATS a, METRO_STATIONS b, SPOSOB c, SERIALS d,\n> > HOUSE_TYPE e, SANUZELS f, POLS g, SOSTS h, STATUS i\n> > where b.STATION_ID = a.METRO_ID and c.SPOSOB_ID = a.DO_METRO_ID and\n> > a.SERIAL_ID = d.SERIAL_ID and d.HOUSE_TYPE_ID = e.HOUSE_TYPE_ID and\n> > f.SANUZEL_ID = a.SANUZEL and g.POL_ID = a.POL_ID and\n> > h.SOST_ID = a.SOST_ID and i.STATUS_ID = a.STATUS_ID and\n> > a.rooms = 1;\n> > FATAL 1: palloc failure: memory exhausted\n> \n> Now please try the same after\n> \n> SET GEQO TO 'off';\n\nIf that fixes it, this is the second recent case where geqo was\nconsuming too much memory.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 30 Jul 1998 21:38:33 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] join problems: FATAL 1: palloc failure: memory\n exhausted" }, { "msg_contents": "OK,\nflats=> set GEQO TO 'off';\nSET VARIABLE\nflats=> \\i test.sql\nexplain select\n a.ROOMS, b.STATION, a.STREET, a.HOUSE_NO, a.FLAT_NO,\n float8(a.PRICE)/1000.0, a.DO_METRO, c.SPOSOB_SH, a.FLOOR,\n e.HOUSE_TYPE_SHORT, a.HOUSE_FLOORS, float8(a.ALL_SQR)/100.0,\n float8(a.LIVE_SQR)/100.0, float8(a.KITCHEN)/100.0, f.SANUZEL_SHORT,\n a.SANUZEL_NO, a.BALKON, a.LODZHIA, a.HAVE_PHONE, a.HAVE_LIFT,\n a.HAVE_MUSOR, g.POL_SHORT, h.SOST_SHORT, i.STATUS_SHORT, a.COMMENT\nfrom WORK_FLATS a, METRO_STATIONS b, SPOSOB c, SERIALS d,\n HOUSE_TYPE e, SANUZELS f, POLS g, SOSTS h, STATUS i\nwhere b.STATION_ID = a.METRO_ID and c.SPOSOB_ID = a.DO_METRO_ID and\n a.SERIAL_ID = d.SERIAL_ID and d.HOUSE_TYPE_ID = e.HOUSE_TYPE_ID and\n f.SANUZEL_ID = a.SANUZEL and g.POL_ID = a.POL_ID and\n h.SOST_ID = a.SOST_ID and i.STATUS_ID = a.STATUS_ID and\n a.rooms = 1;\n\nwaiting .... waiting .... gave up after 20 minutes :-(\nIt seems setting GEQO to 'off' doesn't helps.\nIt's on P200, 64 Mb RAM, SCSI ... \n\n 6:23am up 10 days, 15:14, 12 users, load average: 1.29, 1.04, 0.65\n89 processes: 86 sleeping, 3 running, 0 zombie, 0 stopped\nCPU states: 50.1% user, 2.7% system, 0.0% nice, 47.2% idle\nMem: 62988K av, 62348K used, 640K free, 6624K shrd, 180K buff\nSwap: 130748K av, 94956K used, 35792K free 4296K cached\n \n PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND\n22970 postgres 12 0 94160 47M 260 R 0 50.9 77.7 13:41 postgres\n\nVadim, I can send you about 50 Kb compressed pg_dump of this db,\nif you like to see yourself.\n\n\tOleg\n\n\n\nOn Fri, 31 Jul 1998, Vadim Mikheev wrote:\n\n> Date: Fri, 31 Jul 1998 08:41:00 +0800\n> From: Vadim Mikheev <[email protected]>\n> To: Oleg Bartunov <[email protected]>\n> Cc: [email protected]\n> Subject: Re: [HACKERS] join problems: FATAL 1: palloc failure: memory exhausted\n> \n> Oleg Bartunov wrote:\n> > \n> > explain select\n> > a.ROOMS, b.STATION, a.STREET, a.HOUSE_NO, a.FLAT_NO,\n> > float8(a.PRICE)/1000.0, a.DO_METRO, c.SPOSOB_SH, a.FLOOR,\n> > e.HOUSE_TYPE_SHORT, a.HOUSE_FLOORS, float8(a.ALL_SQR)/100.0,\n> > float8(a.LIVE_SQR)/100.0, float8(a.KITCHEN)/100.0, f.SANUZEL_SHORT,\n> > a.SANUZEL_NO, a.BALKON, a.LODZHIA, a.HAVE_PHONE, a.HAVE_LIFT,\n> > a.HAVE_MUSOR, g.POL_SHORT, h.SOST_SHORT, i.STATUS_SHORT, a.COMMENT\n> > from WORK_FLATS a, METRO_STATIONS b, SPOSOB c, SERIALS d,\n> > HOUSE_TYPE e, SANUZELS f, POLS g, SOSTS h, STATUS i\n> > where b.STATION_ID = a.METRO_ID and c.SPOSOB_ID = a.DO_METRO_ID and\n> > a.SERIAL_ID = d.SERIAL_ID and d.HOUSE_TYPE_ID = e.HOUSE_TYPE_ID and\n> > f.SANUZEL_ID = a.SANUZEL and g.POL_ID = a.POL_ID and\n> > h.SOST_ID = a.SOST_ID and i.STATUS_ID = a.STATUS_ID and\n> > a.rooms = 1;\n> > FATAL 1: palloc failure: memory exhausted\n> \n> Now please try the same after\n> \n> SET GEQO TO 'off';\n> \n> Vadim\n> \n\n_____________________________________________________________\nOleg Bartunov, sci.researcher, hostmaster of AstroNet,\nSternberg Astronomical Institute, Moscow University (Russia)\nInternet: [email protected], http://www.sai.msu.su/~megera/\nphone: +007(095)939-16-83, +007(095)939-23-83\n\n\n\n", "msg_date": "Fri, 31 Jul 1998 06:25:30 +0400 (MSK DST)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] join problems: FATAL 1: palloc failure: memory\n exhausted" }, { "msg_contents": "Oleg Bartunov wrote:\n> \n> Vadim, I can send you about 50 Kb compressed pg_dump of this db,\n> if you like to see yourself.\n\nOk, send it.\n\nVadim\n", "msg_date": "Fri, 31 Jul 1998 10:27:29 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] join problems: FATAL 1: palloc failure: memory\n exhausted" } ]
[ { "msg_contents": "unsubscribe\n\n\n\n", "msg_date": "Fri, 31 Jul 1998 06:13:54 +0200", "msg_from": "Zoltran <[email protected]>", "msg_from_op": true, "msg_subject": "[HACKERS] unsubscribe" } ]
[ { "msg_contents": "I have succeeded in making OR clauses use indexes. I have not dealt\nwith some of the more complex issues like x=3 or y=5 as Vadim mentioned,\nbut at least it works.\n\n\ttest=> select * from test where x=102532 or x=102533;\n\t x\n\t------\n\t102532\n\t102533\n\t(2 rows)\n\t\n\ttest=> explain select * from test where x=102532 or x=102533;\n\tNOTICE: QUERY PLAN:\n\t\n\tIndex Scan using i_test on test (cost=4.10 size=1 width=4)\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 31 Jul 1998 01:32:51 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "OR clause status report" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> I have succeeded in making OR clauses use indexes. I have not dealt\n> with some of the more complex issues like x=3 or y=5 as Vadim mentioned,\n> but at least it works.\n> \n> test=> select * from test where x=102532 or x=102533;\n\nBut did you care about the case when two indices (on test(x) and\non test(y)) exist ?\n\nVadim\n", "msg_date": "Fri, 31 Jul 1998 13:46:25 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report" }, { "msg_contents": "\nOn 31-Jul-98 Bruce Momjian wrote:\n> I have succeeded in making OR clauses use indexes. I have not dealt\n> with some of the more complex issues like x=3 or y=5 as Vadim\n> mentioned,\n> but at least it works.\n> \n> test=> select * from test where x=102532 or x=102533;\n> x\n> ------\n> 102532\n> 102533\n> (2 rows)\n> \n> test=> explain select * from test where x=102532 or x=102533;\n> NOTICE: QUERY PLAN:\n> \n> Index Scan using i_test on test (cost=4.10 size=1 width=4)\n\nNow I've been wondering why my selects are so slow. Is this telling me\nthat they're NOT using the index? And if not, any ideas why?\n\nThe select returned 35 rows out of approx 170,000.\n\n-----\ncampsites=> explain select * from locations where lower(city)='oxford';\nNOTICE: QUERY PLAN:\n\nSeq Scan on locations (cost=7263.30 size=84899 width=32)\n\nEXPLAIN\ncampsites=> \n-----\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] flame-mail: /dev/null\n # include <std/disclaimers.h> TEAM-OS2\n Online Searchable Campground Listings http://www.camping-usa.com\n \"There is no outfit less entitled to lecture me about bloat\n than the federal government\" -- Tony Snow\n==========================================================================\n\n\n", "msg_date": "Fri, 31 Jul 1998 08:54:20 -0400 (EDT)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] OR clause status report" }, { "msg_contents": "Vince Vielhaber wrote:\n> \n> Now I've been wondering why my selects are so slow. Is this telling me\n> that they're NOT using the index? And if not, any ideas why?\n> \n> The select returned 35 rows out of approx 170,000.\n> \n> -----\n> campsites=> explain select * from locations where lower(city)='oxford';\n ^^^^^^^^^^^\nYou should \n\ncreate index index_name on locations (lower(city))\n ^^^^^\n- this is known as functional index...\n\n> NOTICE: QUERY PLAN:\n> \n> Seq Scan on locations (cost=7263.30 size=84899 width=32)\n\nVadim\n", "msg_date": "Fri, 31 Jul 1998 21:24:50 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report" }, { "msg_contents": "\nOn 31-Jul-98 Vadim Mikheev wrote:\n> Vince Vielhaber wrote:\n>> \n>> Now I've been wondering why my selects are so slow. Is this telling\n>> me\n>> that they're NOT using the index? And if not, any ideas why?\n>> \n>> The select returned 35 rows out of approx 170,000.\n>> \n>> -----\n>> campsites=> explain select * from locations where\n>> lower(city)='oxford';\n> ^^^^^^^^^^^\n> You should \n> \n> create index index_name on locations (lower(city))\n> ^^^^^\n> - this is known as functional index...\n> \n\ncampsites=> create index lower_city on locations (lower(city));\nERROR: DefineIndex: (null) class not found\ncampsites=> \n\nHmmm..\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] flame-mail: /dev/null\n # include <std/disclaimers.h> TEAM-OS2\n Online Searchable Campground Listings http://www.camping-usa.com\n \"There is no outfit less entitled to lecture me about bloat\n than the federal government\" -- Tony Snow\n==========================================================================\n\n\n", "msg_date": "Fri, 31 Jul 1998 09:39:51 -0400 (EDT)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report" }, { "msg_contents": "Vince Vielhaber wrote:\n> \n> campsites=> create index lower_city on locations (lower(city));\n> ERROR: DefineIndex: (null) class not found\n> campsites=>\n\nOk, this works:\n\ncreate index lower_city on locations (lower(city) text_ops);\n\nSomething broken in DefineIndex -:((\nXXX_ops for function rettype should be used...\n\nVadim\n", "msg_date": "Fri, 31 Jul 1998 21:46:28 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report" }, { "msg_contents": "\nOn 31-Jul-98 Vadim Mikheev wrote:\n> Vince Vielhaber wrote:\n>> \n>> campsites=> create index lower_city on locations (lower(city));\n>> ERROR: DefineIndex: (null) class not found\n>> campsites=>\n> \n> Ok, this works:\n> \n> create index lower_city on locations (lower(city) text_ops);\n> \n> Something broken in DefineIndex -:((\n> XXX_ops for function rettype should be used...\n\nYep, it created it that time but still won't use it. :(\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] flame-mail: /dev/null\n # include <std/disclaimers.h> TEAM-OS2\n Online Searchable Campground Listings http://www.camping-usa.com\n \"There is no outfit less entitled to lecture me about bloat\n than the federal government\" -- Tony Snow\n==========================================================================\n\n\n", "msg_date": "Fri, 31 Jul 1998 10:05:14 -0400 (EDT)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report" }, { "msg_contents": "> Bruce Momjian wrote:\n> > \n> > I have succeeded in making OR clauses use indexes. I have not dealt\n> > with some of the more complex issues like x=3 or y=5 as Vadim mentioned,\n> > but at least it works.\n> > \n> > test=> select * from test where x=102532 or x=102533;\n> \n> But did you care about the case when two indices (on test(x) and\n> on test(y)) exist ?\n\nHaven't gotten to that yet.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 31 Jul 1998 10:30:47 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR clause status report" }, { "msg_contents": "Vince Vielhaber wrote:\n> \n> Yep, it created it that time but still won't use it. :(\n\nYes, I see.\n\nThis is patch for 6.3.2\nCVS updated.\n\nBruce, could you add this to TODO:\n\n>> campsites=> create index lower_city on locations (lower(city));\n>> ERROR: DefineIndex: (null) class not found\n>> campsites=>\n> \n> Ok, this works:\n> \n> create index lower_city on locations (lower(city) text_ops);\n> \n> Something broken in DefineIndex -:((\n> XXX_ops for function rettype should be used...\n\nShould be easy to fix but no time -:(\n\nVadim", "msg_date": "Fri, 31 Jul 1998 23:04:27 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report" }, { "msg_contents": "> Vince Vielhaber wrote:\n> > \n> > Yep, it created it that time but still won't use it. :(\n> \n> Yes, I see.\n> \n> This is patch for 6.3.2\n> CVS updated.\n> \n> Bruce, could you add this to TODO:\n> \n> >> campsites=> create index lower_city on locations (lower(city));\n> >> ERROR: DefineIndex: (null) class not found\n> >> campsites=>\n> > \n> > Ok, this works:\n> > \n> > create index lower_city on locations (lower(city) text_ops);\n> > \n> > Something broken in DefineIndex -:((\n> > XXX_ops for function rettype should be used...\n> \n> Should be easy to fix but no time -:(\n\nAdded:\n\n* allow creation of functional indexes to use default types\n\nI am a little confused. You say you updated CVS. Isn't the change\ninstalled already?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 31 Jul 1998 11:15:15 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR clause status report" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> Added:\n> \n> * allow creation of functional indexes to use default types\n> \n> I am a little confused. You say you updated CVS. Isn't the change\n> installed already?\n\nFunctional indices were not used - this is fixed now and\nfix is in CVS.\n\nVadim\n", "msg_date": "Fri, 31 Jul 1998 23:29:20 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report" }, { "msg_contents": "\nOn 31-Jul-98 Vadim Mikheev wrote:\n> Vince Vielhaber wrote:\n>> \n>> Yep, it created it that time but still won't use it. :(\n> \n> Yes, I see.\n> \n> This is patch for 6.3.2\n> CVS updated.\n> \n\ncampsites=> explain select * from locations where lower(city) = 'oxford';\nNOTICE: QUERY PLAN:\n\nIndex Scan using lower_city on locations (cost=3608.95 size=56600 width=32)\n\nEXPLAIN\ncampsites=> \n\n\nMuch better! Thanks! Now I get to upgrade the production machine.\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] flame-mail: /dev/null\n # include <std/disclaimers.h> TEAM-OS2\n Online Searchable Campground Listings http://www.camping-usa.com\n \"There is no outfit less entitled to lecture me about bloat\n than the federal government\" -- Tony Snow\n==========================================================================\n\n\n", "msg_date": "Fri, 31 Jul 1998 12:55:25 -0400 (EDT)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report" }, { "msg_contents": "\nOn 31-Jul-98 Vince Vielhaber wrote:\n> \n> On 31-Jul-98 Vadim Mikheev wrote:\n>> Vince Vielhaber wrote:\n>>> \n>>> Yep, it created it that time but still won't use it. :(\n>> \n>> Yes, I see.\n>> \n>> This is patch for 6.3.2\n>> CVS updated.\n>> \n> \n> campsites=> explain select * from locations where lower(city) = 'oxford';\n> NOTICE: QUERY PLAN:\n> \n> Index Scan using lower_city on locations (cost=3608.95 size=56600\n> width=32)\n> \n> EXPLAIN\n> campsites=> \n> \n> \n> Much better! Thanks! Now I get to upgrade the production machine.\n\nOk, everything's working now but I did run into something unexpected.\nThe test machine (actually my desktop) has been running the cvsup'd\nversion since I set ip up a couple of weeks ago. The production machine\nwas running 6.3. The INSTALL file says dumping the db wasn't necessary\nyet I had to - it wouldn't run without it and complained about the older\ndatabase. Is dumping going to be required for 6.4?\n\nAlso are indexes working for floats when the query uses BETWEEN?\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] flame-mail: /dev/null\n # include <std/disclaimers.h> TEAM-OS2\n Online Searchable Campground Listings http://www.camping-usa.com\n \"There is no outfit less entitled to lecture me about bloat\n than the federal government\" -- Tony Snow\n==========================================================================\n\n\n", "msg_date": "Fri, 31 Jul 1998 15:12:13 -0400 (EDT)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report - working" }, { "msg_contents": "> The test machine (actually my desktop) has been running the cvsup'd\n> version since I set ip up a couple of weeks ago. The production \n> machine was running 6.3. The INSTALL file says dumping the db wasn't \n> necessary yet I had to - it wouldn't run without it and complained \n> about the older database. Is dumping going to be required for 6.4?\n\nOf course :)\n\nAlso, things like the installation docs are the last to be updated\nbefore a release since they need to accurately match the actual release.\nPretty much a waste of time in between...\n\n> Also are indexes working for floats when the query uses BETWEEN?\n\nProbably. The \"BETWEEN\" becomes an \"AND\" clause.\n", "msg_date": "Sat, 01 Aug 1998 01:20:15 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report - working" }, { "msg_contents": "\nOn 01-Aug-98 Thomas G. Lockhart wrote:\n>> The test machine (actually my desktop) has been running the cvsup'd\n>> version since I set ip up a couple of weeks ago. The production \n>> machine was running 6.3. The INSTALL file says dumping the db wasn't \n>> necessary yet I had to - it wouldn't run without it and complained \n>> about the older database. Is dumping going to be required for 6.4?\n> \n> Of course :)\n> \n> Also, things like the installation docs are the last to be updated\n> before a release since they need to accurately match the actual release.\n> Pretty much a waste of time in between...\n\nOk, that makes real good sense to me. Just something to learn when using\na cvsup'd version as opposed to a release.\n\n> \n>> Also are indexes working for floats when the query uses BETWEEN?\n> \n> Probably. The \"BETWEEN\" becomes an \"AND\" clause.\n\nUnfortunately I later found this:\n\n-----\ncampsites=> explain select name from camps3 where lon = 83.5555;\nNOTICE: QUERY PLAN:\n\nSeq Scan on camps3 (cost=822.87 size=1 width=12)\n\nEXPLAIN\ncampsites=> \n-----\n\nI have two or three indexes created for lon on camps3. \n\ncreate index camps3_lon on camps3 (lon); \ncreate index camps3_lon2 on camps3 (lon, float4_ops);\ncreate index camps3_loc on camps3 (lon, lat);\n\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] flame-mail: /dev/null\n # include <std/disclaimers.h> TEAM-OS2\n Online Searchable Campground Listings http://www.camping-usa.com\n \"There is no outfit less entitled to lecture me about bloat\n than the federal government\" -- Tony Snow\n==========================================================================\n\n\n", "msg_date": "Fri, 31 Jul 1998 21:21:44 -0400 (EDT)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status report - working" } ]
[ { "msg_contents": "Vadim, bright as always wrote: \n> ....\n>9. ObjExclusiveLock - acquired by DROP/ALTER.\n>\n>: SELECT doesn't aquire any type of lock except of \n> AccessSharedLock but this is short-term lock and would we\n> like disallow DROP TABLE that was read by some running\n> transaction ?\n\nI would say allow the drop table, of course only if no update or intent update (select for update) \nlock is on it. This is how Informix behaves. Otherwise it will become very hard to drop tables altogether.\n\nAndreas\n\n", "msg_date": "Fri, 31 Jul 1998 10:06:07 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "None" }, { "msg_contents": "Andreas Zeugswetter wrote:\n> \n> I would say allow the drop table, of course only if no update or \n> intent update (select for update) lock is on it. \n> This is how Informix behaves. Otherwise it will become very \n> hard to drop tables altogether.\n\nOk, currently, table can't be dropped if SELECTed by another\nrunning transaction.\n\nWould we like to change this ?!\n\nComments?\n\n---\n\nAlso, I have yet another test for Oracle locking/table\ndropping - help me please:\n\nCREATE TABLE test (x integer, y integer);\nINSERT INTO test VALUES (1, 1);\n\n1. In session T1 run\n\n LOCK TABLE test IN EXCLUSIVE MODE;\n\n2. In session T2 run\n\n UPDATE test SET y = 0 WHERE x = 0;\n\n -- shouldn't be blocked by T1 if ROW EXCLUSIVE\n -- lock is acquired by T2 only when row found\n\n3. Now again in session T1\n\n DROP TABLE test;\n\n -- will be this blocked ?\n\nTIA,\n\tVadim\n", "msg_date": "Sat, 01 Aug 1998 00:05:52 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Dropping tables..." }, { "msg_contents": "Vadim Mikheev wrote:\n> \n> Andreas Zeugswetter wrote:\n> >\n> > I would say allow the drop table, of course only if no update or\n> > intent update (select for update) lock is on it.\n> > This is how Informix behaves. Otherwise it will become very\n> > hard to drop tables altogether.\n> \n> Ok, currently, table can't be dropped if SELECTed by another\n> running transaction.\n> \n> Would we like to change this ?!\n\nDue to the lack of shared catalog cache I would like to\npreserve current behaviour:\n\nSystem catalogs are scanned by transaction once on first open\nof relation and so there is no way for trasnaction to know if\nrelation was dropped by another backend. If relation file\nwill not be closed by Virtual file descriptor code (fd.c)\nthen subsequent operations over relation will be ok \nelse -> elog(ERROR, \"cannot open _relation_\") from smgr.c \nor even worse if relation will be re-created in the meantime...\n\nWe wouldn't like these unpredictable results, yes ?\n\nVadim\n", "msg_date": "Sat, 01 Aug 1998 18:06:55 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Dropping tables..." }, { "msg_contents": "On Sat, Aug 01, 1998 at 12:05:52AM +0800, Vadim Mikheev wrote:\n> 1. In session T1 run\n> \n> LOCK TABLE test IN EXCLUSIVE MODE;\n> \n> 2. In session T2 run\n> \n> UPDATE test SET y = 0 WHERE x = 0;\n> \n> -- shouldn't be blocked by T1 if ROW EXCLUSIVE\n> -- lock is acquired by T2 only when row found\n\nBut it indeed is blocked.\n\n> 3. Now again in session T1\n> \n> DROP TABLE test;\n> \n> -- will be this blocked ?\n\nDROP TABLE test\n *\nERROR at line 1:\nORA-00054: resource busy and acquire with NOWAIT specified\n\nHowever, after this, the update call is executed. After a commit in T2, test\ncan be dropped.\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Sun, 2 Aug 1998 13:39:13 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Dropping tables..." }, { "msg_contents": "Thanks again, Michael!\n\n> > 1. In session T1 run\n> >\n> > LOCK TABLE test IN EXCLUSIVE MODE;\n> >\n> > 2. In session T2 run\n> >\n> > UPDATE test SET y = 0 WHERE x = 0;\n> >\n> > -- shouldn't be blocked by T1 if ROW EXCLUSIVE\n> > -- lock is acquired by T2 only when row found\n> \n> But it indeed is blocked.\n\nOk, I misunderstood Oracle documentation..\nBlocking means that T2 acquires ROW EXCLUSIVE table lock\n_before_ statement execution.\n\n> \n> > 3. Now again in session T1\n> >\n> > DROP TABLE test;\n> >\n> > -- will be this blocked ?\n> \n> DROP TABLE test\n> *\n> ERROR at line 1:\n> ORA-00054: resource busy and acquire with NOWAIT specified\n> \n> However, after this, the update call is executed. After a commit in T2, test\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nDROP TABLE commits transaction and releases EXCLUSIVE table lock...\n\n> can be dropped.\n\nNo matter was table _really_ modified or not, T2 holds ROW EXCLUSIVE\ntable lock untill COMMIT/ABORT.\n\nWell...\n\nVadim\n", "msg_date": "Mon, 03 Aug 1998 13:58:51 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Dropping tables..." } ]
[ { "msg_contents": "Vadim wrote:\n>Bruce Momjian wrote:\n>> \n>> I have succeeded in making OR clauses use indexes. I have not dealt\n>> with some of the more complex issues like x=3 or y=5 as Vadim mentioned,\n>> but at least it works.\n>> \n>> test=> select * from test where x=102532 or x=102533;\n>\n>But did you care about the case when two indices (on test(x) and\n>on test(y)) exist ?\n\nDo you mean using two indices in one access plan, or the decision which index to use ?\n\nI think the case Bruce has fixed was the most important for those \"alien MS Access users\" among us.\nThanks Bruce !\n\nAndreas\n\n", "msg_date": "Fri, 31 Jul 1998 10:51:43 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] OR clause status report" }, { "msg_contents": "Andreas Zeugswetter wrote:\n> \n> Vadim wrote:\n> >Bruce Momjian wrote:\n> >>\n> >> I have succeeded in making OR clauses use indexes. I have not dealt\n> >> with some of the more complex issues like x=3 or y=5 as Vadim mentioned,\n> >> but at least it works.\n> >>\n> >> test=> select * from test where x=102532 or x=102533;\n> >\n> >But did you care about the case when two indices (on test(x) and\n> >on test(y)) exist ?\n> \n> Do you mean using two indices in one access plan, or the decision which index to use ?\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nThis.\n\nVadim\n", "msg_date": "Fri, 31 Jul 1998 17:06:30 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] OR clause status report" }, { "msg_contents": "Vadim Mikheev wrote:\n> \n> Andreas Zeugswetter wrote:\n> >\n> > Vadim wrote:\n> > >Bruce Momjian wrote:\n> > >>\n> > >> I have succeeded in making OR clauses use indexes. I have not dealt\n> > >> with some of the more complex issues like x=3 or y=5 as Vadim mentioned,\n> > >> but at least it works.\n> > >>\n> > >> test=> select * from test where x=102532 or x=102533;\n> > >\n> > >But did you care about the case when two indices (on test(x) and\n> > >on test(y)) exist ?\n> >\n> > Do you mean using two indices in one access plan, \n> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> This.\n\nActually, I meant NOT USING indices if both exist, because of\ncurrently there is no check that tuples returned by second index \nwere not returned by first.\n\n> > or the decision which index to use ?\n\nEither both indices should be used or no one...\n\nAlso, Bruce, did you test the case (x = 5 or x > 4) ?\nWhat about (x = 5 or x = 5)? - I'm not sure does cnfify()\nget rid of duplicates or not...\n\nVadim\n", "msg_date": "Fri, 31 Jul 1998 22:02:59 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] OR clause status report" }, { "msg_contents": "> Andreas Zeugswetter wrote:\n> > \n> > Vadim wrote:\n> > >Bruce Momjian wrote:\n> > >>\n> > >> I have succeeded in making OR clauses use indexes. I have not dealt\n> > >> with some of the more complex issues like x=3 or y=5 as Vadim mentioned,\n> > >> but at least it works.\n> > >>\n> > >> test=> select * from test where x=102532 or x=102533;\n> > >\n> > >But did you care about the case when two indices (on test(x) and\n> > >on test(y)) exist ?\n> > \n> > Do you mean using two indices in one access plan, or the decision which index to use ?\n> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> This.\n\nYes. I still need to run some tests. Just wanted people to know I had\ngotten the trivial case working so far.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 31 Jul 1998 10:32:58 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] OR clause status report" }, { "msg_contents": "> Vadim Mikheev wrote:\n> > \n> > Andreas Zeugswetter wrote:\n> > >\n> > > Vadim wrote:\n> > > >Bruce Momjian wrote:\n> > > >>\n> > > >> I have succeeded in making OR clauses use indexes. I have not dealt\n> > > >> with some of the more complex issues like x=3 or y=5 as Vadim mentioned,\n> > > >> but at least it works.\n> > > >>\n> > > >> test=> select * from test where x=102532 or x=102533;\n> > > >\n> > > >But did you care about the case when two indices (on test(x) and\n> > > >on test(y)) exist ?\n> > >\n> > > Do you mean using two indices in one access plan, \n> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> > This.\n> \n> Actually, I meant NOT USING indices if both exist, because of\n> currently there is no check that tuples returned by second index \n> were not returned by first.\n> \n> > > or the decision which index to use ?\n> \n> Either both indices should be used or no one...\n> \n> Also, Bruce, did you test the case (x = 5 or x > 4) ?\n> What about (x = 5 or x = 5)? - I'm not sure does cnfify()\n> get rid of duplicates or not...\n\nIt does get rid of duplicates, and only uses indexes if ALL clauses have\nan availble index, but as you noted, x=5 or x > 4 must be handled. It\nworks now:\n\t\n\ttest=> select * from test where x >= 102665 or x= 102665;\n\t x\n\t------\n\t102665\n\t(1 row)\n\t\n\ttest=> explain select * from test where x >= 102665 or x= 102665;\n\tNOTICE: QUERY PLAN:\n\t\n\tIndex Scan using i_test on test (cost=1503.32 size=1 width=4)\n\nI do it with this code:\n\n ExecStoreTuple(tuple, /* tuple to store */\n slot, /* slot to store in */\n buffer, /* buffer associated with tuple */\n false); /* don't pfree */\n\n for (prev_index = 0; prev_index < indexstate->iss_IndexPtr;\n prev_index++)\n {\n if (ExecQual(nth(prev_index, node->indxqual),\n scanstate->cstate.cs_ExprContext))\n {\n prev_matches = true;\n break;\n }\n }\n if (!prev_matches)\n return slot;\n \n\nOn an index scan, I compare the qualifications of previous OR index\nscans, and return the row only if the current row does not match one of\nthe previous qualifications. Sounds like a winner. I have not yet\ncommitted this code to the CVS tree.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 1 Aug 1998 01:14:52 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] OR clause status report" } ]
[ { "msg_contents": "When running postgresql inside gdb, I have always found it difficult to\ndump out structures. Here is something I found, that I have added to\nthe developers FAQ:\n\n---------------------------------------------------------------------------\n\nYou can print nodes easily inside gdb. First, to disable output\ntruncation: \n\n\n (gdb) set print elements 0\n\n\nYou may then use either of the next two commands to print out List,\nNode, and structure contents. The first prints in a short format, and\nthe second in a long format: \n\n\n (gdb) call nodeToString(any_pointer)\n (gdb) call pprint(any_pointer)\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 31 Jul 1998 11:23:22 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "displaying debug info" } ]
[ { "msg_contents": "> how can I workaround a foreign key constraint (maybe using check constraint?, how?)\n> when do you think foreign key constraint will be implemented?\n\nIt's best to post questions to the Postgres mailing lists, since others\nmay have better answers than I. However, I think you can use \"triggers\"\nto mimic foreign key constraints. Look in the \"contrib\" area of the\ndistribution for examples. There is a change foreign keys will be in\nv6.5, perhaps in 6 months. There was talk of possibly having it earlier,\nbut I do not have access to my Postgres e-mail at work and can't\nremember if that is still true...\n\nGood luck.\n\n - Tom\n\n-- \nThomas Lockhart\nCaltech/JPL\nInterferometry Systems and Technology\n", "msg_date": "Fri, 31 Jul 1998 18:21:39 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": true, "msg_subject": "Re: postgreSQL foreign key constraint" } ]
[ { "msg_contents": "Hi,\n\nI was having trouble with user authentication, so I submerged myself in \nthe source (UTSL ie. Use The Source luke ;) to see if I could figure out \nwhat I was doing wrong:\n\nWhile using passwords stored in pg_shadow (pg_user), I cannot connect to \nthe backend using the 'password' authentication, I can connect using 'crypt'.\n\nNow, I found from the source that the routines that do crypt checking \nalso seem to support plain passwords. But this code is never used, \nbecause apparently uaCrypt is never set for 'password', while my \nunderstanding is that this should be set when there is no password-file \nspecified in pg_hba.conf.\n\nAlthoughcCheckPassword() seems to provide for this, it appears not to be \nworking.\n\nAnybody knows what's going on here? I intent to fire up a debugger here \nto see if I can figure out what's wrong, but thought asking first doesn't \ndo any harm.\n\nbtw. is there anywhere a good description on how control flows during \nthis phase of connecting? It all looks very difficult, with lots of \nfunction pointer being passed around etc.\n\nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Fri, 31 Jul 1998 21:23:10 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": true, "msg_subject": "User authentication bug?" }, { "msg_contents": "> Hi,\n> \n> I was having trouble with user authentication, so I submerged myself in \n> the source (UTSL ie. Use The Source luke ;) to see if I could figure out \n> what I was doing wrong:\n> \n> While using passwords stored in pg_shadow (pg_user), I cannot connect to \n> the backend using the 'password' authentication, I can connect using 'crypt'.\n> \n> Now, I found from the source that the routines that do crypt checking \n> also seem to support plain passwords. But this code is never used, \n> because apparently uaCrypt is never set for 'password', while my \n> understanding is that this should be set when there is no password-file \n> specified in pg_hba.conf.\n> \n> AlthoughcCheckPassword() seems to provide for this, it appears not to be \n> working.\n> \n> Anybody knows what's going on here? I intent to fire up a debugger here \n> to see if I can figure out what's wrong, but thought asking first doesn't \n> do any harm.\n> \n> btw. is there anywhere a good description on how control flows during \n> this phase of connecting? It all looks very difficult, with lots of \n> function pointer being passed around etc.\n\nYes, very confusing. Only Tom Lane understands it, I think. Maybe\nTatsuo too.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 31 Jul 1998 15:53:25 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] User authentication bug?" }, { "msg_contents": "On Fri, 31 Jul 1998, Bruce Momjian wrote:\n\n> > Hi,\n> > \n> > I was having trouble with user authentication, so I submerged myself in \n> > the source (UTSL ie. Use The Source luke ;) to see if I could figure out \n> > what I was doing wrong:\n> > \n> > While using passwords stored in pg_shadow (pg_user), I cannot connect to \n> > the backend using the 'password' authentication, I can connect using 'crypt'.\n> > \n> > Now, I found from the source that the routines that do crypt checking \n> > also seem to support plain passwords. But this code is never used, \n> > because apparently uaCrypt is never set for 'password', while my \n> > understanding is that this should be set when there is no password-file \n> > specified in pg_hba.conf.\n> > \n> > AlthoughcCheckPassword() seems to provide for this, it appears not to be \n> > working.\n> > \n> > Anybody knows what's going on here? I intent to fire up a debugger here \n> > to see if I can figure out what's wrong, but thought asking first doesn't \n> > do any harm.\n\nOK, I now know what's going on, at least at my home (I had this problem \non another server, dunno if it's caused by the same thing):\n\n\tI had a password longer than 8 characters in pg_shadow.\n\nwhen creating a user, postgres happily accepts more than 8 chars, and \nalso stores them. apparently libpq-fe (or psql, dunno) only sends 8 \nchars. And postgres internally (crypt_verify) also checks more than 8 \nchars. The password-field in pg_shadow is of type text, so it can contain \nvery long passwords.\n\n2 options: either make psql/libpq-fe send more than 8 chars (don't know if\nthe protocol can handle it), or make the strcmp() in crypt_verify() a\nstrncmp(). \n\nMan, this was confusing.....\n\n> > \n> > btw. is there anywhere a good description on how control flows during \n> > this phase of connecting? It all looks very difficult, with lots of \n> > function pointer being passed around etc.\n> \n> Yes, very confusing. Only Tom Lane understands it, I think. Maybe\n> Tatsuo too.\n\nI'm so happy to know this. It means I'm not stupid. But I think I get it \njust a little bit. There's a lot of handling there to be able to handle \nmore than 1 connection at a time, so therefore function pointers are \nstored to remember were the next input packet it supposed to be handled. \nIMO it would have been cleaner (ie. better readable) to have some \ninteger plus a dispatch routine (large switch{} statement) to do this. \nAlso much easier to debug I think.\n\nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Fri, 31 Jul 1998 22:05:40 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] User authentication bug?" }, { "msg_contents": "On Fri, 31 Jul 1998, Maarten Boekhold wrote:\n\n> Hi,\n> \n> I was having trouble with user authentication, so I submerged myself in \n> the source (UTSL ie. Use The Source luke ;) to see if I could figure out \n> what I was doing wrong:\n> \n> While using passwords stored in pg_shadow (pg_user), I cannot connect to \n> the backend using the 'password' authentication, I can connect using 'crypt'.\n\nUntil recently it was working. I'm not sure when or how it became broken,\nas I haven't had things working right since I upgraded the machine a\ncouple of weeks ago.\n\n> Now, I found from the source that the routines that do crypt checking \n> also seem to support plain passwords. But this code is never used, \n> because apparently uaCrypt is never set for 'password', while my \n> understanding is that this should be set when there is no password-file \n> specified in pg_hba.conf.\n\nThats right. I was looking through this part of the source when\nimplementing the authentication for JDBC. At that point it was going\nthough there.\n\nIt sounds like it could be higher up may be broken.\n\n> AlthoughcCheckPassword() seems to provide for this, it appears not to be \n> working.\n> \n> Anybody knows what's going on here? I intent to fire up a debugger here \n> to see if I can figure out what's wrong, but thought asking first doesn't \n> do any harm.\n> \n> btw. is there anywhere a good description on how control flows during \n> this phase of connecting? It all looks very difficult, with lots of \n> function pointer being passed around etc.\n> \n> Maarten\n> \n> _____________________________________________________________________________\n> | TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n> | Department of Electrical Engineering |\n> | Computer Architecture and Digital Technique section |\n> | [email protected] |\n> -----------------------------------------------------------------------------\n> \n> \n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Sat, 1 Aug 1998 09:18:42 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] User authentication bug?" }, { "msg_contents": "Maarten Boekhold <[email protected]> writes:\n> OK, I now know what's going on, at least at my home (I had this problem \n> on another server, dunno if it's caused by the same thing):\n> \tI had a password longer than 8 characters in pg_shadow.\n> when creating a user, postgres happily accepts more than 8 chars, and \n> also stores them. apparently libpq-fe (or psql, dunno) only sends 8 \n> chars.\n\nIt's not libpq's fault (at least not with the current sources).\nIt's psql's. psql.c had a hardwired limit of 8 characters on\nboth the username and the password. Ick.\n\nWith the attached patch, I have verified that long (> 8char anyway)\nusernames and passwords work correctly in both \"password\" and \"crypt\"\nauthorization mode. NOTE: at least on my machine, it seems that the\ncrypt() routines ignore the part of the password beyond 8 characters,\nso there's no security gain from longer passwords in crypt auth mode.\nBut they don't fail.\n\nThe login-related part of psql has apparently not been touched since\nroughly the fall of Rome ;-). It was going through huge pushups to\nget around the lack of username/login parameters to PQsetdb. I don't\nknow when PQsetdbLogin was added to libpq, but it's there now ... so\nI was able to rip out quite a lot of crufty code while I was at it.\n\nIt's possible that there are still bogus length limits on username\nor password in some of the other PostgreSQL user interfaces besides\npsql/libpq. I will leave it to other folks to check that code.\n\n\t\t\tregards, tom lane\n\n\n*** src/bin/psql/psql.c.orig\tSat Jul 18 14:34:14 1998\n--- src/bin/psql/psql.c\tSat Aug 1 20:34:47 1998\n***************\n*** 132,140 ****\n static int\tobjectDescription(PsqlSettings *pset, char *object);\n static int\trightsList(PsqlSettings *pset);\n static void prompt_for_password(char *username, char *password);\n- static char *\n- make_connect_string(char *host, char *port, char *dbname,\n- \t\t\t\t\tchar *username, char *password);\n \n static char *gets_noreadline(char *prompt, FILE *source);\n static char *gets_readline(char *prompt, FILE *source);\n--- 132,137 ----\n***************\n*** 1372,1406 ****\n \telse\n \t{\n \t\tPGconn\t *olddb = pset->db;\n- \t\tstatic char *userenv = NULL;\n- \t\tchar\t *old_userenv = NULL;\n \t\tconst char *dbparam;\n! \n! \t\tif (new_user != NULL)\n! \t\t{\n! \n! \t\t\t/*\n! \t\t\t * PQsetdb() does not allow us to specify the user, so we have\n! \t\t\t * to do it via PGUSER\n! \t\t\t */\n! \t\t\tif (userenv != NULL)\n! \t\t\t\told_userenv = userenv;\n! \t\t\tuserenv = malloc(strlen(\"PGUSER=\") + strlen(new_user) + 1);\n! \t\t\tsprintf(userenv, \"PGUSER=%s\", new_user);\n! \t\t\t/* putenv() may continue to use memory as part of environment */\n! \t\t\tputenv(userenv);\n! \t\t\t/* can delete old memory if we malloc'ed it */\n! \t\t\tif (old_userenv != NULL)\n! \t\t\t\tfree(old_userenv);\n! \t\t}\n \n \t\tif (strcmp(new_dbname, \"-\") != 0)\n \t\t\tdbparam = new_dbname;\n \t\telse\n \t\t\tdbparam = PQdb(olddb);\n \n! \t\tpset->db = PQsetdb(PQhost(olddb), PQport(olddb),\n! \t\t\t\t\t\t NULL, NULL, dbparam);\n \t\tif (!pset->quiet)\n \t\t{\n \t\t\tif (!new_user)\n--- 1369,1396 ----\n \telse\n \t{\n \t\tPGconn\t *olddb = pset->db;\n \t\tconst char *dbparam;\n! \t\tconst char *userparam;\n! \t\tconst char *pwparam;\n \n \t\tif (strcmp(new_dbname, \"-\") != 0)\n \t\t\tdbparam = new_dbname;\n \t\telse\n \t\t\tdbparam = PQdb(olddb);\n \n! \t\tif (new_user != NULL && strcmp(new_user, \"-\") != 0)\n! \t\t\tuserparam = new_user;\n! \t\telse\n! \t\t\tuserparam = PQuser(olddb);\n! \n! \t\t/* libpq doesn't provide an accessor function for the password,\n! \t\t * so we cheat here.\n! \t\t */\n! \t\tpwparam = olddb->pgpass;\n! \n! \t\tpset->db = PQsetdbLogin(PQhost(olddb), PQport(olddb),\n! \t\t\t\t\t\t\t\tNULL, NULL, dbparam, userparam, pwparam);\n! \n \t\tif (!pset->quiet)\n \t\t{\n \t\t\tif (!new_user)\n***************\n*** 2711,2726 ****\n \n \tif (settings.getPassword)\n \t{\n! \t\tchar\t\tusername[9];\n! \t\tchar\t\tpassword[9];\n! \t\tchar\t *connect_string;\n \n \t\tprompt_for_password(username, password);\n \n! \t\t/* now use PQconnectdb so we can pass these options */\n! \t\tconnect_string = make_connect_string(host, port, dbname, username, password);\n! \t\tsettings.db = PQconnectdb(connect_string);\n! \t\tfree(connect_string);\n \t}\n \telse\n \t\tsettings.db = PQsetdb(host, port, NULL, NULL, dbname);\n--- 2701,2713 ----\n \n \tif (settings.getPassword)\n \t{\n! \t\tchar\t\tusername[100];\n! \t\tchar\t\tpassword[100];\n \n \t\tprompt_for_password(username, password);\n \n! \t\tsettings.db = PQsetdbLogin(host, port, NULL, NULL, dbname,\n! \t\t\t\t\t\t\t\t username, password);\n \t}\n \telse\n \t\tsettings.db = PQsetdb(host, port, NULL, NULL, dbname);\n***************\n*** 2730,2736 ****\n \tif (PQstatus(settings.db) == CONNECTION_BAD)\n \t{\n \t\tfprintf(stderr, \"Connection to database '%s' failed.\\n\", dbname);\n! \t\tfprintf(stderr, \"%s\", PQerrorMessage(settings.db));\n \t\tPQfinish(settings.db);\n \t\texit(1);\n \t}\n--- 2717,2723 ----\n \tif (PQstatus(settings.db) == CONNECTION_BAD)\n \t{\n \t\tfprintf(stderr, \"Connection to database '%s' failed.\\n\", dbname);\n! \t\tfprintf(stderr, \"%s\\n\", PQerrorMessage(settings.db));\n \t\tPQfinish(settings.db);\n \t\texit(1);\n \t}\n***************\n*** 2964,2969 ****\n--- 2951,2957 ----\n static void\n prompt_for_password(char *username, char *password)\n {\n+ \tchar buf[512];\n \tint\t\t\tlength;\n \n #ifdef HAVE_TERMIOS_H\n***************\n*** 2973,2985 ****\n #endif\n \n \tprintf(\"Username: \");\n! \tfgets(username, 9, stdin);\n \tlength = strlen(username);\n \t/* skip rest of the line */\n \tif (length > 0 && username[length - 1] != '\\n')\n \t{\n- \t\tstatic char buf[512];\n- \n \t\tdo\n \t\t{\n \t\t\tfgets(buf, 512, stdin);\n--- 2961,2971 ----\n #endif\n \n \tprintf(\"Username: \");\n! \tfgets(username, 100, stdin);\n \tlength = strlen(username);\n \t/* skip rest of the line */\n \tif (length > 0 && username[length - 1] != '\\n')\n \t{\n \t\tdo\n \t\t{\n \t\t\tfgets(buf, 512, stdin);\n***************\n*** 2995,3001 ****\n \tt.c_lflag &= ~ECHO;\n \ttcsetattr(0, TCSADRAIN, &t);\n #endif\n! \tfgets(password, 9, stdin);\n #ifdef HAVE_TERMIOS_H\n \ttcsetattr(0, TCSADRAIN, &t_orig);\n #endif\n--- 2981,2987 ----\n \tt.c_lflag &= ~ECHO;\n \ttcsetattr(0, TCSADRAIN, &t);\n #endif\n! \tfgets(password, 100, stdin);\n #ifdef HAVE_TERMIOS_H\n \ttcsetattr(0, TCSADRAIN, &t_orig);\n #endif\n***************\n*** 3004,3011 ****\n \t/* skip rest of the line */\n \tif (length > 0 && password[length - 1] != '\\n')\n \t{\n- \t\tstatic char buf[512];\n- \n \t\tdo\n \t\t{\n \t\t\tfgets(buf, 512, stdin);\n--- 2990,2995 ----\n***************\n*** 3015,3077 ****\n \t\tpassword[length - 1] = '\\0';\n \n \tprintf(\"\\n\\n\");\n- }\n- \n- static char *\n- make_connect_string(char *host, char *port, char *dbname,\n- \t\t\t\t\tchar *username, char *password)\n- {\n- \tint\t\t\tconnect_string_len = 0;\n- \tchar\t *connect_string;\n- \n- \tif (host)\n- \t\tconnect_string_len += 6 + strlen(host); /* 6 == \"host=\" + \" \" */\n- \tif (username)\n- \t\tconnect_string_len += 6 + strlen(username);\t\t/* 6 == \"user=\" + \" \" */\n- \tif (password)\n- \t\tconnect_string_len += 10 + strlen(password);\t/* 10 == \"password=\" + \"\n- \t\t\t\t\t\t\t\t\t\t\t\t\t\t * \" */\n- \tif (port)\n- \t\tconnect_string_len += 6 + strlen(port); /* 6 == \"port=\" + \" \" */\n- \tif (dbname)\n- \t\tconnect_string_len += 8 + strlen(dbname);\t\t/* 8 == \"dbname=\" + \" \" */\n- \tconnect_string_len += 18;\t/* \"authtype=password\" + null */\n- \n- \tconnect_string = (char *) malloc(connect_string_len);\n- \tif (!connect_string)\n- \t\treturn 0;\n- \tconnect_string[0] = '\\0';\n- \tif (host)\n- \t{\n- \t\tstrcat(connect_string, \"host=\");\n- \t\tstrcat(connect_string, host);\n- \t\tstrcat(connect_string, \" \");\n- \t}\n- \tif (username)\n- \t{\n- \t\tstrcat(connect_string, \"user=\");\n- \t\tstrcat(connect_string, username);\n- \t\tstrcat(connect_string, \" \");\n- \t}\n- \tif (password)\n- \t{\n- \t\tstrcat(connect_string, \"password=\");\n- \t\tstrcat(connect_string, password);\n- \t\tstrcat(connect_string, \" \");\n- \t}\n- \tif (port)\n- \t{\n- \t\tstrcat(connect_string, \"port=\");\n- \t\tstrcat(connect_string, port);\n- \t\tstrcat(connect_string, \" \");\n- \t}\n- \tif (dbname)\n- \t{\n- \t\tstrcat(connect_string, \"dbname=\");\n- \t\tstrcat(connect_string, dbname);\n- \t\tstrcat(connect_string, \" \");\n- \t}\n- \tstrcat(connect_string, \"authtype=password\");\n- \n- \treturn connect_string;\n }\n--- 2999,3002 ----\n", "msg_date": "Sat, 01 Aug 1998 21:20:17 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] User authentication bug? " }, { "msg_contents": "Maarten Boekhold <[email protected]> writes:\n> I'm so happy to know this. It means I'm not stupid. But I think I get it \n> just a little bit. There's a lot of handling there to be able to handle \n> more than 1 connection at a time, so therefore function pointers are \n> stored to remember were the next input packet it supposed to be handled. \n\nRight, the postmaster keeps a function pointer in the data for each\nconnection (specifically, in the Packet struct declared in libpq-be.h)\nthat defines what to do next on that connection (\"next\" meaning after\nthe current packet send or receive operation has been finished).\nIt can be a little confusing but I doubt it's worth changing.\n\n(On the other hand, I'm used to that sort of thing from a dank past\nof writing interrupt service routines. If you're not, it might be\na lot confusing.)\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 01 Aug 1998 21:27:17 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] User authentication bug? " }, { "msg_contents": "On Sat, 1 Aug 1998, Tom Lane wrote:\n\n> Maarten Boekhold <[email protected]> writes:\n> > OK, I now know what's going on, at least at my home (I had this problem \n> > on another server, dunno if it's caused by the same thing):\n> > \tI had a password longer than 8 characters in pg_shadow.\n> > when creating a user, postgres happily accepts more than 8 chars, and \n> > also stores them. apparently libpq-fe (or psql, dunno) only sends 8 \n> > chars.\n> \n> It's not libpq's fault (at least not with the current sources).\n> It's psql's. psql.c had a hardwired limit of 8 characters on\n> both the username and the password. Ick.\n> \n> With the attached patch, I have verified that long (> 8char anyway)\n> usernames and passwords work correctly in both \"password\" and \"crypt\"\n> authorization mode. NOTE: at least on my machine, it seems that the\n> crypt() routines ignore the part of the password beyond 8 characters,\n> so there's no security gain from longer passwords in crypt auth mode.\n> But they don't fail.\n....\n> \n> It's possible that there are still bogus length limits on username\n> or password in some of the other PostgreSQL user interfaces besides\n> psql/libpq. I will leave it to other folks to check that code.\n\nI think the perl-module behaves the same, but I'm not totally sure about \nit. I have a script where passing a 9 chars username to PQconnectdb() \nfails to connect to a backend, while if I truncate the username to 8 \nchars it works.\n\nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Sun, 2 Aug 1998 13:42:29 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] User authentication bug?" }, { "msg_contents": "Tom Lane <[email protected]> writes:\n\n> With the attached patch, I have verified that long (> 8char anyway)\n> usernames and passwords work correctly in both \"password\" and \"crypt\"\n> authorization mode. NOTE: at least on my machine, it seems that the\n> crypt() routines ignore the part of the password beyond 8 characters,\n> so there's no security gain from longer passwords in crypt auth mode.\n> But they don't fail.\n\nWhich is why postgres should use MD5, salted with the username, as a\npassword one-way hash. :)\n\n--Michael\n", "msg_date": "02 Aug 1998 12:54:57 -0700", "msg_from": "Michael Graff <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [PATCHES] Re: [HACKERS] User authentication bug?" }, { "msg_contents": "Maarten Boekhold <[email protected]> writes:\n> On Sat, 1 Aug 1998, Tom Lane wrote:\n>> It's possible that there are still bogus length limits on username\n>> or password in some of the other PostgreSQL user interfaces besides\n>> psql/libpq. I will leave it to other folks to check that code.\n\n> I think the perl-module behaves the same, but I'm not totally sure about \n> it. I have a script where passing a 9 chars username to PQconnectdb() \n> fails to connect to a backend, while if I truncate the username to 8 \n> chars it works.\n\nHmm. What pgsql version are you using? A quick glance at\nsrc/interfaces/perl5 doesn't show any dependencies on username or\npassword length in it --- it's just a very simple wrapper for libpq.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 02 Aug 1998 18:40:28 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [INTERFACES] Re: [HACKERS] User authentication bug? " }, { "msg_contents": "On Sun, 2 Aug 1998, Tom Lane wrote:\n\n> Maarten Boekhold <[email protected]> writes:\n> > On Sat, 1 Aug 1998, Tom Lane wrote:\n> >> It's possible that there are still bogus length limits on username\n> >> or password in some of the other PostgreSQL user interfaces besides\n> >> psql/libpq. I will leave it to other folks to check that code.\n> \n> > I think the perl-module behaves the same, but I'm not totally sure about \n> > it. I have a script where passing a 9 chars username to PQconnectdb() \n> > fails to connect to a backend, while if I truncate the username to 8 \n> > chars it works.\n> \n> Hmm. What pgsql version are you using? A quick glance at\n> src/interfaces/perl5 doesn't show any dependencies on username or\n> password length in it --- it's just a very simple wrapper for libpq.\n\nI'll have a quick try to see if it indeed does behave this way. Get back \nto you later.\n\nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Mon, 3 Aug 1998 08:30:17 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [INTERFACES] Re: [HACKERS] User authentication bug?" }, { "msg_contents": "On Sun, 2 Aug 1998, Tom Lane wrote:\n\n> Maarten Boekhold <[email protected]> writes:\n> > On Sat, 1 Aug 1998, Tom Lane wrote:\n> >> It's possible that there are still bogus length limits on username\n> >> or password in some of the other PostgreSQL user interfaces besides\n> >> psql/libpq. I will leave it to other folks to check that code.\n> \n> > I think the perl-module behaves the same, but I'm not totally sure about \n> > it. I have a script where passing a 9 chars username to PQconnectdb() \n> > fails to connect to a backend, while if I truncate the username to 8 \n> > chars it works.\n> \n> Hmm. What pgsql version are you using? A quick glance at\n> src/interfaces/perl5 doesn't show any dependencies on username or\n> password length in it --- it's just a very simple wrapper for libpq.\n\nI've tried it (wrote a little script to test it), and I got the following:\n\nlength(usename) == 9 : connect with usename of 9 : failed\nlength(usename) == 9 : connect with usename of 8 : failed\nlength(usename) == 8 : connect with usename of 9 : failed\nlength(usename) == 8 : connect with usename of 8 : succeeded\n\nso it appears not to be working somehow...\n\nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Mon, 3 Aug 1998 08:40:03 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [INTERFACES] Re: [HACKERS] User authentication bug?" } ]
[ { "msg_contents": "While testing my 6.4 patch to allow functions/expressions to be\nspecified in the ORDER/GROUP BY clause (and not in the target list) I\ncame across a nasty little bug. A segmentation fault gets thrown\nsomewhere in replace_agg_clause() when using aggregates, in combination\nwith a function or expression. (I am still tracking down the\noffending lines of code. Sorry, the Linux/GCC environment is still new\nto me.)\n\nI backed out my patch, and discovered the bug was still present. The\nbug does not exist in version 6.3.2. Here is an example:\n\n-- This crashes the backend\n select upper(a) as x, count(k) from t group by x;\n\n-- This works fine\n select upper(a) as x, count(a) from t group by x;\n\nNotice how in the first query, (the one that does not work) upper() has\na different argument than count(). And in the second query (the one\nthat works) upper() has the same argument as count(). When using\ncount(*) it will always fail.\n\nThis is the the pattern that I have observed. If the arguments in the\naggregate and non-aggregate functions are the same, it runs; if the\narguments in the aggregate and non-aggregate functions are different, it\ncrashes.\n\nI have attached a test script for anyone able to help with (or verify)\nthis problem.", "msg_date": "Sat, 01 Aug 1998 05:19:43 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": true, "msg_subject": "6.4 Aggregate Bug" }, { "msg_contents": "David Hartwig wrote:\n> \n> While testing my 6.4 patch to allow functions/expressions to be\n> specified in the ORDER/GROUP BY clause (and not in the target list) I\n\n\nwill this patch allow the following syntax :\n\n select count(SUBSTR(var,1,5)), SUBSTR(var,1,5) from t group by SUBSTR(var,1,5);\n\nThis is important for writing database-independent code (e.g. it's the only\nsyntax Oracle understands).\n\nEdmund\n-- \nEdmund Mergl mailto:[email protected]\nIm Haldenhau 9 http://www.bawue.de/~mergl\n70565 Stuttgart fon: +49 711 747503\nGermany\n", "msg_date": "Sat, 01 Aug 1998 16:04:26 +0200", "msg_from": "Edmund Mergl <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 6.4 Aggregate Bug" }, { "msg_contents": "> While testing my 6.4 patch to allow functions/expressions to be\n> specified in the ORDER/GROUP BY clause (and not in the target list) I\n> came across a nasty little bug.\n> I backed out my patch, and discovered the bug was still present. The\n> bug does not exist in version 6.3.2.\n\nNor in my cvs tree from around the second week in July (on or before\nJuly 9, with a few patches committed to the Postgres tree afterwards).\nHaven't tried a current source tree...\n\n - Tom\n\n> \n> -- This crashes the backend\n> select upper(a) as x, count(k) from t group by x;\n\ntgl=> create table t (a text, k int);\nCREATE\ntgl=> select upper(a) as x, count(k) from t group by x;\nx|count\n-+-----\n | 0\n(1 row)\n\ntgl=> insert into t values ('one', 1);\nINSERT 643434 1\ntgl=> insert into t values ('two', 2);\nINSERT 643435 1\ntgl=> insert into t values ('two', 2);\nINSERT 643436 1\ntgl=> select upper(a) as x, count(k) from t group by x;\nx |count\n---+-----\nONE| 1\nTWO| 2\n(2 rows)\n\nAnd with your test case instead:\n\ntgl=> select upper(a) as x, count(k) from t group by x;\nx|count\n-+-----\nA| 4\nB| 3\nC| 3\n(3 rows)\n", "msg_date": "Sat, 01 Aug 1998 14:36:12 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 6.4 Aggregate Bug" }, { "msg_contents": "Edmund Mergl wrote:\n\n> David Hartwig wrote:\n> >\n> > While testing my 6.4 patch to allow functions/expressions to be\n> > specified in the ORDER/GROUP BY clause (and not in the target list) I\n>\n> will this patch allow the following syntax :\n>\n> select count(SUBSTR(var,1,5)), SUBSTR(var,1,5) from t group by SUBSTR(var,1,5);\n>\n> This is important for writing database-independent code (e.g. it's the only\n> syntax Oracle understands).\n>\n>\n\nYES. It also handles expressions like \"x / 2\". Also, the functions (or\nexpressions) need not be in the target list.\n\n", "msg_date": "Sat, 01 Aug 1998 15:32:18 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] 6.4 Aggregate Bug" }, { "msg_contents": "> While testing my 6.4 patch to allow functions/expressions to be\n> specified in the ORDER/GROUP BY clause (and not in the target list) I\n> came across a nasty little bug. A segmentation fault gets thrown\n> somewhere in replace_agg_clause() when using aggregates, in combination\n> with a function or expression. (I am still tracking down the\n> offending lines of code. Sorry, the Linux/GCC environment is still new\n> to me.)\n> \n> I backed out my patch, and discovered the bug was still present. The\n> bug does not exist in version 6.3.2. Here is an example:\n> \n> -- This crashes the backend\n> select upper(a) as x, count(k) from t group by x;\n> \n> -- This works fine\n> select upper(a) as x, count(a) from t group by x;\n> \n> Notice how in the first query, (the one that does not work) upper() has\n> a different argument than count(). And in the second query (the one\n> that works) upper() has the same argument as count(). When using\n> count(*) it will always fail.\nHere is my initial analysis of the crash. It appears the types do not\nmatch. Not sure why.\n\n\n---------------------------------------------------------------------------\n\n\tPOSTGRES backend interactive interface\n\t$Revision: 1.80 $ $Date: 1998/07/18 18:34:09 $\n\t> select upper(a) as x, count(xmin) from t group by x;\n\t StartTransactionCommand() at Sat Aug 1 14:55:16 1998\n\t\n\t\n\tBreakpoint 1, match_varid (test_var=0x305010, tlist=0x303750) at\n\ttlist.c:270\n\t270 type_var = (Oid) test_var->vartype;\n\t(gdb)\n\t(gdb) cont\n\tContinuing.\n\t\n\tBreakpoint 1, match_varid (test_var=0x305110, tlist=0x303750) at\n\ttlist.c:270\n\t270 type_var = (Oid) test_var->vartype;\n\t(gdb) cont\n\tContinuing.\n\t\n\tBreakpoint 1, match_varid (test_var=0x3048d0, tlist=0x303ad0) at\n\ttlist.c:270\n\t270 type_var = (Oid) test_var->vartype;\n\t(gdb) l\n\t265 match_varid(Var *test_var, List *tlist)\n\t266 {\n\t267 List *tl;\n\t268 Oid type_var;\n\t269\n\t270 type_var = (Oid) test_var->vartype;\n\t271\n\t272 Assert(test_var->varlevelsup == 0);\n\t273 foreach(tl, tlist)\n\t274 {\n\t(gdb) call pprint(test_var)\n\t{ VAR\n\t :varno 1\n\t :varattno 3\n\t :vartype 1043\n\t :vartypmod -1\n\t :varlevelsup 0\n\t :varnoold 1\n\t :varoattno 3\n\t }\n\t(gdb) call pprint(tlist)\n\t(\n\t { TARGETENTRY\n\t :resdom\n\t { RESDOM\n\t :resno 1\n\t :restype 25\n\t :restypmod -1\n\t :resname \"x\"\n\t :reskey 1\n\t :reskeyop 740\n\t :resjunk 0\n\t }\n\t\n\t :expr\n\t { VAR\n\t :varno 1\n\t :varattno 1\n\t :vartype 25\n\t :vartypmod -1\n\t :varlevelsup 0\n\t :varnoold -1\n\t :varoattno 1\n\t }\n\t }\n\t\n\t { TARGETENTRY\n\t :resdom\n\t { RESDOM\n\t :resno 2\n\t :restype 28\n\t :restypmod -1\n\t :resname \"(null)\n\t \"\n\t :reskey 0\n\t :reskeyop 0\n\t :resjunk 0\n\t }\n\t\n\t :expr\n\t { VAR\n\t :varno 1\n\t :varattno 2\n\t :vartype 28\n\t :vartypmod -1\n\t :varlevelsup 0\n\t :varnoold 1\n\t :varoattno -3\n\t }\n\t }\n\t)\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 1 Aug 1998 16:12:21 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 6.4 Aggregate Bug" }, { "msg_contents": "> > While testing my 6.4 patch to allow functions/expressions to be\n> > specified in the ORDER/GROUP BY clause (and not in the target list) I\n> > came across a nasty little bug.\n> > I backed out my patch, and discovered the bug was still present. The\n> > bug does not exist in version 6.3.2.\n> \n> Nor in my cvs tree from around the second week in July (on or before\n> July 9, with a few patches committed to the Postgres tree afterwards).\n> Haven't tried a current source tree...\n\nCan someone CVS back in time to find the date it broke?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 1 Aug 1998 17:38:22 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 6.4 Aggregate Bug" }, { "msg_contents": "> > > While testing my 6.4 patch I\n> > > came across a nasty little bug.\n> > Nor in my cvs tree from around the second week in July...\n> > Haven't tried a current source tree...\n> Can someone CVS back in time to find the date it broke?\n\nI haven't done that yet. I _did_ do a CVSup just now and in the parser\narea I do have an uncommitted patch for parse_clause.c in the\ntransformSortClause() routine. It was to help with type matching on\nwhatever Bruce and I were fixing a couple of weeks ago, before the docs\nand Applix/iodbc became a higher priority. Anyway, don't know if that is\nhelping David's symptoms or not, or whether the breakage is in another\npart of the code. Nothing else is any different in the parser area of\nthe code (except for gram.c, which shouldn't be an issue?).\n\nI'll go ahead and commit the code tonight or tomorrow and then David or\nyou can see if it helps. Will post some e-mail when it happens...\n\n - Tom\n", "msg_date": "Sun, 02 Aug 1998 04:21:05 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 6.4 Aggregate Bug" }, { "msg_contents": "> I'll go ahead and commit the code tonight or tomorrow...\n\nOK, I committed the patches. They fix the\n\nSELECT NULL ORDER BY 1\n\nquery problem, but do assign types for cases where they aren't assigned\nin the transformSortClause() procedure so may touch what David is\ndoing??\n\nPatch enclosed, but the cvs tree already has it too.\n\n - Tom", "msg_date": "Sun, 02 Aug 1998 13:47:25 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 6.4 Aggregate Bug" }, { "msg_contents": "\n\nThomas G. Lockhart wrote:\n\n> > I'll go ahead and commit the code tonight or tomorrow...\n>\n> OK, I committed the patches. They fix the\n>\n> SELECT NULL ORDER BY 1\n>\n> query problem, but do assign types for cases where they aren't assigned\n> in the transformSortClause() procedure so may touch what David is\n> doing??\n\nWell if you meant that maybe it would fix the aggragate bug...no such luck. :( I will go ahead and submit my patch\nsoon. I would like to get it out for review and use. (Right now, I am busy updating my system to its knees)\n\nBTW, The bug has nothing to do with my patch. Except it does steal some of its thunder, by rendering a significant\nportion of the newly available queries unusable.\n\n", "msg_date": "Sun, 02 Aug 1998 20:15:48 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] 6.4 Aggregate Bug" } ]
[ { "msg_contents": "\nVadim, would you please review this code, and let me know if it is\ncorrect. I am unsure about the calls to ExecStoreTuple(), ExecQual()\n(is proper context used?), and placement of ReleaseBuffer(). Do I need\nto free the tuple buffer if I decide it doesn't meet my ExecQual test?\n\nYou will see the old code, then the new for IndexNext().\n\n---------------------------------------------------------------------------\n\n\n***************\n*** 120,155 ****\n * appropriate heap tuple.. else return NULL.\n * ----------------\n */\n! while ((result = index_getnext(scandesc, direction)) != NULL)\n {\n! tuple = heap_fetch(heapRelation, false, &result->heap_iptr, &buffer);\n! /* be tidy */\n! pfree(result);\n!\n! if (tuple != NULL)\n {\n! /* ----------------\n! * store the scanned tuple in the scan tuple slot of\n! * the scan state. Eventually we will only do this and not\n! * return a tuple. Note: we pass 'false' because tuples\n! * returned by amgetnext are pointers onto disk pages and\n! * were not created with palloc() and so should not be pfree()'d.\n! * ----------------\n! */\n! ExecStoreTuple(tuple, /* tuple to store */\n! slot, /* slot to store in */\n! buffer, /* buffer associated with tuple */\n! false); /* don't pfree */\n!\n! return slot;\n! }\n! else\n! {\n if (BufferIsValid(buffer))\n ReleaseBuffer(buffer);\n }\n }\n-\n /* ----------------\n * if we get here it means the index scan failed so we\n * are at the end of the scan..\n--- 119,170 ----\n * appropriate heap tuple.. else return NULL.\n * ----------------\n */\n! while (indexstate->iss_IndexPtr < numIndices)\n {\n! scandesc = scanDescs[indexstate->iss_IndexPtr];\n! while ((result = index_getnext(scandesc, direction)) != NULL)\n {\n! tuple = heap_fetch(heapRelation, false, &result->heap_iptr, &buffer);\n! /* be tidy */\n! pfree(result);\n!\n! if (tuple != NULL)\n! {\n! bool prev_matches = false;\n! int prev_index;\n!\n! /* ----------------\n! * store the scanned tuple in the scan tuple slot of\n! * the scan state. Eventually we will only do this and not\n! * return a tuple. Note: we pass 'false' because tuples\n! * returned by amgetnext are pointers onto disk pages and\n! * were not created with palloc() and so should not be pfree()'d.\n! * ----------------\n! */\n! ExecStoreTuple(tuple, /* tuple to store */\n! slot, /* slot to store in */\n! buffer, /* buffer associated with tuple */\n! false); /* don't pfree */\n!\n! for (prev_index = 0; prev_index < indexstate->iss_IndexPtr;\n! prev_index++)\n! {\n! if (ExecQual(nth(prev_index, node->indxqual),\n! scanstate->cstate.cs_ExprContext))\n! {\n! prev_matches = true;\n! break;\n! }\n! }\n! if (!prev_matches)\n! return slot;\n! }\n if (BufferIsValid(buffer))\n ReleaseBuffer(buffer);\n }\n+ if (indexstate->iss_IndexPtr < numIndices)\n+ indexstate->iss_IndexPtr++;\n }\n /* ----------------\n * if we get here it means the index scan failed so we\n * are at the end of the scan..\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 1 Aug 1998 06:55:16 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "OR clause - check code" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> Vadim, would you please review this code, and let me know if it is\n> correct. I am unsure about the calls to ExecStoreTuple(), ExecQual()\n> (is proper context used?), and placement of ReleaseBuffer(). Do I need\n ^^^^^^^^^^^^^^^^^^^^^^\nYes.\nexecScan.c:ExecScan() sets econtext->ecxt_scantuple = slot <--\nreturned by Seq/Index scan -- before check Scan qual and\nso econtext->ecxt_scantuple already points to the slot where \nyou store new tuple. It seems that no one change this pointer...\n\nBut did you try to use multi-index scan in inner plan of\nNestloop? It seems that you should add this to ExecIndexReScan():\n\nif (exprCtxt != NULL)\n node->scan.scanstate->cstate.cs_ExprContext->ecxt_outertuple = \n exprCtxt->ecxt_outertuple;\n\nAlso, ExecIndexReScan() evaluates run-time keys for _current_\nindex scan only - this must be changed and indexstate->iss_IndexPtr\nmust be setted to 0.\n\n> to free the tuple buffer if I decide it doesn't meet my ExecQual test?\n\nYes, you have to free buffer.\n\nVadim\n", "msg_date": "Sat, 01 Aug 1998 19:51:54 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause - check code" }, { "msg_contents": "> Bruce Momjian wrote:\n> > \n> > Vadim, would you please review this code, and let me know if it is\n> > correct. I am unsure about the calls to ExecStoreTuple(), ExecQual()\n> > (is proper context used?), and placement of ReleaseBuffer(). Do I need\n> ^^^^^^^^^^^^^^^^^^^^^^\n> Yes.\n> execScan.c:ExecScan() sets econtext->ecxt_scantuple = slot <--\n> returned by Seq/Index scan -- before check Scan qual and\n> so econtext->ecxt_scantuple already points to the slot where \n> you store new tuple. It seems that no one change this pointer...\n> \n> But did you try to use multi-index scan in inner plan of\n> Nestloop? It seems that you should add this to ExecIndexReScan():\n\nNo. I just don't understand the behavior of the various join types on\nindex use.\n\n> \n> if (exprCtxt != NULL)\n> node->scan.scanstate->cstate.cs_ExprContext->ecxt_outertuple = \n> exprCtxt->ecxt_outertuple;\n\nAdded.\n\n> \n> Also, ExecIndexReScan() evaluates run-time keys for _current_\n> index scan only - this must be changed and indexstate->iss_IndexPtr\n> must be setted to 0.\n\nI have added this to the code.\n\n> > to free the tuple buffer if I decide it doesn't meet my ExecQual test?\n> \n> Yes, you have to free buffer.\n\nDone.\n\nVadim, I am going to send you the current nodeIndexscan.c for your\nreview, to make sure I made the proper changes.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 1 Aug 1998 13:13:56 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR clause - check code" } ]
[ { "msg_contents": "Here is a comment in path/indxpath.c that says they don't want to use\nmulti-key indexes with OR clauses. Of course, we now support multi-key\nindexes, and this code was disabled anyway because it was broken. (In\nfact, it was disabled by having SingleAttributeIndex() always return\nfalse.\n\nIs there any reason we can't use multi-key indexes if the first key\nmatches our OR column? I don't see why not. Also, I don't know how to\nhandle the case where we specify the first key of a multi-key index in\nan AND clause, and specify the second key in an OR clause because the\nAND's are handled in a separate are of the code. Any ideas how to\nimplement this? (Of course, the code would still use the index for the\nAND, but I don't know how to bring the AND case into my OR index clause\nprocessing area.)\n\n---------------------------------------------------------------------------\n\n\n /*\n * 1. If this index has only one key, try matching it against\n * subclauses of an 'or' clause. The fields of the clauseinfo nodes\n * are marked with lists of the matching indices no path are actually\n * created.\n *\n * XXX NOTE: Currently btrees dos not support indices with > 1 key, so\n * the following test will always be true for now but we have decided\n * not to support index-scans on disjunction . -- lp\n */\n if (SingleAttributeIndex(index))\n {\n \n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 1 Aug 1998 07:33:20 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "OR with multi-key indexes" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> Here is a comment in path/indxpath.c that says they don't want to use\n> multi-key indexes with OR clauses. Of course, we now support multi-key\n> indexes, and this code was disabled anyway because it was broken. (In\n> fact, it was disabled by having SingleAttributeIndex() always return\n> false.\n> \n> Is there any reason we can't use multi-key indexes if the first key\n> matches our OR column? I don't see why not. Also, I don't know how to\n ^^^^^^^^^^^^^^^^^^^\nMe too.\n\n> handle the case where we specify the first key of a multi-key index in\n> an AND clause, and specify the second key in an OR clause because the\n\nWhat do you mean? Example please...\n\n> AND's are handled in a separate are of the code. Any ideas how to\n> implement this? (Of course, the code would still use the index for the\n> AND, but I don't know how to bring the AND case into my OR index clause\n> processing area.)\n\nVadim\n", "msg_date": "Sat, 01 Aug 1998 20:12:18 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" }, { "msg_contents": "> Bruce Momjian wrote:\n> > \n> > Here is a comment in path/indxpath.c that says they don't want to use\n> > multi-key indexes with OR clauses. Of course, we now support multi-key\n> > indexes, and this code was disabled anyway because it was broken. (In\n> > fact, it was disabled by having SingleAttributeIndex() always return\n> > false.\n> > \n> > Is there any reason we can't use multi-key indexes if the first key\n> > matches our OR column? I don't see why not. Also, I don't know how to\n> ^^^^^^^^^^^^^^^^^^^\n> Me too.\n\nGood. Code restriction removed.\n\n> \n> > handle the case where we specify the first key of a multi-key index in\n> > an AND clause, and specify the second key in an OR clause because the\n> \n> What do you mean? Example please...\n> \n> > AND's are handled in a separate are of the code. Any ideas how to\n> > implement this? (Of course, the code would still use the index for the\n> > AND, but I don't know how to bring the AND case into my OR index clause\n> > processing area.)\n\n\tcreate table test (x int4, y int4);\n\tcreate index i_test on test(x,y);\n\tinsert into test values(1,2);\n\tselect * from test where x=3 and (y=1 or y=2);\n\nThis is going to use the i_test index, but only with key x=3, and do a\nscan of the index looking for y=1 or y=2, and will not use the second\nkey of the index.\n\nI don't know how to pass information to the OR code so it will know the\nfirst part of the index is matched, and it can compare the second key.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 1 Aug 1998 11:29:40 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> create table test (x int4, y int4);\n> create index i_test on test(x,y);\n> insert into test values(1,2);\n> select * from test where x=3 and (y=1 or y=2);\n> \n> This is going to use the i_test index, but only with key x=3, and do a\n> scan of the index looking for y=1 or y=2, and will not use the second\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nServer will fetch heap tuple for each tuple with x = 3 \nreturned by index access methods and call ExecQual...\n\n> key of the index.\n\nThere are two ways.\n\nI. Rewrite this into\n\n(x = 3 and y = 1) or (x = 3 and y = 2)\n\nand scan index twice using both keys for finding index tuples.\n\nII. Extend multi-key indexing: (y = 1 or y = 2) could be\nqualified by index access methods itself because of Y is\none of index keys. Only first key would be used for finding\nindex tuples but additional qualification could decrease\nnumber of heap_fetch calls and this would be nice!\n\nThis feature would be also usefull for:\n\ncreate index on table (a,b,c);\nselect * from table where a = 1 and c = 2;\n ^^^^^\n additional qualification would be performed on index level\n\nPersonally, I would like to see II implemented first because\nof it works for both query examples.\n\nVadim\n", "msg_date": "Sun, 02 Aug 1998 00:08:30 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" }, { "msg_contents": "> Bruce Momjian wrote:\n> > \n> > create table test (x int4, y int4);\n> > create index i_test on test(x,y);\n> > insert into test values(1,2);\n> > select * from test where x=3 and (y=1 or y=2);\n> > \n> > This is going to use the i_test index, but only with key x=3, and do a\n> > scan of the index looking for y=1 or y=2, and will not use the second\n> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> Server will fetch heap tuple for each tuple with x = 3 \n> returned by index access methods and call ExecQual...\n> \n> > key of the index.\n> \n> There are two ways.\n> \n> I. Rewrite this into\n> \n> (x = 3 and y = 1) or (x = 3 and y = 2)\n> \n> and scan index twice using both keys for finding index tuples.\n\nYes. One way to do this may be to have OR processed AFTER AND in the\noptimizer, and use the existing index matches to look for matches\nfurther down the key. I am not sure where the actual multiple index\nplans are created, so I am not sure how to implement this.\n\n> II. Extend multi-key indexing: (y = 1 or y = 2) could be\n> qualified by index access methods itself because of Y is\n> one of index keys. Only first key would be used for finding\n> index tuples but additional qualification could decrease\n> number of heap_fetch calls and this would be nice!\n\nI see what you are saying. In the first case, you look for key1,key2a,\nthen for key1,key2b, etc. In the second case, you look for key1, then\nsitting on key1, you can get key2a, key2b, etc, without having to find\nkey1 for every OR.\n\n> This feature would be also usefull for:\n> \n> create index on table (a,b,c);\n> select * from table where a = 1 and c = 2;\n> ^^^^^\n> additional qualification would be performed on index level\n> \n> Personally, I would like to see II implemented first because\n> of it works for both query examples.\n\nDoesn't the existing code already use both keys in the above query. \nWhat is gained by moving this to the index access methods?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 1 Aug 1998 13:37:49 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> > > create index i_test on test(x,y);\n> > > insert into test values(1,2);\n> > > select * from test where x=3 and (y=1 or y=2);\n> \n> > II. Extend multi-key indexing: (y = 1 or y = 2) could be\n> > qualified by index access methods itself because of Y is\n> > one of index keys. Only first key would be used for finding\n> > index tuples but additional qualification could decrease\n> > number of heap_fetch calls and this would be nice!\n> \n> > This feature would be also usefull for:\n> >\n> > create index on table (a,b,c);\n> > select * from table where a = 1 and c = 2;\n> > ^^^^^\n> > additional qualification would be performed on index level\n> >\n> > Personally, I would like to see II implemented first because\n> > of it works for both query examples.\n> \n> Doesn't the existing code already use both keys in the above query.\n> What is gained by moving this to the index access methods?\n\nI hadn't time to implement this year ago...\n\nLet's say we have 1000 tuples with a = 1 and only 10 with\na = 1 and c = 2 - currently, all 1000 index tuples will be returned\nto Executor and all corresponding 1000 heap tuples will be fetched...\nHaving this feature, only 10 index tuples would be returned\nand heap_fetch would be called 10 times only.\n\nVadim\n", "msg_date": "Mon, 03 Aug 1998 10:38:03 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" }, { "msg_contents": "> Bruce Momjian wrote:\n> > \n> > > > create index i_test on test(x,y);\n> > > > insert into test values(1,2);\n> > > > select * from test where x=3 and (y=1 or y=2);\n> > \n> > > II. Extend multi-key indexing: (y = 1 or y = 2) could be\n> > > qualified by index access methods itself because of Y is\n> > > one of index keys. Only first key would be used for finding\n> > > index tuples but additional qualification could decrease\n> > > number of heap_fetch calls and this would be nice!\n> > \n> > > This feature would be also usefull for:\n> > >\n> > > create index on table (a,b,c);\n> > > select * from table where a = 1 and c = 2;\n> > > ^^^^^\n> > > additional qualification would be performed on index level\n> > >\n> > > Personally, I would like to see II implemented first because\n> > > of it works for both query examples.\n> > \n> > Doesn't the existing code already use both keys in the above query.\n> > What is gained by moving this to the index access methods?\n> \n> I hadn't time to implement this year ago...\n> \n> Let's say we have 1000 tuples with a = 1 and only 10 with\n> a = 1 and c = 2 - currently, all 1000 index tuples will be returned\n> to Executor and all corresponding 1000 heap tuples will be fetched...\n> Having this feature, only 10 index tuples would be returned\n> and heap_fetch would be called 10 times only.\n\nOK, stupid question, but why do we have multi-key indexes then? Just to\nallow UNIQUE index failure?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 3 Aug 1998 02:02:52 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> > > > II. Extend multi-key indexing: (y = 1 or y = 2) could be\n> > > > qualified by index access methods itself because of Y is\n> > > > one of index keys. Only first key would be used for finding\n> > > > index tuples but additional qualification could decrease\n> > > > number of heap_fetch calls and this would be nice!\n> > >\n> > > > This feature would be also usefull for:\n> > > >\n> > > > create index on table (a,b,c);\n> > > > select * from table where a = 1 and c = 2;\n> > > > ^^^^^\n> > > > additional qualification would be performed on index level\n> > > >\n> > > > Personally, I would like to see II implemented first because\n> > > > of it works for both query examples.\n> > >\n> > > Doesn't the existing code already use both keys in the above query.\n> > > What is gained by moving this to the index access methods?\n> >\n> > I hadn't time to implement this year ago...\n> >\n> > Let's say we have 1000 tuples with a = 1 and only 10 with\n> > a = 1 and c = 2 - currently, all 1000 index tuples will be returned\n> > to Executor and all corresponding 1000 heap tuples will be fetched...\n> > Having this feature, only 10 index tuples would be returned\n> > and heap_fetch would be called 10 times only.\n> \n> OK, stupid question, but why do we have multi-key indexes then? Just to\n> allow UNIQUE index failure?\n\nIn the example above only 1st and _3rd_ index keys are used \nin WHERE and so only 1st key will be used by index.\nFor cases like WHERE a = 1 and b = 3 index will use \n1st and 2nd keys.\nFor cases like WHERE a = 1 and b = 3 and c = 2 index will use\nall three keys.\n\nExtending II means not using 3rd key to _find_ index tuples \nbut using 3rd key to reduce # of index tuples returned\nto executor. Btree will read all tuples with a = 3 but \nwill not return index tuple with a = 3 and c = 0 (ie).\n\nVadim\n", "msg_date": "Mon, 03 Aug 1998 14:19:26 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" }, { "msg_contents": "> Bruce Momjian wrote:\n> > \n> > > > > II. Extend multi-key indexing: (y = 1 or y = 2) could be\n> > > > > qualified by index access methods itself because of Y is\n> > > > > one of index keys. Only first key would be used for finding\n> > > > > index tuples but additional qualification could decrease\n> > > > > number of heap_fetch calls and this would be nice!\n> > > >\n> > > > > This feature would be also usefull for:\n> > > > >\n> > > > > create index on table (a,b,c);\n> > > > > select * from table where a = 1 and c = 2;\n> > > > > ^^^^^\n> > > > > additional qualification would be performed on index level\n> > > > >\n> > > > > Personally, I would like to see II implemented first because\n> > > > > of it works for both query examples.\n> > > >\n> > > > Doesn't the existing code already use both keys in the above query.\n> > > > What is gained by moving this to the index access methods?\n> > >\n> > > I hadn't time to implement this year ago...\n> > >\n> > > Let's say we have 1000 tuples with a = 1 and only 10 with\n> > > a = 1 and c = 2 - currently, all 1000 index tuples will be returned\n> > > to Executor and all corresponding 1000 heap tuples will be fetched...\n> > > Having this feature, only 10 index tuples would be returned\n> > > and heap_fetch would be called 10 times only.\n> > \n> > OK, stupid question, but why do we have multi-key indexes then? Just to\n> > allow UNIQUE index failure?\n> \n> In the example above only 1st and _3rd_ index keys are used \n> in WHERE and so only 1st key will be used by index.\n> For cases like WHERE a = 1 and b = 3 index will use \n> 1st and 2nd keys.\n> For cases like WHERE a = 1 and b = 3 and c = 2 index will use\n> all three keys.\n> \n> Extending II means not using 3rd key to _find_ index tuples \n> but using 3rd key to reduce # of index tuples returned\n> to executor. Btree will read all tuples with a = 3 but \n> will not return index tuple with a = 3 and c = 0 (ie).\n\nOh, stupid me. I see now. Hardly seems worth adding the extra code to\nreduce a match. I agree, let the executor handle it.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 3 Aug 1998 11:52:06 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" }, { "msg_contents": "> Bruce Momjian wrote:\n> > \n> > create table test (x int4, y int4);\n> > create index i_test on test(x,y);\n> > insert into test values(1,2);\n> > select * from test where x=3 and (y=1 or y=2);\n> > \n> > This is going to use the i_test index, but only with key x=3, and do a\n> > scan of the index looking for y=1 or y=2, and will not use the second\n> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> Server will fetch heap tuple for each tuple with x = 3 \n> returned by index access methods and call ExecQual...\n> \n> > key of the index.\n> \n> There are two ways.\n> \n> I. Rewrite this into\n> \n> (x = 3 and y = 1) or (x = 3 and y = 2)\n> \n> and scan index twice using both keys for finding index tuples.\n> \n> II. Extend multi-key indexing: (y = 1 or y = 2) could be\n> qualified by index access methods itself because of Y is\n> one of index keys. Only first key would be used for finding\n> index tuples but additional qualification could decrease\n> number of heap_fetch calls and this would be nice!\n> \n> This feature would be also usefull for:\n> \n> create index on table (a,b,c);\n> select * from table where a = 1 and c = 2;\n> ^^^^^\n> additional qualification would be performed on index level\n> \n> Personally, I would like to see II implemented first because\n> of it works for both query examples.\n\nI now understand how this feature could be used in both cases where we\nmatch key1 and key3, and when we use OR on second key.\n\nI see what you are saying, that the values are already in the index, so\nyou could scan the index looking for the third key or the OR clause, and\nnot have to fetch the heap to look it up.\n\nI will add this to the TODO list under performance. It is sort of\nexotic, but why not add it:\n\n* use index to restrict rows returned by multi-key index for\n non-consecutive keys or OR clauses\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 3 Aug 1998 12:38:14 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" }, { "msg_contents": "Bruce,\n\nI have been following this thread great enthusiasm. I seem to have missed\nsomething though. Have you been CVSing these changes, and as such, should I\nbe able to use indexes on ORs?\n\n\n", "msg_date": "Tue, 04 Aug 1998 15:34:32 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" }, { "msg_contents": "> Bruce,\n> \n> I have been following this thread great enthusiasm. I seem to have missed\n> something though. Have you been CVSing these changes, and as such, should I\n> be able to use indexes on ORs?\n> \n> \n> \n> \n\nYes. Do an update because I have been fixing some minor problems.\nShould work now.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 4 Aug 1998 17:04:20 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR with multi-key indexes" } ]
[ { "msg_contents": "I have installed my changes to allow use of indexes with OR clauses. It\nis not perfect, but passes the regression tests. It is certainly ready\nfor people to try it out.\n\n90% of the code was already there, but disabled because it was broken. \nCleanup, debugging, and some additional code was all that was needed.\nI am thinking of doing a code review of the entire optimizer to make\nsure the code is in good shape.\n\nIt is amazing how many PostgreSQL features are like this.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 1 Aug 1998 18:38:26 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "OR clause indexing installed" } ]
[ { "msg_contents": "Just to ensure this is not a typo\n running configure in the latest cvs tree I noticed MULTIBYE - does it typo ?\n(I remember MULTIBYTE ) Also in configure used MULTIBYTEB which I also\ncouldn't find in source.\n\n\tOleg\n\n_____________________________________________________________\nOleg Bartunov, sci.researcher, hostmaster of AstroNet,\nSternberg Astronomical Institute, Moscow University (Russia)\nInternet: [email protected], http://www.sai.msu.su/~megera/\nphone: +007(095)939-16-83, +007(095)939-23-83\n\n", "msg_date": "Sun, 2 Aug 1998 03:52:56 +0400 (MSK DST)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": true, "msg_subject": "MULTIBYE typo ?" }, { "msg_contents": "> Just to ensure this is not a typo\n> running configure in the latest cvs tree I noticed MULTIBYE - does it typo ?\n> (I remember MULTIBYTE ) Also in configure used MULTIBYTEB which I also\n> couldn't find in source.\n\nFixed.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 1 Aug 1998 20:22:36 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] MULTIBYE typo ?" }, { "msg_contents": "At 8:22 PM 98.8.1 -0400, Bruce Momjian wrote:\n>> Just to ensure this is not a typo\n>> running configure in the latest cvs tree I noticed MULTIBYE - does it typo ?\n>> (I remember MULTIBYTE ) Also in configure used MULTIBYTEB which I also\n>> couldn't find in source.\n>\n>Fixed.\n\nThanks for fixing that. That was my mistake.\n--\nTatsuo Ishii\[email protected]\n--\nTatsuo Ishii\[email protected]\n\n", "msg_date": "Sun, 2 Aug 1998 22:27:56 +0900", "msg_from": "[email protected] (Tatsuo Ishii)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] MULTIBYE typo ?" } ]
[ { "msg_contents": "\nI'm attempting to use SPI because it seems I can't call a function\nwith a view as the argument, and the information is in multiple\ntables. But every time I call SPI_connect, it fails. I compiled the\nbackend with debugging information, but it isn't very clear what is\nhappening. is there any documentation for SPI beyond the shtml file\nin the doc directory, or tips for using it?\n", "msg_date": "Sat, 1 Aug 1998 19:18:04 -0700 (PDT)", "msg_from": "Brett McCormick <[email protected]>", "msg_from_op": true, "msg_subject": "SPI_connect always fails." }, { "msg_contents": "\nAs usual I failed to do sufficient testing before posting, and it\nappears as thought the fact that my function is taking a composite\ntype as an argument is causing SPI_connect to fail.\n\nI performed the following test:\n\nint4 spitest(TUPLE *t) {\n int ret;\n if ((ret = SPI_connect()) < 0)\n elog(ERROR, \"SPI_connect returned %d\", ret);\n return 1;\n}\n\nif the function is created with a composite type argument (i.e. a\ntable) it fails. if the same function, same code is created with\neither no arguments or an int4 argument it succeeds. I don't really\nknow enough about SPI or the passing of composite types to determine\nwhy this is, and unfortunately I don't have the time right now to\nlearn. It does seem to be an issue. Can this go on the TODO list? I\ncan of course work around this for the time being.\n\nAlso, what is the tentative release date for 6.4, so I can be\nprepared? I'm hoping to have time for PL/perl.\n\nOn Sat, 1 August 1998, at 19:18:04, Brett McCormick wrote:\n\n> I'm attempting to use SPI because it seems I can't call a function\n> with a view as the argument, and the information is in multiple\n> tables. But every time I call SPI_connect, it fails. I compiled the\n> backend with debugging information, but it isn't very clear what is\n> happening. is there any documentation for SPI beyond the shtml file\n> in the doc directory, or tips for using it?\n> \n", "msg_date": "Sat, 1 Aug 1998 19:29:24 -0700 (PDT)", "msg_from": "Brett McCormick <[email protected]>", "msg_from_op": true, "msg_subject": "follow up Re: [HACKERS] SPI_connect always fails." }, { "msg_contents": "> Also, what is the tentative release date for 6.4, so I can be\n> prepared? I'm hoping to have time for PL/perl.\n\nScrappy mentioned the other day that we are on a September 1\nfreeze/October 1 release schedule for now. Not likely to get moved up to\nearlier since that is only a month away now...\n\n - Tom\n", "msg_date": "Sun, 02 Aug 1998 13:56:17 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: follow up Re: [HACKERS] SPI_connect always fails." } ]
[ { "msg_contents": "\nWell, initdb doesn't give the same errors, but it's still failing. Now\nit's just saying:\n\ninitdb: could not create template database\ninitdb: cleaning up by wiping out /usr/local/dbase/data/base/template1\n\nwith no other indication that it's failing. Heres the last bit of the\ndebug:\n\nInserting null\nInsert Begin\nInsertOneTuple oid 1219, 14 attrs\nEnd InsertOneTuple, objectid=1219\nInsert End\n\n> Transaction End\nAmclose: relation (null).\n> <inhrel oid> \n<inhparent oid> \n<inhseqno int4> \n\n> initdb: could not create template database\ninitdb: cleaning up by wiping out /usr/local/dbase/data/base/template1\n[postgres@maidast pgsql]$ \n\nNow, looking at local1_template1.bki.source it's the pg_inherits\ndefinition that's failing. I don't know how the bki source works so I'm\nnot much help here, but I can't see anything obviously wrong.\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Sun, 2 Aug 1998 10:49:34 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": true, "msg_subject": "initdb problems" }, { "msg_contents": "At 10:49 AM 98.8.2 +0100, Peter T Mount wrote:\n>Well, initdb doesn't give the same errors, but it's still failing. Now\n>it's just saying:\n>\n>initdb: could not create template database\n>initdb: cleaning up by wiping out /usr/local/dbase/data/base/template1\n>\n>with no other indication that it's failing. Heres the last bit of the\n>debug:\n>\n>Inserting null\n>Insert Begin\n>InsertOneTuple oid 1219, 14 attrs\n>End InsertOneTuple, objectid=1219\n>Insert End\n>\n>> Transaction End\n>Amclose: relation (null).\n>> <inhrel oid> \n><inhparent oid> \n><inhseqno int4> \n>\n>> initdb: could not create template database\n>initdb: cleaning up by wiping out /usr/local/dbase/data/base/template1\n>[postgres@maidast pgsql]$ \n>\n>Now, looking at local1_template1.bki.source it's the pg_inherits\n>definition that's failing. I don't know how the bki source works so I'm\n>not much help here, but I can't see anything obviously wrong.\n\nI have tried to reproduce your problem but failed using recent\nsources (my anon CVS is working now!). I reinstalled everything,\nremoved $PGDATA and ran initdb (I did not turn on MULTIBYTE).\nI'm using FreeBSD 2.2.6-RELEASE.\n--\nTatsuo Ishii\[email protected]\n\n", "msg_date": "Sun, 2 Aug 1998 22:27:59 +0900", "msg_from": "[email protected] (Tatsuo Ishii)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] initdb problems" }, { "msg_contents": "I got the same problem, running ldconfig namually solves this.\n\n\tOleg\n\nOn Sun, 2 Aug 1998, Tatsuo Ishii wrote:\n\n> Date: Sun, 2 Aug 1998 22:27:59 +0900\n> From: Tatsuo Ishii <[email protected]>\n> To: Peter T Mount <[email protected]>,\n> PostgreSQL Hackers List <[email protected]>\n> Subject: Re: [HACKERS] initdb problems\n> \n> At 10:49 AM 98.8.2 +0100, Peter T Mount wrote:\n> >Well, initdb doesn't give the same errors, but it's still failing. Now\n> >it's just saying:\n> >\n> >initdb: could not create template database\n> >initdb: cleaning up by wiping out /usr/local/dbase/data/base/template1\n> >\n> >with no other indication that it's failing. Heres the last bit of the\n> >debug:\n> >\n> >Inserting null\n> >Insert Begin\n> >InsertOneTuple oid 1219, 14 attrs\n> >End InsertOneTuple, objectid=1219\n> >Insert End\n> >\n> >> Transaction End\n> >Amclose: relation (null).\n> >> <inhrel oid> \n> ><inhparent oid> \n> ><inhseqno int4> \n> >\n> >> initdb: could not create template database\n> >initdb: cleaning up by wiping out /usr/local/dbase/data/base/template1\n> >[postgres@maidast pgsql]$ \n> >\n> >Now, looking at local1_template1.bki.source it's the pg_inherits\n> >definition that's failing. I don't know how the bki source works so I'm\n> >not much help here, but I can't see anything obviously wrong.\n> \n> I have tried to reproduce your problem but failed using recent\n> sources (my anon CVS is working now!). I reinstalled everything,\n> removed $PGDATA and ran initdb (I did not turn on MULTIBYTE).\n> I'm using FreeBSD 2.2.6-RELEASE.\n> --\n> Tatsuo Ishii\n> [email protected]\n> \n> \n\n_____________________________________________________________\nOleg Bartunov, sci.researcher, hostmaster of AstroNet,\nSternberg Astronomical Institute, Moscow University (Russia)\nInternet: [email protected], http://www.sai.msu.su/~megera/\nphone: +007(095)939-16-83, +007(095)939-23-83\n\n", "msg_date": "Mon, 3 Aug 1998 16:46:35 +0400 (MSK DST)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] initdb problems" }, { "msg_contents": "On Mon, 3 Aug 1998, Oleg Bartunov wrote:\n\n> I got the same problem, running ldconfig namually solves this.\n\nldconfig solved an earlier but completely different problem - sadly.\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Mon, 3 Aug 1998 18:46:54 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] initdb problems" } ]
[ { "msg_contents": "I learned the hard way last night that the postmaster's password\nauthentication routines don't look at the pg_shadow table. They\nlook at a separate file named pg_pwd, which certain backend operations\nwill update from pg_shadow. (This is not documented in any user\ndocumentation that I could find; I had to burrow into\nsrc/backend/commands/user.c to discover it.)\n\nUnfortunately, if a clueless dbadmin (like me ;-)) tries to update\npassword data with the obvious thing,\n\tupdate pg_shadow set passwd = 'xxxxx' where usename = 'yyyy';\npg_pwd doesn't get fixed.\n\nA more drastic problem is that pg_dump believes it can save and\nrestore pg_shadow data using \"copy\". Following an initdb and restore\nfrom a pg_dump -z script, pg_shadow will look just fine, but only\nthe database admin will be listed in pg_pwd. This is likely to provoke\nsome confusion, IMHO.\n\nAs a short-term thing, the fact that you *must* set passwords with\nALTER USER ought to be documented, preferably someplace where a\ndbadmin who's never heard of ALTER USER is likely to find it.\n\nAs a longer-term thing, I think it would be far better if ordinary\nSQL operations on pg_shadow just did the right thing. Wouldn't it\nbe possible to implement copying to pg_pwd by means of a trigger on\npg_shadow updates, or something like that?\n\n(I'm afraid that pg_dump -z is pretty well broken for operations on\na password-protected database, btw. Has anyone used it successfully\nin that situation?)\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 02 Aug 1998 19:28:13 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "TODO item: make pg_shadow updates more robust" }, { "msg_contents": "> As a short-term thing, the fact that you *must* set passwords with\n> ALTER USER ought to be documented, preferably someplace where a\n> dbadmin who's never heard of ALTER USER is likely to find it.\n\nThere is a two sentence \"chapter\" in the Administrator's Guide in\nstart-ag.sgml which is titled \"Adding and Deleting Users\". This chapter\nshould be renamed \"Users\" and have sections covering this topic and\nothers.\n\nIt looks like there are several man pages (pg_hba, pg_passwd at least)\nwhich could/should be folded into the Administrator's Guide. I'll try\ndoing that sometime soon, once we have the SQL language reference pages\ndone.\n\nWould you like to add some information, or is what you have above\nsufficient? If it is enough, I'll add it in. If it needs more, would you\nbe willing to flesh it out?\n\n - Tom (the other \"tgl\")\n", "msg_date": "Mon, 03 Aug 1998 05:25:20 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TODO item: make pg_shadow updates more robust" }, { "msg_contents": "> I learned the hard way last night that the postmaster's password\n> authentication routines don't look at the pg_shadow table. They\n> look at a separate file named pg_pwd, which certain backend operations\n> will update from pg_shadow. (This is not documented in any user\n> documentation that I could find; I had to burrow into\n> src/backend/commands/user.c to discover it.)\n> \n> Unfortunately, if a clueless dbadmin (like me ;-)) tries to update\n> password data with the obvious thing,\n> \tupdate pg_shadow set passwd = 'xxxxx' where usename = 'yyyy';\n> pg_pwd doesn't get fixed.\n> \n> A more drastic problem is that pg_dump believes it can save and\n> restore pg_shadow data using \"copy\". Following an initdb and restore\n> from a pg_dump -z script, pg_shadow will look just fine, but only\n> the database admin will be listed in pg_pwd. This is likely to provoke\n> some confusion, IMHO.\n\nGood point. We did not want the backend to make database reads, so we\nhave the flat file created after every user operation. It is a royal\nhack, but we never came up with a better way.\n\n> \n> As a short-term thing, the fact that you *must* set passwords with\n> ALTER USER ought to be documented, preferably someplace where a\n> dbadmin who's never heard of ALTER USER is likely to find it.\n\nSuggestions?\n\n> \n> As a longer-term thing, I think it would be far better if ordinary\n> SQL operations on pg_shadow just did the right thing. Wouldn't it\n> be possible to implement copying to pg_pwd by means of a trigger on\n> pg_shadow updates, or something like that?\n> \n> (I'm afraid that pg_dump -z is pretty well broken for operations on\n> a password-protected database, btw. Has anyone used it successfully\n> in that situation?)\n\nGood idea.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 3 Aug 1998 01:58:02 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TODO item: make pg_shadow updates more robust" }, { "msg_contents": "On Sun, 2 Aug 1998, Tom Lane wrote:\n\n> I learned the hard way last night that the postmaster's password\n> authentication routines don't look at the pg_shadow table. They\n> look at a separate file named pg_pwd, which certain backend operations\n> will update from pg_shadow. (This is not documented in any user\n> documentation that I could find; I had to burrow into\n> src/backend/commands/user.c to discover it.)\n> \n> Unfortunately, if a clueless dbadmin (like me ;-)) tries to update\n> password data with the obvious thing,\n> \tupdate pg_shadow set passwd = 'xxxxx' where usename = 'yyyy';\n> pg_pwd doesn't get fixed.\n\nThis might explain why my test with the perl-interface failed....\n\n> \n> A more drastic problem is that pg_dump believes it can save and\n> restore pg_shadow data using \"copy\". Following an initdb and restore\n> from a pg_dump -z script, pg_shadow will look just fine, but only\n> the database admin will be listed in pg_pwd. This is likely to provoke\n> some confusion, IMHO.\n> \n> As a short-term thing, the fact that you *must* set passwords with\n> ALTER USER ought to be documented, preferably someplace where a\n> dbadmin who's never heard of ALTER USER is likely to find it.\n\nAn 'ALTER USER user RENAME TO new-user' would also come in handy then...\n \nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Mon, 3 Aug 1998 09:13:31 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TODO item: make pg_shadow updates more robust" } ]
[ { "msg_contents": "\nIs this a bug that the index doesn't work on floats or is it a datatype\nmismatch thing?\n\n-----\n\ntemplate1=> create table foo (x float4, y float4);\nCREATE\ntemplate1=> create index foox on foo(x);\nCREATE\ntemplate1=> create index fooy on foo(y);\nCREATE\ntemplate1=> insert into foo values(123.45,678.90);\nINSERT 239376 1\ntemplate1=> insert into foo values(123.25,678.95);\nINSERT 239377 1\ntemplate1=> explain select * from foo where x = 123.4;\nNOTICE: QUERY PLAN:\n\nSeq Scan on foo (cost=0.00 size=0 width=8)\n\nEXPLAIN\ntemplate1=> \n\n-----\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] flame-mail: /dev/null\n # include <std/disclaimers.h> TEAM-OS2\n Online Searchable Campground Listings http://www.camping-usa.com\n \"There is no outfit less entitled to lecture me about bloat\n than the federal government\" -- Tony Snow\n==========================================================================\n\n\n", "msg_date": "Sun, 02 Aug 1998 20:26:43 -0400 (EDT)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": true, "msg_subject": "indexes and floats" }, { "msg_contents": "> Is this a bug that the index doesn't work on floats or is it a \n> datatype mismatch thing?\n> Seq Scan on foo (cost=0.00 size=0 width=8)\n\nLikely neither. Notice the cost of a sequential scan; it is zero. Why\nbother doing an index scan? \n\nYou need at least two more things to happen to provoke Postgres into\nusing your index:\n\n1) Have more entries in the table; rule of thumb is O(100) before an\nindex will be used.\n\n2) Run vacuum after getting that many entries to make sure the optimizer\nwill know about the configuration of the tables and indices.\n\nGood luck.\n\n - Tom\n", "msg_date": "Mon, 03 Aug 1998 05:16:01 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "\nOn 03-Aug-98 Thomas G. Lockhart wrote:\n>> Is this a bug that the index doesn't work on floats or is it a \n>> datatype mismatch thing?\n>> Seq Scan on foo (cost=0.00 size=0 width=8)\n> \n> Likely neither. Notice the cost of a sequential scan; it is zero. Why\n> bother doing an index scan? \n> \n> You need at least two more things to happen to provoke Postgres into\n> using your index:\n> \n> 1) Have more entries in the table; rule of thumb is O(100) before an\n> index will be used.\n> \n> 2) Run vacuum after getting that many entries to make sure the optimizer\n> will know about the configuration of the tables and indices.\n\nHere's why I'm bringing it up. I ran vacuum on the database yesterday.\nThe table consists of city, state (both text), lon and lat (both float4).\nThe text index is working but not the floats. I have another table with\n12,000 - 14,000 rows and I'm getting the same thing.\n\n-----\n\ncampsites=> explain select lon from locations where lon = 83.5;\nNOTICE: QUERY PLAN:\n\nSeq Scan on locations (cost=7263.30 size=2 width=4)\n\nEXPLAIN\ncampsites=> select count(*) from locations;\n count\n------\n169797\n(1 row)\n\ncampsites=> \n\n-----\n\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] flame-mail: /dev/null\n # include <std/disclaimers.h> TEAM-OS2\n Online Searchable Campground Listings http://www.camping-usa.com\n \"There is no outfit less entitled to lecture me about bloat\n than the federal government\" -- Tony Snow\n==========================================================================\n\n\n", "msg_date": "Mon, 03 Aug 1998 08:40:29 -0400 (EDT)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> >> Is this a bug that the index doesn't work on floats or is it a\n> >> datatype mismatch thing?\n> >> Seq Scan on foo (cost=0.00 size=0 width=8)\n> The table consists of city, state (both text), lon and lat (both \n> float4). The text index is working but not the floats. I have another \n> table with 12,000 - 14,000 rows and I'm getting the same thing.\n\nHmm. You are right. I'm glad you insisted on pursuing this, but I might\nhave been able to see the problem right away if you had described it in\ndetail (e.g. \"floats\" is not clearly float4) and if your initial example\nhad actually been with float4 data (it showed a width of 8 which is\nlikely to be a float8) :/\n\nAnyway, the problem seems to be specific to float4. The workaround is to\nuse float8 for now, and we'll look into fixing the problem for the next\nrelease...\n\n - Tom\n\nTest cases from the regression database follow:\n\nregression=> create table test (f4 float4);\nCREATE\nregression=> insert into test select seqno from bt_f8_heap;\nINSERT 0 10000\nregression=> create index ti on test using btree (f4);\nCREATE\nregression=> vacuum;\nVACUUM\nregression=> explain select f4 from test where f4 = 500.0;\nNOTICE: QUERY PLAN:\n\nSeq Scan on test (cost=394.00 size=1 width=4)\n\nEXPLAIN\n\nregression=> create table test8 as select seqno from bt_f8_heap;\nSELECT\nregression=> create index t8 on test8 using btree (seqno);\nCREATE\nregression=> vacuum;\nVACUUM\nregression=> explain select seqno from test8 where seqno = 500.0;\nNOTICE: QUERY PLAN:\n\nIndex Scan using t8 on test8 (cost=2.05 size=1 width=8)\n\nEXPLAIN\n", "msg_date": "Mon, 03 Aug 1998 14:28:38 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "\"Thomas G. Lockhart\" <[email protected]> writes:\n>> The table consists of city, state (both text), lon and lat (both \n>> float4). The text index is working but not the floats. I have another \n>> table with 12,000 - 14,000 rows and I'm getting the same thing.\n\n> Anyway, the problem seems to be specific to float4. The workaround is to\n> use float8 for now, and we'll look into fixing the problem for the next\n> release...\n\nAh-hah, all of a sudden this looks *real* familiar. I bet it's because\npgsql is not noticing that \"500.0\" can be interpreted as a float4.\nLet's try it.\n\nplay=> create table f8 (x float8);\nCREATE\nplay=> \\copy f8 from countup;\t\t\t// 0..999 in a text file\nSuccessfully copied.\nplay=> create index f8_i on f8 using btree (x);\nCREATE\nplay=> create table f4 (x float4);\nCREATE\nplay=> \\copy f4 from countup;\nSuccessfully copied.\nplay=> create index f4_i on f4 using btree (x);\nCREATE\nplay=> vacuum verbose analyze;\n.... blah blah\nplay=> explain select x from f8 where x = 500;\nNOTICE: QUERY PLAN:\n\nSeq Scan on f8 (cost=40.00 size=100 width=8)\n\nEXPLAIN\nplay=> explain select x from f8 where x = 500.0;\nNOTICE: QUERY PLAN:\n\nIndex Scan using f8_i on f8 (cost=2.05 size=1 width=8)\n\nEXPLAIN\nplay=> explain select x from f4 where x = 500;\nNOTICE: QUERY PLAN:\n\nSeq Scan on f4 (cost=40.00 size=100 width=4)\n\nEXPLAIN\nplay=> explain select x from f4 where x = 500.0;\nNOTICE: QUERY PLAN:\n\nSeq Scan on f4 (cost=40.00 size=1 width=4)\n\nEXPLAIN\nplay=> explain select x from f4 where x = 500 :: float4;\nNOTICE: QUERY PLAN:\n\nIndex Scan using f4_i on f4 (cost=2.05 size=1 width=4)\n\nEXPLAIN\nplay=> explain select x from f4 where x = 500.0 :: float4;\nERROR: parser_typecast: cannot cast this expression to type 'float4'\nplay=>\n\n(This is with cvs sources of a few days ago.)\n\nI see two different bugs here:\n\n1. select ... where x = constant; is optimized to an index scan\nonly if the constant is of the exact type of the field x.\nApparently, the coercion of the constant to match the type of x\nhappens only after the optimizer decides it doesn't know what to do.\nThe coercion ought to happen *before* the optimizer runs.\n(I have no idea whether this is a new bug caused by the recent\ntype-system changes, or whether it existed in 6.3.2 and earlier.)\n\n2. Type coercion fails for \"500.0 :: float4\" (ditto for \"500.0 :: float8\"\nbtw). Presumably this is a simple localized bug in the parser or the type\ncoercion logic for floats.\n\nI had previously complained of bug #1 in connection with OIDs;\nwith the present sources, \"where oid = 123456\" will not use\nan index on OID, while \"where oid = 123456::oid\" will.\n\nI will bet lunch (at the nearest McD's, I'm not rich ;-)) that\nVince Vielhaber's recent gripe about \n\tselect city from locations where lower(city) = lower('st. ignace');\nfailing to use an index\n\tcreate index locations_city on locations(lower(city) text_ops);\nis an artifact of the same sort of type-mismatch problem.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 03 Aug 1998 23:50:47 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats " }, { "msg_contents": "> 1. select ... where x = constant; is optimized to an index scan\n> only if the constant is of the exact type of the field x.\n> Apparently, the coercion of the constant to match the type of x\n> happens only after the optimizer decides it doesn't know what to do.\n> The coercion ought to happen *before* the optimizer runs.\n> (I have no idea whether this is a new bug caused by the recent\n> type-system changes, or whether it existed in 6.3.2 and earlier.)\n\nI think the current sources Thomas has modified work better, perhaps?\n\n> \n> 2. Type coercion fails for \"500.0 :: float4\" (ditto for \"500.0 :: float8\"\n> btw). Presumably this is a simple localized bug in the parser or the type\n> coercion logic for floats.\n> \n> I had previously complained of bug #1 in connection with OIDs;\n> with the present sources, \"where oid = 123456\" will not use\n> an index on OID, while \"where oid = 123456::oid\" will.\n> \n> I will bet lunch (at the nearest McD's, I'm not rich ;-)) that\n> Vince Vielhaber's recent gripe about \n> \tselect city from locations where lower(city) = lower('st. ignace');\n> failing to use an index\n> \tcreate index locations_city on locations(lower(city) text_ops);\n> is an artifact of the same sort of type-mismatch problem.\n> \n> \t\t\tregards, tom lane\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 4 Aug 1998 00:40:40 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "Tom Lane wrote:\n> \n> I will bet lunch (at the nearest McD's, I'm not rich ;-)) that\n> Vince Vielhaber's recent gripe about\n> select city from locations where lower(city) = lower('st. ignace');\n> failing to use an index\n> create index locations_city on locations(lower(city) text_ops);\n> is an artifact of the same sort of type-mismatch problem.\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNo. This is the result of using lower('st. ignace') - function: \noptimizer considers clause as usable for index only for\nconstants and parameters!\nWe discussed this ~ month ago. lower('st. ignace') could be\nreplaced by parameter of PARAM_EXEC type (implemented \nfor subqueries) to be 1. considered by optimizer as index key\nvalue, 2. evaluated _ONCE_ by executor.\nAs I mentioned before, lower('st. ignace') will be evaluated\nFOR EACH tuple in SeqScan!!!\n\nPARAM_EXEC was implemented to handle queries like this:\n\nselect * from A where A.x = (select max(B.y) from B)\n\n- subquery will be executed once and index on A (x) will be\nused (if exists).\n\nOptimizer just rewrites this query as\nselect * from A where A.x = _parameter_\nand stores information about _parameter_ in InitPlan of\nexecution plan.\n\nLook:\n\nvac=> explain select * from test where x = lower('a');\nNOTICE: QUERY PLAN:\n\nSeq Scan on test (cost=40.00 size=100 width=12)\n^^^^^^^^\nEXPLAIN\nvac=> explain select * from test where x = (select lower('a'));\nNOTICE: QUERY PLAN:\n\nIndex Scan using itest2 on test (cost=2.05 size=1 width=12)\n^^^^^^^^^^\n InitPlan\n -> Result (cost=0.00 size=0 width=0)\n\nNevertheless,\n\nvac=> explain select * from test where lower(x) = (select lower('a'));\nNOTICE: IndexSelectivity: no key -1 in index 20305\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNOTICE: QUERY PLAN:\n\nSeq Scan on test (cost=40.00 size=100 width=12)\n^^^^^^^^\n InitPlan\n -> Result (cost=0.00 size=0 width=0)\n\n- something is broken for functional indices...\n\nVadim\n", "msg_date": "Tue, 04 Aug 1998 12:41:35 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> > Ah-hah, all of a sudden this looks *real* familiar. I bet it's \n> > because pgsql is not noticing that \"500.0\" can be interpreted as a \n> > float4. Let's try it.\n> \n> Oh, you have nailed it! This is interesting because (probably) a query\n> like\n> \n> select f4 from t4 where f4 = 500.0;\n> \n> is being automatically \"upgraded\" in the parser backend to\n> \n> select f4 from t4 where float8(f4) = 500.0;\n> \n> So, since there is no functional index float8(f4) on the table we cannot\n> use an existing index on f4 to advantage.\n> \n> This may be a result of my recent enhancements to the automatic type\n> coersion code. But I'm a little suprised that v6.3.x doesn't just\n> complain about a type mismatch but instead actually works. It may be\n> that the old code which converted constants using intermediate strings\n> worked (sort of) for this case. In general, the pre-enhancement code\n> _only_ tried to convert constants, and complained about type mismatches\n> when non-constants were involved.\n\nYes, it did numeric constants, I think.\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 4 Aug 1998 00:43:26 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> Ah-hah, all of a sudden this looks *real* familiar. I bet it's \n> because pgsql is not noticing that \"500.0\" can be interpreted as a \n> float4. Let's try it.\n\nOh, you have nailed it! This is interesting because (probably) a query\nlike\n\n select f4 from t4 where f4 = 500.0;\n\nis being automatically \"upgraded\" in the parser backend to\n\n select f4 from t4 where float8(f4) = 500.0;\n\nSo, since there is no functional index float8(f4) on the table we cannot\nuse an existing index on f4 to advantage.\n\nThis may be a result of my recent enhancements to the automatic type\ncoersion code. But I'm a little suprised that v6.3.x doesn't just\ncomplain about a type mismatch but instead actually works. It may be\nthat the old code which converted constants using intermediate strings\nworked (sort of) for this case. In general, the pre-enhancement code\n_only_ tried to convert constants, and complained about type mismatches\nwhen non-constants were involved.\n\nSo far in the examples, imho this (new?) feature isn't a _fatal_\nproblem, because you want to handle the following query correctly (I'll\nswitch to an int column to make it clearer):\n\n select i4 from t4 where i4 < 500.1;\n\nNow, if we do the \"optimizable thing\" blindly, then we would transform\nthis to\n\n select i4 from t4 where i4 < int4(500.1);\n\nBut of course this would produce the wrong result if the table contains\na value of 500. Perhaps something a bit different could be implemented,\nbut it probably wouldn't generalize very well with the extensible type\nsystem.\n\nSo, is there a problem to fix, or just documentation to write? I've\nalready written a new \"Type Conversion\" chapter for the User's Guide,\nbut haven't mentioned this specific issue.\n\n - Tom\n", "msg_date": "Tue, 04 Aug 1998 04:48:24 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "\"Thomas G. Lockhart\" <[email protected]> writes:\n> Oh, you have nailed it! This is interesting because (probably) a query\n> like\n> select f4 from t4 where f4 = 500.0;\n> is being automatically \"upgraded\" in the parser backend to\n> select f4 from t4 where float8(f4) = 500.0;\n> So, since there is no functional index float8(f4) on the table we cannot\n> use an existing index on f4 to advantage.\n\nOK, that sounds plausible. But in my examples,\n\n\tplay=> explain select x from f8 where x = 500;\n\tNOTICE: QUERY PLAN:\n\tSeq Scan on f8 (cost=40.00 size=100 width=8)\n\nYour explanation implies that here, the parser is converting to\n\t select x from f8 where int4(x) = 500;\nwhich is wrong for the same accuracy-loss reasons you cite later.\n(And if that isn't what it's doing, what then?)\n\nI think it would be a good idea if someone actually dug into this\nand verified what's going on. I have found some other cases that\nlead me to think there's more to this than we understand just yet.\nWith an index on an int4 field, I get\n\ntree=> explain select * from marketorderhistory where sequenceNo = 140000;\nNOTICE: QUERY PLAN:\nIndex Scan using marketorderhistory_sequenceno_i on marketorderhistory\n (cost=2.05 size=1 width=100)\n\ntree=> explain select * from marketorderhistory where sequenceNo > 140000;\nNOTICE: QUERY PLAN:\nSeq Scan on marketorderhistory (cost=63.38 size=449 width=100)\n\nwhich doesn't look like it could be explained by parser type coercions.\nPerhaps this one just indicates an omission from the list of\ntype-specific routines that can be used for index comparisons? If so,\nmaybe there are other omissions affecting the results for other types.\n\n> ... you want to handle the following query correctly (I'll\n> switch to an int column to make it clearer):\n> select i4 from t4 where i4 < 500.1;\n> Now, if we do the \"optimizable thing\" blindly, then we would transform\n> this to\n> select i4 from t4 where i4 < int4(500.1);\n> But of course this would produce the wrong result if the table contains\n> a value of 500. Perhaps something a bit different could be implemented,\n> but it probably wouldn't generalize very well with the extensible type\n> system.\n\nThat's a good point. Still, it would be nice if the system had some\nreasonable amount of smarts about the \"primitive\" types that the parser\nhas constant syntax for. In particular I think an automatic coercion of\nan int constant to float where needed would be a reasonable thing to\nexpect. That's not happening now, see my example above.\n\n> So, is there a problem to fix, or just documentation to write?\n\nThis one is most certainly a bug:\n\nplay=> select x from f4 where x = 500.0 :: float4;\nERROR: parser_typecast: cannot cast this expression to type 'float4'\n\nBeyond that, if I can force the right thing to happen by casting\nthe constant to the type of the field, then I can live with it.\nI have seen a number of cases where the system wouldn't use an index\neven with a cast, however, so I'm not a happy camper yet.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 04 Aug 1998 10:48:51 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats " }, { "msg_contents": "\nOn 04-Aug-98 Tom Lane wrote:\n\n> OK, that sounds plausible. But in my examples,\n> \n> play=> explain select x from f8 where x = 500;\n> NOTICE: QUERY PLAN:\n> Seq Scan on f8 (cost=40.00 size=100 width=8)\n> \n> Your explanation implies that here, the parser is converting to\n> select x from f8 where int4(x) = 500;\n> which is wrong for the same accuracy-loss reasons you cite later.\n> (And if that isn't what it's doing, what then?)\n> \n> I think it would be a good idea if someone actually dug into this\n> and verified what's going on. I have found some other cases that\n> lead me to think there's more to this than we understand just yet.\n> With an index on an int4 field, I get\n\nWhat file(s) are these decisions actually made in? \n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] flame-mail: /dev/null\n # include <std/disclaimers.h> TEAM-OS2\n Online Searchable Campground Listings http://www.camping-usa.com\n \"There is no outfit less entitled to lecture me about bloat\n than the federal government\" -- Tony Snow\n==========================================================================\n\n\n", "msg_date": "Tue, 04 Aug 1998 11:08:03 -0400 (EDT)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> Your explanation implies that here, the parser is converting to\n> select x from f8 where int4(x) = 500;\n> which is wrong for the same accuracy-loss reasons you cite later.\n> (And if that isn't what it's doing, what then?)\n\nNo, that isn't what it would do. The parser does know about a heirarchy\nof built-in data types, and would not downgrade a float8 to an int4.\nI've sent some e-mail about the new parser features, and have written\nthem up in doc/src/sgml/typeconv.sgml (but haven't generated a new html\nversion yet).\n\n> I think it would be a good idea if someone actually dug into this\n> and verified what's going on. I have found some other cases that\n> lead me to think there's more to this than we understand just yet.\n\nI'm pretty sure that there is another thing happening, which is getting\nin the way of using indices with your example using\n\n where lowercase(col) = lowercase('const')\n\n> That's a good point. Still, it would be nice if the system had some\n> reasonable amount of smarts about the \"primitive\" types that the \n> parser has constant syntax for. In particular I think an automatic \n> coercion of an int constant to float where needed would be a \n> reasonable thing to expect. That's not happening now, see my example \n> above.\n\nI agree with your points, but it already does exactly what you would\nwant. I don't see an example above illustrating this problem.\n\n> > So, is there a problem to fix, or just documentation to write?\n> \n> This one is most certainly a bug:\n> \n> play=> select x from f4 where x = 500.0 :: float4;\n> ERROR: parser_typecast: cannot cast this expression to type 'float4'\n\nMight be easy. I'll look at it... Oh, the current workaround is to\nspecify it as\n\n where x = '500.0'::float4;\n\nor\n\n where x = float4(500.0);\n\n> Beyond that, if I can force the right thing to happen by casting\n> the constant to the type of the field, then I can live with it.\n> I have seen a number of cases where the system wouldn't use an index\n> even with a cast, however, so I'm not a happy camper yet.\n\nYeah, that was Vadim's example and he sez we need to add a bit of code\nto get things working the way you'd expect.\n\n - Tom\n", "msg_date": "Tue, 04 Aug 1998 16:37:54 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "\"Thomas G. Lockhart\" <[email protected]> writes:\n> No, that isn't what it would do. The parser does know about a heirarchy\n> of built-in data types, and would not downgrade a float8 to an int4.\n\nOK, that's good. But if it knows that much, I'd expect it to be able\nto *upgrade* an int4 to a float8 where appropriate. That's not\nhappening, as in my prior example:\n\n>> play=> explain select x from f8 where x = 500.0;\n>> NOTICE: QUERY PLAN:\n>> Index Scan using f8_i on f8 (cost=2.05 size=1 width=8)\n>> \n>> play=> explain select x from f8 where x = 500;\n>> NOTICE: QUERY PLAN:\n>> Seq Scan on f8 (cost=40.00 size=100 width=8)\n\nThe thing that I find peculiar about all this is that the system doesn't\nreject the query completely, as you'd expect it to if there were really\na type mismatch problem. It takes it and just does it a lot slower than\nit should. It seems the type coercion will happen, but too late for the\noptimizer to notice.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 05 Aug 1998 10:52:39 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats " }, { "msg_contents": "> > The parser does know about a heirarchy\n> > of built-in data types, and would not downgrade a float8 to an int4.\n> OK, that's good. But if it knows that much, I'd expect it to be able\n> to *upgrade* an int4 to a float8 where appropriate. That's not\n> happening\n\nAh, but it _is_ happening. The problem lies later. Read on...\n\n> , as in my prior example:\n> >> play=> explain select x from f8 where x = 500;\n> >> NOTICE: QUERY PLAN:\n> >> Seq Scan on f8 (cost=40.00 size=100 width=8)\n> It seems the type coercion will happen, but too late for the\n> optimizer to notice.\n\nThis is the specific case discussed by Vadim, and is, I believe,\ndirectly related to the\n\n select city from locations where lower(city) = lower('st. ignace');\n\nexample given by Vince. \n\nThe parser is converting this query to become\n\n select x from f8 where x = float8(500);\n\nThe problem appears to be that the optimizer/executor does not know how\nto evaluate the constant string once-only, and insists on doing a\nsequential scan for some reason. Not really in the parser's hands.\nRemember, the types are all set and the functions are all defined by the\ntime the actual optimizer/executor sees anything. There may be a slight\nbit of \"optimization\" which happens in the parser, but only to shoehorn\nSQL92 into the Postgres backend. Oh, there are some heuristics in the\nparser to fudge the distinctions between char/varchar/text types to\nallow reuse of some of the support code, but that is a Bad Thing in\nprinciple.\n\nThe downside to putting more heuristics into the parser (as opposed to\nupgrading the optimizer/executor to handle the case) is that it embeds\nmore assumptions about the _behavior_ of, for example, int4->float8\nconversions and would reduce the flexibility of the extensible type\nsystem.\n\nistm that we should be focusing on Vadim's hints on what it would take\nto use indices with function calls on constants...\n\n - Tom\n", "msg_date": "Wed, 05 Aug 1998 15:29:38 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> istm that we should be focusing on Vadim's hints on what it would take\n> to use indices with function calls on constants...\n\nLooking at Vadim's note again, maybe it will be the parser's duty to\ninsert the PARAM_EXEC node; will need more details or some time to look\nat it...\n\n - Tom\n", "msg_date": "Wed, 05 Aug 1998 15:42:12 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "\"Thomas G. Lockhart\" <[email protected]> writes:\n> The parser is converting this query to become\n> select x from f8 where x = float8(500);\n\n> The problem appears to be that the optimizer/executor does not know how\n> to evaluate the constant string once-only, and insists on doing a\n> sequential scan for some reason.\n\nAh, it's finally starting to make some sense to me. What you're saying\nis that this is a failure to do constant-folding.\n\nDoing a sequential scan would be appropriate if the righthand side of\nthe comparison needed to be evaluated afresh at each row. If the\noptimizer thinks that, then that explains a lot.\n\nThe question then is why the righthand side doesn't look like a\nconstant. I'd have expected that any expression not involving a table\nattribute would be evaluated once (folded into a constant) before any\ndecisions are made on how to perform the scan. Is that reasonable, or\nis there some aspect of SQL semantics that makes it wrong?\n\nIf it is supposed to be happening, could it be that float8() is for\nsome reason not marked as a safely foldable function?\n\nWhile I'm asking dumb questions: are \"float8(500)\" and \"500::float8\"\ntreated differently? Actually, I can see that they are:\n\n\tplay=> explain select x from f8 where x = 500::float8;\n\tNOTICE: QUERY PLAN:\n\tIndex Scan using f8_i on f8 (cost=2.05 size=1 width=8)\n\n\tplay=> explain select x from f8 where x = float8(500);\n\tNOTICE: QUERY PLAN:\n\tSeq Scan on f8 (cost=40.00 size=100 width=8)\n\nBut why? Is there a difference in semantics?\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 05 Aug 1998 12:29:34 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats " }, { "msg_contents": "> The problem appears to be that the optimizer/executor does not know how\n> to evaluate the constant string once-only, and insists on doing a\n> sequential scan for some reason. Not really in the parser's hands.\n> Remember, the types are all set and the functions are all defined by the\n> time the actual optimizer/executor sees anything. There may be a slight\n> bit of \"optimization\" which happens in the parser, but only to shoehorn\n> SQL92 into the Postgres backend. Oh, there are some heuristics in the\n> parser to fudge the distinctions between char/varchar/text types to\n> allow reuse of some of the support code, but that is a Bad Thing in\n> principle.\n> \n> The downside to putting more heuristics into the parser (as opposed to\n> upgrading the optimizer/executor to handle the case) is that it embeds\n> more assumptions about the _behavior_ of, for example, int4->float8\n> conversions and would reduce the flexibility of the extensible type\n> system.\n> \n> istm that we should be focusing on Vadim's hints on what it would take\n> to use indices with function calls on constants...\n\nI understand the problem now. There is code in the optimizer to handle\nfunctions on constants, but it does not appear to be in a place where\nindex matching can use it.\n\nI will be looking over the code in the next few weeks, but not sure if I\ncan figure it all out by then. I have added it to my personal TODO\nlist.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 12:54:59 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> \"Thomas G. Lockhart\" <[email protected]> writes:\n> > The parser is converting this query to become\n> > select x from f8 where x = float8(500);\n> \n> > The problem appears to be that the optimizer/executor does not know how\n> > to evaluate the constant string once-only, and insists on doing a\n> > sequential scan for some reason.\n> \n> Ah, it's finally starting to make some sense to me. What you're saying\n> is that this is a failure to do constant-folding.\n\n\nYep. I believe it happens in the executor, but doesn't appear to happen\nin the optimizer at a time when it would be useful. You can create\nfunctional indexes, and I think they are matched by the function, just\nnot constants.\n\n> \n> Doing a sequential scan would be appropriate if the righthand side of\n> the comparison needed to be evaluated afresh at each row. If the\n> optimizer thinks that, then that explains a lot.\n\n\nYep. I think that is the issue, and index matching does not\npre-evaluate a function on a constant.\n\n> \n> The question then is why the righthand side doesn't look like a\n> constant. I'd have expected that any expression not involving a table\n> attribute would be evaluated once (folded into a constant) before any\n> decisions are made on how to perform the scan. Is that reasonable, or\n> is there some aspect of SQL semantics that makes it wrong?\n> \n> If it is supposed to be happening, could it be that float8() is for\n> some reason not marked as a safely foldable function?\n> \n> While I'm asking dumb questions: are \"float8(500)\" and \"500::float8\"\n> treated differently? Actually, I can see that they are:\n> \n> \tplay=> explain select x from f8 where x = 500::float8;\n> \tNOTICE: QUERY PLAN:\n> \tIndex Scan using f8_i on f8 (cost=2.05 size=1 width=8)\n> \n> \tplay=> explain select x from f8 where x = float8(500);\n> \tNOTICE: QUERY PLAN:\n> \tSeq Scan on f8 (cost=40.00 size=100 width=8)\n> \n> But why? Is there a difference in semantics?\n\nSure. In the :: case (or CAST (const AS type)), the parser actually\nconverts the type INSIDE the parser to the proper type. In the float8()\ncase, the value conversion is delayed until the executor.\n\nI may be wrong in some of this, but that is what I think is happening.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 13:13:24 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "Thomas G. Lockhart wrote:\n> \n> > istm that we should be focusing on Vadim's hints on what it would take\n> > to use indices with function calls on constants...\n> \n> Looking at Vadim's note again, maybe it will be the parser's duty to\n> insert the PARAM_EXEC node; will need more details or some time to look\n> at it...\n\nSorry, but maybe it would be better to add new attribute\nto pg_proc (and change CREATE FUNCTION syntax) to let\nparser know does result of function call on constants depend\non execution time or not. This would be much better just\nexecute function in parser and replace function with\nconstant.\nCurrently, only random(), now() and SPI-functions should be\nreplaced by PARAM_EXEC, all others could be evaluated by parser.\n\nVadim\n", "msg_date": "Thu, 06 Aug 1998 14:32:44 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> Thomas G. Lockhart wrote:\n> > \n> > > istm that we should be focusing on Vadim's hints on what it would take\n> > > to use indices with function calls on constants...\n> > \n> > Looking at Vadim's note again, maybe it will be the parser's duty to\n> > insert the PARAM_EXEC node; will need more details or some time to look\n> > at it...\n> \n> Sorry, but maybe it would be better to add new attribute\n> to pg_proc (and change CREATE FUNCTION syntax) to let\n> parser know does result of function call on constants depend\n> on execution time or not. This would be much better just\n> execute function in parser and replace function with\n> constant.\n> Currently, only random(), now() and SPI-functions should be\n> replaced by PARAM_EXEC, all others could be evaluated by parser.\n\nI see. We have pg_proc.proiscachable. This looks like a good\ncandidate, and is not used for anything currently. Maybe rename it to\nsomething clearer.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 11:41:06 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": " > Sorry, but maybe it would be better to add new attribute\n > to pg_proc (and change CREATE FUNCTION syntax) to let\n > parser know does result of function call on constants depend\n > on execution time or not. This would be much better just\n > execute function in parser and replace function with\n > constant.\n > Currently, only random(), now() and SPI-functions should be\n > replaced by PARAM_EXEC, all others could be evaluated by parser.\n\n I see. We have pg_proc.proiscachable. This looks like a good\n candidate, and is not used for anything currently. Maybe rename it to\n something clearer.\n\nWouldn't the concept of VOLATILE be relevant here (ala the same\nkeyword in C and C++)? In those languages the keyword influences the\nnature of optimizations that can be done, which seems to be the\nproblems involved here. We could have a function bool\npg_proc.is_volatile() to determine whether or not the result of the\nfunction call can be determined from its arguments. If so and the\narguments are constants, the function could be evaluated once in the\nparser; otherwise, it would need to be evaluated for each tuple.\n\nThe current situation, I presume, corresponds with all functions being\nVOLATILE and hence evaluated many times. We could 1) add new syntax\nfor declaring user-defined functions to optionally include VOLATILE\n(and/or NONVOLATILE; default being VOLATILE in the absense of a\nkeyword to maintain compatibility and to be safe), 2) have the\nis_volatile() function return appropriate values for all \"standard\"\nfunctions defined in the system, and 3) include handling of the\ndistinction in the parser.\n\nCheers,\nBrook\n", "msg_date": "Thu, 6 Aug 1998 12:42:12 -0600 (MDT)", "msg_from": "Brook Milligan <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> \n> > Sorry, but maybe it would be better to add new attribute\n> > to pg_proc (and change CREATE FUNCTION syntax) to let\n> > parser know does result of function call on constants depend\n> > on execution time or not. This would be much better just\n> > execute function in parser and replace function with\n> > constant.\n> > Currently, only random(), now() and SPI-functions should be\n> > replaced by PARAM_EXEC, all others could be evaluated by parser.\n> \n> I see. We have pg_proc.proiscachable. This looks like a good\n> candidate, and is not used for anything currently. Maybe rename it to\n> something clearer.\n> \n> Wouldn't the concept of VOLATILE be relevant here (ala the same\n> keyword in C and C++)? In those languages the keyword influences the\n> nature of optimizations that can be done, which seems to be the\n> problems involved here. We could have a function bool\n> pg_proc.is_volatile() to determine whether or not the result of the\n> function call can be determined from its arguments. If so and the\n> arguments are constants, the function could be evaluated once in the\n> parser; otherwise, it would need to be evaluated for each tuple.\n\nIn Illustra this is called \"variant\". A variant function (eg random()) must\nbe evaluated each time. A nonvariant function can have it's result cached\nnot just in the parser, and not just for constants, but also for any run of\nidentical argument values such as might occur in a table scan. \n\nFor example assuming projected_price_calc() is an expensive but nonvariant\nfunction and the rows returned from the join are ordered by stock symbol\nthe following query wins big time if the result of projected_price_calc()\ncan be cached from one execution to the next.\n\nselect symbol, price from stocks, trades\n where trades.symbol = stocks.symbol\n and projected_price_calc(stocks.symbol) < price;\n\nThat is, don't think of this as a special case in the parser for doing\nconstant folding, think of it as a general way of \"memoizing\" or cacheing\nfunction results. Hence the current name \"iscacheble\" is actually pretty\ngood.\n\nAlso, perhaps instead of doing constant folding in the parser, consider makeing\nit part of rewrite. This pass would just traverse the tree looking for\nfunctions with constant arguements and would pre-evaluate them and and\nsave the result in the wherever the cacheable results would be stored. No\nspecial case required except that the optimizer would have to notice that\na pre-computed result was available to use as a key value.\n\n-dg\n\nDavid Gould [email protected] 510.628.3783 or 510.305.9468 \nInformix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n - If simplicity worked, the world would be overrun with insects. -\n", "msg_date": "Thu, 6 Aug 1998 17:00:32 -0700 (PDT)", "msg_from": "[email protected] (David Gould)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "David Gould wrote:\n> \n> >\n> > Wouldn't the concept of VOLATILE be relevant here (ala the same\n> > keyword in C and C++)? In those languages the keyword influences the\n> > nature of optimizations that can be done, which seems to be the\n> > problems involved here. We could have a function bool\n> > pg_proc.is_volatile() to determine whether or not the result of the\n> > function call can be determined from its arguments. If so and the\n> > arguments are constants, the function could be evaluated once in the\n> > parser; otherwise, it would need to be evaluated for each tuple.\n ^^^^^^^^^^^^^^\n> In Illustra this is called \"variant\". A variant function (eg random()) must\n> be evaluated each time. A nonvariant function can have it's result cached\n ^^^^^^^^^\nI don't like the idea to evaluate random() in WHERE x = random()\nfor _each_ tuple. The same for WHERE insert_date = now() - 5 \n/* 5 days */. Imho, these functions should be evaluated ONCE\nby executor, but EACH time when executor starts. There is big \ndifference between evaluation in parser/planner and in executor \ndue to ability (currently, very limitted) to have prepared plans \n(parsed/planned). And nothing more. Imho, queries must return\nconsistent set of data: if I want to get rows inserted 5 days\nago and run query with WHERE insert_date = now() - 5 near 12PM\nthen I risk to get inconsistent set of rows if now() will be\nevaluated for EACH tuple.\n\n> Also, perhaps instead of doing constant folding in the parser, consider makeing\n> it part of rewrite. This pass would just traverse the tree looking for\n> functions with constant arguements and would pre-evaluate them and and\n> save the result in the wherever the cacheable results would be stored. No\n> special case required except that the optimizer would have to notice that\n> a pre-computed result was available to use as a key value.\n\nThis is bad for performance.\n\nVadim\n", "msg_date": "Fri, 07 Aug 1998 10:45:02 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "Vadim writes:\n> David Gould wrote:\n... ^^^^^^^^^^^^^^\n> > In Illustra this is called \"variant\". A variant function (eg random()) must\n> > be evaluated each time. A nonvariant function can have it's result cached\n> ^^^^^^^^^\n> I don't like the idea to evaluate random() in WHERE x = random()\n> for _each_ tuple. The same for WHERE insert_date = now() - 5 \n> /* 5 days */. Imho, these functions should be evaluated ONCE\n> by executor, but EACH time when executor starts. There is big \n> difference between evaluation in parser/planner and in executor \n> due to ability (currently, very limitted) to have prepared plans \n> (parsed/planned). And nothing more. Imho, queries must return\n> consistent set of data: if I want to get rows inserted 5 days\n> ago and run query with WHERE insert_date = now() - 5 near 12PM\n> then I risk to get inconsistent set of rows if now() will be\n> evaluated for EACH tuple.\n\nPerhaps random was a bad example, the point I was trying to make was that\nit is a function that is not wholely determined by its arguments.\n\nHowever, I disagree with your contention about random() and now() also. Think\nabout the statement\n\ninsert into samples \n select random(), xval, yval from points;\n\nThe intent being to associate a random value with each of the x,y pairs...\n\n\n> > Also, perhaps instead of doing constant folding in the parser, consider makeing\n> > it part of rewrite. This pass would just traverse the tree looking for\n> > functions with constant arguements and would pre-evaluate them and and\n> > save the result in the wherever the cacheable results would be stored. No\n> > special case required except that the optimizer would have to notice that\n> > a pre-computed result was available to use as a key value.\n>\n> This is bad for performance.\n\nWhat_ is the \"This\" that is bad for performance? It is not clear what you\nmean here.\n\nDo you mean memoizing? If so, I strongly disagree, and there is a ton of\nwork on this that supports me.\n\nOr do you mean adding the cacheable function optimization to rewrite? If so,\nwhy is this a problem? I am assuming that this can be piggybacked on one\nof the existing expression tree traversals, so I just don't see how\nthis creates more work than doing it in the parser.\n\n> Vadim\n> \n\n-dg\n\nDavid Gould [email protected] 510.628.3783 or 510.305.9468 \nInformix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n - If simplicity worked, the world would be overrun with insects. -\n", "msg_date": "Thu, 6 Aug 1998 20:43:36 -0700 (PDT)", "msg_from": "[email protected] (David Gould)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "David Gould wrote:\n> \n> > ^^^^^^^^^\n> > I don't like the idea to evaluate random() in WHERE x = random()\n> > for _each_ tuple. The same for WHERE insert_date = now() - 5\n> > /* 5 days */. Imho, these functions should be evaluated ONCE\n> > by executor, but EACH time when executor starts. There is big\n> > difference between evaluation in parser/planner and in executor\n> > due to ability (currently, very limitted) to have prepared plans\n> > (parsed/planned). And nothing more. Imho, queries must return\n> > consistent set of data: if I want to get rows inserted 5 days\n> > ago and run query with WHERE insert_date = now() - 5 near 12PM\n> > then I risk to get inconsistent set of rows if now() will be\n> > evaluated for EACH tuple.\n> \n> Perhaps random was a bad example, the point I was trying to make was that\n> it is a function that is not wholely determined by its arguments.\n> \n> However, I disagree with your contention about random() and now() also. \n> Think about the statement\n> \n> insert into samples\n> select random(), xval, yval from points;\n> \n> The intent being to associate a random value with each of the x,y pairs...\n\nImho, we have to treat random() etc differently in target list and\nqual! WHERE defines set of rows to be returned by query, functions\nin target list define representation of this set.\n\n> \n> > > Also, perhaps instead of doing constant folding in the parser, consider makeing\n> > > it part of rewrite. This pass would just traverse the tree looking for\n> > > functions with constant arguements and would pre-evaluate them and and\n> > > save the result in the wherever the cacheable results would be stored. No\n> > > special case required except that the optimizer would have to notice that\n> > > a pre-computed result was available to use as a key value.\n> >\n> > This is bad for performance.\n> \n> What_ is the \"This\" that is bad for performance? It is not clear what you\n> mean here.\n> \n> Do you mean memoizing? If so, I strongly disagree, and there is a ton of\n> work on this that supports me.\n> \n> Or do you mean adding the cacheable function optimization to rewrite? If so,\n ^^^^^^^^^^\nThis. Why should we traverse the tree once more time?\nWhat the problem to let parser handle these functions?\n\n> why is this a problem? I am assuming that this can be piggybacked on one\n> of the existing expression tree traversals, so I just don't see how\n> this creates more work than doing it in the parser.\n\nVadim\n", "msg_date": "Fri, 07 Aug 1998 12:54:17 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> David Gould wrote:\n> > \n> > > ^^^^^^^^^\n> > > I don't like the idea to evaluate random() in WHERE x = random()\n> > > for _each_ tuple. The same for WHERE insert_date = now() - 5\n> > > /* 5 days */. Imho, these functions should be evaluated ONCE\n> > > by executor, but EACH time when executor starts. There is big\n> > > difference between evaluation in parser/planner and in executor\n> > > due to ability (currently, very limitted) to have prepared plans\n> > > (parsed/planned). And nothing more. Imho, queries must return\n> > > consistent set of data: if I want to get rows inserted 5 days\n> > > ago and run query with WHERE insert_date = now() - 5 near 12PM\n> > > then I risk to get inconsistent set of rows if now() will be\n> > > evaluated for EACH tuple.\n> > \n> > Perhaps random was a bad example, the point I was trying to make was that\n> > it is a function that is not wholely determined by its arguments.\n> > \n> > However, I disagree with your contention about random() and now() also. \n> > Think about the statement\n> > \n> > insert into samples\n> > select random(), xval, yval from points;\n> > \n> > The intent being to associate a random value with each of the x,y pairs...\n> \n> Imho, we have to treat random() etc differently in target list and\n> qual! WHERE defines set of rows to be returned by query, functions\n> in target list define representation of this set.\n> \n> > \n> > > > Also, perhaps instead of doing constant folding in the parser, consider makeing\n> > > > it part of rewrite. This pass would just traverse the tree looking for\n> > > > functions with constant arguements and would pre-evaluate them and and\n> > > > save the result in the wherever the cacheable results would be stored. No\n> > > > special case required except that the optimizer would have to notice that\n> > > > a pre-computed result was available to use as a key value.\n> > >\n> > > This is bad for performance.\n> > \n> > What_ is the \"This\" that is bad for performance? It is not clear what you\n> > mean here.\n> > \n> > Do you mean memoizing? If so, I strongly disagree, and there is a ton of\n> > work on this that supports me.\n> > \n> > Or do you mean adding the cacheable function optimization to rewrite? If so,\n> ^^^^^^^^^^\n> This. Why should we traverse the tree once more time?\n> What the problem to let parser handle these functions?\n> \n> > why is this a problem? I am assuming that this can be piggybacked on one\n> > of the existing expression tree traversals, so I just don't see how\n> > this creates more work than doing it in the parser.\n\nYep. Rewrite already is confusing. Parser has this type of handling in\nthere already.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 7 Aug 1998 01:03:42 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> Imho, queries must return\n> consistent set of data: if I want to get rows inserted 5 days\n> ago and run query with WHERE insert_date = now() - 5 near 12PM\n> then I risk to get inconsistent set of rows if now() will be\n> evaluated for EACH tuple.\n\nThis is perhaps a bad example, because now() (and 'now') return the\ntransaction time, guaranteed to be the same for each row evaluation of a\nquery, and the same for every query within a transaction.\n\nWhat should be behavior of\n\n update x set i = random();\n\nbe? I would have assumed that random() is evaluated once; are there any\ntruely volatile functions in SQL92?\n\n> > Also, perhaps instead of doing constant folding in the parser, \n> > consider making it part of rewrite. This pass would just traverse \n> > the tree looking for functions with constant arguements and would \n> > pre-evaluate them and and save the result in the wherever the \n> > cacheable results would be stored. No special case required except \n> > that the optimizer would have to notice that a pre-computed result \n> > was available to use as a key value.\n> This is bad for performance.\n\nWhat makes this bad for performance? An extra traversal of the parse\ntree? Or something else??\n\n - Tom\n", "msg_date": "Fri, 07 Aug 1998 05:07:29 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "Thomas G. Lockhart wrote:\n> \n> > Imho, queries must return\n> > consistent set of data: if I want to get rows inserted 5 days\n> > ago and run query with WHERE insert_date = now() - 5 near 12PM\n> > then I risk to get inconsistent set of rows if now() will be\n> > evaluated for EACH tuple.\n> \n> This is perhaps a bad example, because now() (and 'now') return the\n> transaction time, guaranteed to be the same for each row evaluation of a\n> query, and the same for every query within a transaction.\n\nyes, this is bad example -:)\n\n> \n> What should be behavior of\n> \n> update x set i = random();\n> \n> be? I would have assumed that random() is evaluated once; are there any\n\nI don't know. I mostly concern about WHERE just because of this\ndefines data set to be returned by query.\n\n> truely volatile functions in SQL92?\n\nThis is what I also would like to know.\n\n> \n> > > Also, perhaps instead of doing constant folding in the parser,\n> > > consider making it part of rewrite. This pass would just traverse\n> > > the tree looking for functions with constant arguements and would\n> > > pre-evaluate them and and save the result in the wherever the\n> > > cacheable results would be stored. No special case required except\n> > > that the optimizer would have to notice that a pre-computed result\n> > > was available to use as a key value.\n> > This is bad for performance.\n> \n> What makes this bad for performance? An extra traversal of the parse\n ^^^^^^^^^^^^^^^\nThis. I don't see any reasons for this.\n\n> tree? Or something else??\n\nVadim\n", "msg_date": "Fri, 07 Aug 1998 13:13:06 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "> This is perhaps a bad example, because now() (and 'now') return the\n> transaction time, guaranteed to be the same for each row evaluation of a\n> query, and the same for every query within a transaction.\n> \n> What should be behavior of\n> \n> update x set i = random();\n> \n> be? I would have assumed that random() is evaluated once; are there any\n> truely volatile functions in SQL92?\n\nHmmm, I would have thought that was a clever way to get a nice random\nvalue into each row ;-)\n\nBut seriously, we have the iscacheable attribute for functions. So,\n\n update pg_func set iscacheable = 'false' where pg_func.name = 'random';\n\nand you get different random values in all the rows. Or do\n\nupdate pg_func set iscacheable = 'true' where pg_func.name = 'random';\n\nand you get the same random value in all the rows.\n\nOr at least this is how postgres was intended to work. It was meant to\nbe an extensible table driven system. Hardcoding stuff \"because it is the\nright way\" is really assuming that we know better than the users what they\nwant to do. Almost never true.\n\n-dg\n\nDavid Gould [email protected] 510.628.3783 or 510.305.9468 \nInformix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n - If simplicity worked, the world would be overrun with insects. -\n", "msg_date": "Thu, 6 Aug 1998 22:58:40 -0700 (PDT)", "msg_from": "[email protected] (David Gould)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" }, { "msg_contents": "\nVadim writes:\n> Imho, we have to treat random() etc differently in target list and\n> qual! WHERE defines set of rows to be returned by query, functions\n> in target list define representation of this set.\n\nMaybe, but it sure makes the system harder to explain. For example, what\nhappens to a function in the target list of a subquery select? And what\nshould happen. \n\nBut, perhaps we should just do whatever is easiest since anyone who writes\na query:\n\n select * from x where x.key = random();\n\nprobably deserves whatever they get ;-)\n\nSeriously, I have never seen random used in a where clause. And I don't think\nthat queries like\n\n select * from events where event.time = timenow();\n\nmake a lot of sense either. How did event.time get to be _equal_ to the\ncurrent time. Given that it had to be inserted earlier and the time of\nthe select would not have been known then.\n\nMy point is anyone who uses a variant function in a where clause already\nis pretty confused. To tell them that variant functions aren't variant when\nused in where clauses probably will just confuse them more.\n\n-dg\n\n\nDavid Gould [email protected] 510.628.3783 or 510.305.9468 \nInformix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n - If simplicity worked, the world would be overrun with insects. -\n", "msg_date": "Thu, 6 Aug 1998 23:06:37 -0700 (PDT)", "msg_from": "[email protected] (David Gould)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" } ]
[ { "msg_contents": "Hello!\n\nI am developing a web interface to postgresql. Basically using ePerl, \nJavascript, and apache. The other mailing lists didn't seem appropriate. \n\nI am open to using another language interface besides ePerl. I didn't go\nwith php or Embperl because I just wanted basic perl commands in the\nwebpages. \n\nIs there anybody intersted in helping me develop the web interface? \nI basically got it to a read-only or view-only interface. It will let you\nselect a database and then a table, and view that table in a new window. \n\nMy ultimate goal for this month is to just be able to add and edit\nrows in the table. Once that is accmplished, the other stuff shouldn't\nbe too complicated. \n\nI am gone for a week this wednesday, but I will be back\nthe wednesday after. \n\nMark\n\n", "msg_date": "Sun, 2 Aug 1998 21:08:49 -0400 (EDT)", "msg_from": "Mark Nielsen <[email protected]>", "msg_from_op": true, "msg_subject": "is this allowed here-- I am developing an interface to postgresql" }, { "msg_contents": "On Sun, 2 Aug 1998, Mark Nielsen wrote:\n\n> Hello!\n> \n> I am developing a web interface to postgresql. Basically using ePerl, \n ^^^^^^^^^\n\n\[email protected] is more appropriate...\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 3 Aug 1998 03:47:12 -0300 (ADT)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] is this allowed here-- I am developing an interface\n\tto postgresql" }, { "msg_contents": "Thus spake Mark Nielsen\n> I am developing a web interface to postgresql. Basically using ePerl, \n> Javascript, and apache. The other mailing lists didn't seem appropriate. \n\nTry the ionterfaces list.\n\n> I am open to using another language interface besides ePerl. I didn't go\n> with php or Embperl because I just wanted basic perl commands in the\n> webpages. \n\nHave you looked at Python? You can get information on using Python\nwith PostgreSQL at http://www.druid.net/pygresql/. You can also\nget PyApache which includes Python as an Apache module. I have a few\nsimple examples set up at http://www.vex.net/py_examples/.\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 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n", "msg_date": "Mon, 3 Aug 1998 13:08:12 -0400 (EDT)", "msg_from": "[email protected] (D'Arcy J.M. Cain)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] is this allowed here-- I am developing an interface to\n\tpostgresql" } ]
[ { "msg_contents": "Don't worry, I won't post here anymore, I think I found the appropriate\nmailing list \"interfaces\" as a better choice and leave you guys at the\nreal work. \n\nBy the way, thanks for all hard work you guys have been doing!!!!\n\nMark\n\n", "msg_date": "Sun, 2 Aug 1998 22:05:41 -0400 (EDT)", "msg_from": "Mark Nielsen <[email protected]>", "msg_from_op": true, "msg_subject": "won't post here anymore, foudn better " } ]
[ { "msg_contents": "I have updated the backend flowchart so it is narrower for low\nresolution monitors, and I have added color to make it clearer.\n\nYou can view it on www.postgresql.org under documentation, or in the\ncurrent CVS tree in tools/backend/.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 3 Aug 1998 01:50:32 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "New color flowchart" } ]
[ { "msg_contents": "Vadim Mikheev wrote:\n> \n> Andreas Zeugswetter wrote:\n> >\n> > I would say allow the drop table, of course only if no update or\n> > intent update (select for update) lock is on it.\n> > This is how Informix behaves. Otherwise it will become very\n> > hard to drop tables altogether.\n> \n> Ok, currently, table can't be dropped if SELECTed by another\n> running transaction.\n> \n> Would we like to change this ?!\n\nNo, I think this is ok. I thought the current behavior was that a selecter won't\ndo a lock, and therefore drop table would work and wanted to give an argument to leave it as is.\nI regard a drop table to be seldom used, e.g. at product installations or upgrades.\n\nAndreas\n\n", "msg_date": "Mon, 3 Aug 1998 13:57:46 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Dropping tables..." } ]
[ { "msg_contents": "Hi,\n\nHow many files really needed for postgres ?\nOn my Linux box I checked this by lsof and found 443 open files (and sockets)\nby 7 backends + 1 postmaster ?\nThis is amazing. Do postgres really needs to keep so much open files ?\nI use apache+mod_perl and Apache::DBI for authent./authorization\nand it's not difficult to reach file table limit when running\n15 httpd daemons + 15 backends. I use persistent connections,\nso backends will stay alive. A number of backends could grow if\nI use different connection string (I try to avoid this).\nThis is my development computers and there are another bunch of processes \n(X, window manager etc).\n\n\tRegards,\n\n\t Oleg\n_____________________________________________________________\nOleg Bartunov, sci.researcher, hostmaster of AstroNet,\nSternberg Astronomical Institute, Moscow University (Russia)\nInternet: [email protected], http://www.sai.msu.su/~megera/\nphone: +007(095)939-16-83, +007(095)939-23-83\n\n", "msg_date": "Mon, 3 Aug 1998 16:44:31 +0400 (MSK DST)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": true, "msg_subject": "number of opened files ?" }, { "msg_contents": "\nOn Mon, 3 Aug 1998, Oleg Bartunov wrote:\n\n> Hi,\n> \n> How many files really needed for postgres ?\n> On my Linux box I checked this by lsof and found 443 open files (and sockets)\n> by 7 backends + 1 postmaster ?\n\n Postgres will keep a some files open.\n\n> This is amazing. Do postgres really needs to keep so much open files ?\n\n 443 is not that many.\n\n> I use apache+mod_perl and Apache::DBI for authent./authorization\n> and it's not difficult to reach file table limit when running\n\n Huh? Most systems have a file table limit of several thousand. I think\nyou need to check it into this. I have a max of 2088 descriptors on most\nsystems here, and I double that if necessary.\n\n> 15 httpd daemons + 15 backends. I use persistent connections,\n> so backends will stay alive. A number of backends could grow if\n> I use different connection string (I try to avoid this).\n> This is my development computers and there are another bunch of processes \n> (X, window manager etc).\n> \n> \tRegards,\n> \n> \t Oleg\n> _____________________________________________________________\n> Oleg Bartunov, sci.researcher, hostmaster of AstroNet,\n> Sternberg Astronomical Institute, Moscow University (Russia)\n> Internet: [email protected], http://www.sai.msu.su/~megera/\n> phone: +007(095)939-16-83, +007(095)939-23-83\n\nTom\n\n", "msg_date": "Mon, 3 Aug 1998 21:03:11 -0700 (PDT)", "msg_from": "Tom <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] number of opened files ?" } ]
[ { "msg_contents": "\n\t\n>>\[email protected] (J Christopher Bower) writes:\n\t> I decided to debug the 6.1 pg_dump source and determined that the core dump \n\t> occured dumping tblinfo cleanup. Specifically when structures allocated for \n\t> sequence tables are being cleaned up.\n\t\n\t\n>>\tIt looks like this bug has been fixed in a different way in the current\n>>\tpg_dump sources (clearTableInfo now knows that sequences don't have the\n>>\tstandard attributes). It also looks like pg_dump has changed enough\n>>\tsince 6.1 that any patches wouldn't be easily transferred back and\n>>\tforth anyway.\n\t\n>>\tYou might be able to run the current pg_dump against your 6.1 database\n>>\tby recompiling the current pg_dump.c/.h/common.c atop the 6.1 libpq.\n>>\tThat should cure the protocol incompatibility. However, pg_dump is\n>>\tfriendly enough with the system table layouts that I fear it might not\n>>\twork with an old database anyway.\n\t\n>>\tProbably your best bet is just to go ahead and use your patched pg_dump\n>>\tto extract data from your old database.\n\t\n>>\t\t\t\tregards, tom lane\n\t\n\tTom,\n\n\tThanks for your help it looks like I'll proceed with my modified version \n\tof pg_dump. \n\n\tCompiling pg_dump 6.3.2 with the 6.1 libpq was successfull. This pg_dump\n\tcould connect to the database but failed when it attempted to perform a \n\tselect from pg_class in the 6.1 database and expected the attribute \n\trelcheck. Apparently pg_class has been restructure somewhere between \n\t6.1 and 6.3.2.\n\n\tI'm confused because the documentation that I read indicates that the \n\t6.3.2 pg_dump should be able to dump the 6.1 database. But appaently\n\tthis cannot be done, atleast with my 6.1 database.\t\n\n\tAgain thanks for your help.\n\n\t\t\t\tChris Bower\n\n\n\n", "msg_date": "Mon, 3 Aug 1998 09:04:30 -0400", "msg_from": "[email protected] (J Christopher Bower)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] 6.1 pg_dump core dump" }, { "msg_contents": "> I'm confused because the documentation that I read indicates that the\n> 6.3.2 pg_dump should be able to dump the 6.1 database. But apparently\n> this cannot be done, atleast with my 6.1 database.\n\nWhere did you see this? We can fix the docs to be more accurate...\n\n - Tom\n", "msg_date": "Mon, 03 Aug 1998 14:34:20 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 6.1 pg_dump core dump" } ]
[ { "msg_contents": "On Sun, 2 Aug 1998, Patrick Michael Kane wrote:\n\n> Date: Sun, 2 Aug 1998 11:38:39 -0700\n> From: Patrick Michael Kane <[email protected]>\n> Reply-To: [email protected]\n> To: [email protected]\n> Subject: Re: How to rid off persistent database connection ?\n> \n> On Sun, Aug 02, 1998 at 08:32:22PM +0200, Edmund Mergl wrote:\n> > Oleg Bartunov wrote:\n> > > \n> > \n> > > \n> > > Currently we have about 150 000 queries (selects only) to postgres in day and\n> > > our server ( DUAL PPRO, 256 Mb RAM, SCSI UW) seems works ok.\n> > > Will see what happens when I switch to mod_perl enhanced apache with\n> > > Apache::DBI authorization.\n> > > \n> > > But what I'm really worry about is how to gently interrupt alive database\n> > > connection, for example to do some administrative job (backup, update ...)\n> > > \n> > > Regards,\n> > > \n> > > Oleg\n> > \n> [snip]\n> > \n> > For backups there should be no need to interrupt the database\n> > connection,\n> > at least for read-only access.\n> > \n> > For updates I would keep the database connections and just redirect\n> > any access to a page which tells the user, that the database is\n> > currently\n> > not accessible.\n> \n> Edmund's suggestion has the additional benefit of working even if you\n> shutdown the database and bring it back up, assuming your DBD has a ping()\n> method. Apache::DBI will notice that the database handle is no longer valid\n> and bring a new one online, without any intervention on your part.\n\nJust tried to shutdown database (PostgreSQL) by killing postmaster\nand keeping established connections (backends) alive. This works fine - \nI still can access database using these connections \n(through mod_perl cgi, of course, only)\nBut new connection couldn't established because of absent of postmaster\nand I can't restart it because it can't bind port:\n\nmira:~$ runpostgres \nFATAL: StreamServerPort: bind() failed: errno=98\n Is another postmaster already running on that port?\n If not, wait a few seconds and retry.\n/usr/local/pgsql/bin/postmaster: cannot create INET stream port\n\nThere are no postmaster I already killed him.\nI don't know if this postgreSQL problem, though.\nAfter killing all backends I restarted postmaster and noticed in error_log\nmessages from Apache::DBI\nDatabase handle destroyed without explicit disconnect ....\nand this I understand. Is it possible accurately close all connections \nusing Apache::DBI and then do all admin. jobs (redirect requests to\nanother page, shutdown database etc..) \n\n\tRegards,\n\n\t\tOleg\n\n> -- \n> Patrick Michael Kane\n> <[email protected]>\n> \n\n_____________________________________________________________\nOleg Bartunov, sci.researcher, hostmaster of AstroNet,\nSternberg Astronomical Institute, Moscow University (Russia)\nInternet: [email protected], http://www.sai.msu.su/~megera/\nphone: +007(095)939-16-83, +007(095)939-23-83\n\n\n", "msg_date": "Mon, 3 Aug 1998 17:24:57 +0400 (MSK DST)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": true, "msg_subject": "None" } ]
[ { "msg_contents": "unsubscribe [email protected]\n\n", "msg_date": "Mon, 03 Aug 1998 09:59:42 -0400", "msg_from": "fcheese <[email protected]>", "msg_from_op": true, "msg_subject": "(no subject)" } ]
[ { "msg_contents": "It appears to me that there is a bug in gram.y. From looking at the code\n(while working on ecpg) it seems that it doesn't accept a createdb with th\neoption: with location = ... but without the option with encoding = ...\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Mon, 3 Aug 1998 17:15:16 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Bug in gram.y?" }, { "msg_contents": "> It appears to me that there is a bug in gram.y. From looking at the code\n> (while working on ecpg) it seems that it doesn't accept a createdb with th\n> eoption: with location = ... but without the option with encoding = ...\n\nLooks fine to me:\n\nopt_database1: LOCATION '=' location { $$ = $3; }\n | /*EMPTY*/ { $$ = NULL; }\n ;\n \nopt_database2: ENCODING '=' encoding { $$ = $3; }\n | /*EMPTY*/ { $$ = NULL; }\n ;\n \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 3 Aug 1998 14:19:44 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Bug in gram.y?" }, { "msg_contents": "> > it seems that it doesn't accept a createdb with the\n> > option location = ... but without the option encoding = ...\n\nI think the code is sub-optimal for a couple of reasons:\n\n1) LOCATION must be the first argument, ENCODING must be the second. The\nnumber and order of any options should be flexible.\n\n2) the options should have a comma delimiter between them. Currently\nthey do not. To introduce the comma delimiter will require restructuring\nthat part of the parsing, but isn't a big deal.\n\nI'm pretty sure that the options can be specified individually, but it\ndoes not generalize well. The two specific problems above should be\nconsidered fatal for a final version :/\n\nI've worked through problems like this for other SQL92 syntax, and can\nprobably fix up this one too. Will put it on my list unless someone else\nwants it...\n\n - Tom\n", "msg_date": "Tue, 04 Aug 1998 02:10:02 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Bug in gram.y?" }, { "msg_contents": ">> > it seems that it doesn't accept a createdb with the\n>> > option location = ... but without the option encoding = ...\n>\n>I think the code is sub-optimal for a couple of reasons:\n>\n>1) LOCATION must be the first argument, ENCODING must be the second. The\n>number and order of any options should be flexible.\n>\n>2) the options should have a comma delimiter between them. Currently\n>they do not. To introduce the comma delimiter will require restructuring\n>that part of the parsing, but isn't a big deal.\n>\n>I'm pretty sure that the options can be specified individually, but it\n>does not generalize well. The two specific problems above should be\n>considered fatal for a final version :/\n>\n>I've worked through problems like this for other SQL92 syntax, and can\n>probably fix up this one too. Will put it on my list unless someone else\n>wants it...\n\nI'm responsible for that problem. But seems you have a better\nsolution. Please take it.\n--\nTatsuo Ishii\[email protected]\n\n\n\n", "msg_date": "Tue, 04 Aug 1998 11:31:40 +0900", "msg_from": "[email protected]", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Bug in gram.y? " }, { "msg_contents": "On Mon, Aug 03, 1998 at 02:19:44PM -0400, Bruce Momjian wrote:\n> Looks fine to me:\n> \n> opt_database1: LOCATION '=' location { $$ = $3; }\n> | /*EMPTY*/ { $$ = NULL; }\n> ;\n> \n> opt_database2: ENCODING '=' encoding { $$ = $3; }\n> | /*EMPTY*/ { $$ = NULL; }\n> ;\n\nYes, but check the code under CreatedbStmt:\n\n\t\t\t\t\tn->dbpath = $5;\n#ifdef MULTIBYTE\n if ($6 != NULL) {\n n->encoding = pg_char_to_encoding($6);\n if (n->encoding < 0) {\n elog(ERROR, \"invalid encoding name %s\", $6);\n }\n } else {\n n->encoding = GetTemplateEncoding();\n }\n#else\n elog(ERROR, \"WITH ENCODING is not supported\");\n#endif\n $$ = (Node *)n;\n\n\nIf you have undefined MULTIBYTE you will get the WITH ENCODING error message\ndespite the command being legal even without this option.\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Tue, 4 Aug 1998 07:52:31 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Bug in gram.y?" }, { "msg_contents": "> On Mon, Aug 03, 1998 at 02:19:44PM -0400, Bruce Momjian wrote:\n> > Looks fine to me:\n> > \n> > opt_database1: LOCATION '=' location { $$ = $3; }\n> > | /*EMPTY*/ { $$ = NULL; }\n> > ;\n> > \n> > opt_database2: ENCODING '=' encoding { $$ = $3; }\n> > | /*EMPTY*/ { $$ = NULL; }\n> > ;\n> \n> Yes, but check the code under CreatedbStmt:\n> \n> \t\t\t\t\tn->dbpath = $5;\n> #ifdef MULTIBYTE\n> if ($6 != NULL) {\n> n->encoding = pg_char_to_encoding($6);\n> if (n->encoding < 0) {\n> elog(ERROR, \"invalid encoding name %s\", $6);\n> }\n> } else {\n> n->encoding = GetTemplateEncoding();\n> }\n> #else\n> elog(ERROR, \"WITH ENCODING is not supported\");\n> #endif\n> $$ = (Node *)n;\n> \n> \n> If you have undefined MULTIBYTE you will get the WITH ENCODING error message\n> despite the command being legal even without this option.\n\nGood point. I have changed it to:\n\n> } else {\n> n->encoding = GetTemplateEncoding();\n> }\n> #else\n> if ($6 != NULL)\n ^^^^^^^^^^^^^^^\n> elog(ERROR, \"WITH ENCODING is not supported\");\n> #endif\n> $$ = (Node *)n;\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 4 Aug 1998 13:37:30 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Bug in gram.y?" } ]
[ { "msg_contents": "\nIt's me and them indexes again. This time back to text.\n\nWhat is the difference (as far as an index is concerned) between:\n\nselect city from locations where lower(city) = lower('st. ignace');\n\nand \n\nselect city from locations where lower(city) = 'st. ignace';\n\nThe index was created like this:\n\ncreate index locations_city on locations(lower(city) text_ops);\n\n\nThe first gives me the Seq Scan and the second gives me the much needed\nIndex Scan (there are almost 170K rows in the table). I can probably\ndo the lower case conversion in advance in C (since this is called from\na C program) but what am I missing with the difference between these two\nstatements? As long as it's receiving lower case, why should the \noptomizer care what's on the right side of the equal sign?\n\nVery confused,\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] flame-mail: /dev/null\n # include <std/disclaimers.h> TEAM-OS2\n Online Searchable Campground Listings http://www.camping-usa.com\n \"There is no outfit less entitled to lecture me about bloat\n than the federal government\" -- Tony Snow\n==========================================================================\n\n\n", "msg_date": "Mon, 03 Aug 1998 15:10:51 -0400 (EDT)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": true, "msg_subject": "Text indexes..." } ]
[ { "msg_contents": "-----BEGIN PGP SIGNED MESSAGE-----\n\nI'm trying to get Keystone to work with PostgreSQL. One of the PHP\nfunctions they use retrieves attribute information on a table to find\nthe primary key (actually, it retrieves attribute information on a\ncolumn; it is very MySQL-oriented).\n\nI can't figure out which set of catalogues I need to search to find\nthis information. Can someone point me in the right direction?\n\nroland\n\n-----BEGIN PGP SIGNATURE-----\nVersion: 2.6.2\nComment: Processed by Mailcrypt 3.4, an Emacs/PGP interface\n\niQCVAwUBNcY/neoW38lmvDvNAQGudgP+LVdrSdnRgxhAdOm+juq6nMB6qvhy615P\nkQbsjbpMNFRsvh/XylOOVya+GyGIQ0EFfXi8VM+ttQpM8PUpny1gcrVpSnBML5Xs\ntoMPP7IxJEfx9sydJUfUYMlJxrclEohLYdqSX/YtXM9g8Gw+l0wW5meY4dtdjLjs\nbibycj5rKxE=\n=azTI\n-----END PGP SIGNATURE-----\n-- \nRoland B. Roberts, PhD Custom Software Solutions\[email protected] 101 West 15th St #4NN\n New York, NY 10011\n\n", "msg_date": "03 Aug 1998 18:54:48 -0400", "msg_from": "Roland Roberts <[email protected]>", "msg_from_op": true, "msg_subject": "PostgreSQL catalogues: finding the primary key" } ]
[ { "msg_contents": "I have changed EXPLAIN VERBOSE to pretty-print the plan, rather than\noutput the text as a long string.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 4 Aug 1998 00:51:58 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "EXPLAIN VERBOSE" } ]
[ { "msg_contents": "Can you tell me, please, how to construct a varlena (to be returned by\na function).\n\nI see it is declared as an int and a 1-byte array; I don't know how to\nassign a longer string in place of that 1-byte array; the compiler\ncomplains about incompatible types, whatever I do.\n\nThank you.\n\n-- \nOliver Elphick [email protected]\nIsle of Wight http://www.lfix.co.uk/oliver\n PGP key from public servers; key ID 32B8FAA1\n ========================================\n \"And not only so, but we glory in tribulations also; \n knowing that tribulation worketh patience; And \n patience, experience; and experience, hope.\" \n Romans 5:3,4 \n\n\n", "msg_date": "Tue, 04 Aug 1998 11:07:54 +0100", "msg_from": "\"Oliver Elphick\" <[email protected]>", "msg_from_op": true, "msg_subject": "How do I construct a varlena?" }, { "msg_contents": "On Tue, 4 Aug 1998, Oliver Elphick wrote:\n\n> Can you tell me, please, how to construct a varlena (to be returned by\n> a function).\n> \n> I see it is declared as an int and a 1-byte array; I don't know how to\n> assign a longer string in place of that 1-byte array; the compiler\n> complains about incompatible types, whatever I do.\n\nIf I'm correct:\n\n\tmalloc(sizeof(VARLENA) + l);\n\nwhere 'l' is the length of the string you want to put in (without the\ntrailing '\\0').\n\nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Tue, 4 Aug 1998 16:28:21 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] How do I construct a varlena?" }, { "msg_contents": "Maarten Boekhold wrote:\n >On Tue, 4 Aug 1998, Oliver Elphick wrote:\n >\n >> Can you tell me, please, how to construct a varlena (to be returned by\n >> a function).\n >> \n >> I see it is declared as an int and a 1-byte array; I don't know how to\n >> assign a longer string in place of that 1-byte array; the compiler\n >> complains about incompatible types, whatever I do.\n >\n >If I'm correct:\n >\n >\tmalloc(sizeof(VARLENA) + l);\n >\n >where 'l' is the length of the string you want to put in (without the\n >trailing '\\0').\n \nThanks for your reply; I've been away a few days so I've only just seen it.\n\nMy problem is in how to get the compiler to treat the malloced space as\na varlena.\n\nI have this (abridged) C code, to be used with \nCREATE FUNCTION cname(bpchar, bpchar, bpchar) returns bpchar ...:\n\n\n char *cxname;\n\n text cname (text s, text t, text f)\n {\n text *result;\n ...\n cxname = realloc((void *) cxname, strlen(tmp)+sizeof(struct varlena));\n strcpy(cxname+sizeof(int32), tmp);\n-> result = &((struct varlena) cxname);\n result->vl_len = strlen(tmp);\n\n return *result;\n }\n\nbut the compiler gives the error `conversion to non-scalar type requested'\nat the marked line.\n\nOnce I know how to do this, I will add it to the examples in the CREATE\nFUNCTION documentation, since it will no doubt be helpful to others.\n\n-- \nOliver Elphick [email protected]\nIsle of Wight http://www.lfix.co.uk/oliver\n PGP key from public servers; key ID 32B8FAA1\n ========================================\n \"...ask, and ye shall receive, that your joy may be \n full.\" John 16:24 \n\n\n", "msg_date": "Sun, 09 Aug 1998 20:45:24 +0100", "msg_from": "\"Oliver Elphick\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] How do I construct a varlena? " }, { "msg_contents": "> My problem is in how to get the compiler to treat the malloced space \n> as a varlena.\n> I have this (abridged) C code, to be used with\n> CREATE FUNCTION cname(bpchar, bpchar, bpchar) returns bpchar ...:\n> \n> char *cxname;\n> \n> text cname (text s, text t, text f)\n text *cname (text s, text t, text f)\n> {\n> text *result;\n> ...\n> cxname = realloc((void *) cxname,\n> strlen(tmp)+sizeof(struct varlena));\nstrcpy is dangerous because it will copy the trailing null, while text\nand other varlena types are not guaranteed to be null-terminated. Better\nto use memmove() or strncpy().\n> strcpy(cxname+sizeof(int32), tmp);\n strcpy(cxname+sizeof(result->vl_len), tmp);\nor\n strcpy(cxname+sizeof(VARHDRSZ), tmp);\nnot sure where tmp came from...\n> -> result = &((struct varlena) cxname);\ncxname is already a pointer. And why not make it a pointer to text\ninstead of a pointer to char?\n result = ((text *) cxname);\n> result->vl_len = strlen(tmp);\n> \n> return *result;\n> }\n> Once I know how to do this, I will add it to the examples in the \n> CREATE FUNCTION documentation, since it will no doubt be helpful to \n> others.\n\nThere is already documentation on this (though it could stand to be\ncleaned up and augmented) in doc/src/sgml/xfunc.sgml. This appears in\nthe Programmer's Guide in the chapter titled \"Extending SQL: Functions\".\n\nIf you want, it's probably OK to keep the SQL reference docs pretty\nsimple, and if there is an example of C source code it could be shown\nbut then described more completely in the Programmer's Guide. Or we\ncould just mention that there _are_ examples in the Programmer's Guide\nand leave it at that.\n\nThere is some code following which gives a (simpler) example...\n\n - Tom\n\n>From the varlena.c file in backend/utils/adt/:\n\n/*\n * textin - converts \"...\" to internal representation\n */\ntext *\ntextin(char *inputText)\n{\n text *result;\n int len;\n\n if (inputText == NULL)\n return (NULL);\n\n len = strlen(inputText) + VARHDRSZ;\n result = (text *) palloc(len);\n VARSIZE(result) = len;\n\n memmove(VARDATA(result), inputText, len - VARHDRSZ);\n\n#ifdef CYR_RECODE\n convertstr(VARDATA(result), len - VARHDRSZ, 0);\n#endif\n\n return (result);\n}\n", "msg_date": "Mon, 10 Aug 1998 02:21:57 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] How do I construct a varlena?" }, { "msg_contents": "> My problem is in how to get the compiler to treat the malloced space as\n> a varlena.\n> \n> I have this (abridged) C code, to be used with \n> CREATE FUNCTION cname(bpchar, bpchar, bpchar) returns bpchar ...:\n> \n> \n> char *cxname;\n> \n> text cname (text s, text t, text f)\n> {\n> text *result;\n> ...\n> cxname = realloc((void *) cxname, strlen(tmp)+sizeof(struct varlena));\n> strcpy(cxname+sizeof(int32), tmp);\n> -> result = &((struct varlena) cxname);\n> result->vl_len = strlen(tmp);\n> \n> return *result;\n> }\n> \n> but the compiler gives the error `conversion to non-scalar type requested'\n> at the marked line.\n\nI gues something like this should work:\n\n struct varlena *cxname\n\n cxname = (struct varlena *)\n\t\trealloc(cxname, strlen(tmp) + VARHDRSZ);\n strcpy(cxname->vl_dat, tmp); /* maybe '&cxname->vl_dat' */\n return cxname;\n\nI don't think it's possible to 'return *cxname', cos the compiler will\nonly return the part of your data.\n\nMost of this is from head, so check on things if they don't work immediately.\n\nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Mon, 10 Aug 1998 09:20:17 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] How do I construct a varlena?" } ]
[ { "msg_contents": "I am new to SQL and was wondering how I would go\nabout selecting records from my database based on \nthe age of a date/time stamp.\n\nFor example if I wanted to select records older than\n12 hours or 1 day.\n\nAny help would be appreciated.\n\nThanks,\n\nWill McCracken\n", "msg_date": "Tue, 4 Aug 1998 10:09:31 -0400", "msg_from": "\"William McCracken\" <[email protected]>", "msg_from_op": true, "msg_subject": "Query based on date/time field" }, { "msg_contents": "At 15:50 +0300 on 12/8/98, Holger Mitterwald wrote:\n\n\n> On Tue, 4 Aug 1998, William McCracken wrote:\n>\n> > I am new to SQL and was wondering how I would go\n> > about selecting records from my database based on\n> > the age of a date/time stamp.\n> >\n> > For example if I wanted to select records older than\n> > 12 hours or 1 day.\n> >\n> > Any help would be appreciated.\n>\n> Sorry for my late response, but I was on holiday.\n> I use some statement like this to select entries that are not older than 2\n> weeks:\n>\n> SELECT DISTINCT landkreis FROM kneipe WHERE 1209600 >= (date_part('epoch',\n> current_date) - date_part('epoch',datum));\n>\n> datum is of type datetime.\n>\n> what I do is the following: epoch returns the seconds since january 1st\n> 1970 (I think). I substract the timestamp of each record from the current\n> timestamp (current_date). The result has to be smaller than the duration\n> for 2 weeks (in seconds, which is 1209600s).\n>\n> I dont know if there is a better solution, but it works fine.\n\nI think the following is simpler and more intuitive:\n\nSELECT * FROM the_table\nWHERE the_date >= ('now'::datetime - '12 hours'::timespan);\n\nThis assumes that the field \"the_date\" in \"the_table\" is of type datetime.\nIf it isn't, just convert it by using datetime( the_date ).\n\nThe amount of time described by the type timespan is very intuitive - it\naccepts, as you see, things like '12 hours', '1 day', or '2 months'. It\ntakes months correctly - with longer and shorter months taken into\naccounts. More about it in the pgbuiltin manpage.\n\nHerouth\n\n--\nHerouth Maoz, Internet developer.\nOpen University of Israel - Telem project\nhttp://telem.openu.ac.il/~herutma\n\n\n", "msg_date": "Wed, 12 Aug 1998 15:25:39 +0300", "msg_from": "Herouth Maoz <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] Query based on date/time field" }, { "msg_contents": "I just wanted to answer the initial question, but Heruoth managed to do so \nbefore me:-) Anyway, I decided to play with datetime and timespan types\nand was stuck with strange problem. Here it is:\nIf I subtract one datetime from another everithing is going as expected:\nuserbase=> select '12 Jun 98'::datetime-'11 Jun 98'::datetime;\n?column?\n--------\n@ 1 day\n(1 row)\n\nBut, subtracting one date from another one I got something like int:\nuserbase=> select '12 Jun 98'::date-'11 Jun 98'::date;\n?column?\n--------\n 1\n(1 row)\n\nThe next query explains more clearly that type of result is \"int4\":\nuserbase=> select ('12 Jun 98'::date-'11 Jun 98'::date)::datetime;\nERROR: function datetime(int4) does not exist\n\nIs that what is expected to be or a bug??\n( I'm running PostgreSQL 6.3.2p1-4 on Linux (SlackWare) 2.0.34 )\n\nOn Wed, 12 Aug 1998, Herouth Maoz wrote:\n\n> At 15:50 +0300 on 12/8/98, Holger Mitterwald wrote:\n> \n> \n> > On Tue, 4 Aug 1998, William McCracken wrote:\n> >\n> > > I am new to SQL and was wondering how I would go\n> > > about selecting records from my database based on\n> > > the age of a date/time stamp.\n> > >\n> > > For example if I wanted to select records older than\n> > > 12 hours or 1 day.\n> > >\n> > > Any help would be appreciated.\n> >\n> > Sorry for my late response, but I was on holiday.\n> > I use some statement like this to select entries that are not older than 2\n> > weeks:\n> >\n> > SELECT DISTINCT landkreis FROM kneipe WHERE 1209600 >= (date_part('epoch',\n> > current_date) - date_part('epoch',datum));\n> >\n> > datum is of type datetime.\n> >\n> > what I do is the following: epoch returns the seconds since january 1st\n> > 1970 (I think). I substract the timestamp of each record from the current\n> > timestamp (current_date). The result has to be smaller than the duration\n> > for 2 weeks (in seconds, which is 1209600s).\n> >\n> > I dont know if there is a better solution, but it works fine.\n> \n> I think the following is simpler and more intuitive:\n> \n> SELECT * FROM the_table\n> WHERE the_date >= ('now'::datetime - '12 hours'::timespan);\n> \n> This assumes that the field \"the_date\" in \"the_table\" is of type datetime.\n> If it isn't, just convert it by using datetime( the_date ).\n> \n> The amount of time described by the type timespan is very intuitive - it\n> accepts, as you see, things like '12 hours', '1 day', or '2 months'. It\n> takes months correctly - with longer and shorter months taken into\n> accounts. More about it in the pgbuiltin manpage.\n> \n> Herouth\n> \n> --\n> Herouth Maoz, Internet developer.\n> Open University of Israel - Telem project\n> http://telem.openu.ac.il/~herutma\n> \n> \n> \n\n", "msg_date": "Wed, 12 Aug 1998 15:47:45 +0300 (IDT)", "msg_from": "Aleksey Dashevsky <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] Query based on date/time field" }, { "msg_contents": "On Tue, 4 Aug 1998, William McCracken wrote:\n\n> I am new to SQL and was wondering how I would go\n> about selecting records from my database based on \n> the age of a date/time stamp.\n> \n> For example if I wanted to select records older than\n> 12 hours or 1 day.\n> \n> Any help would be appreciated.\n\nSorry for my late response, but I was on holiday.\nI use some statement like this to select entries that are not older than 2\nweeks:\n\nSELECT DISTINCT landkreis FROM kneipe WHERE 1209600 >= (date_part('epoch',\ncurrent_date) - date_part('epoch',datum));\n\ndatum is of type datetime.\n\nwhat I do is the following: epoch returns the seconds since january 1st\n1970 (I think). I substract the timestamp of each record from the current\ntimestamp (current_date). The result has to be smaller than the duration\nfor 2 weeks (in seconds, which is 1209600s).\n\nI dont know if there is a better solution, but it works fine.\n\nSo long,\n Holger\n\n--------------------------------------------------------------------------------\nHolger Mitterwald COI-D #### ##### ### CONSULTING FUER OFFICE\nCOI GmbH Herzogenaurach # # # # UND INFORMATION \nIndustriestrasse 1 - 3 # # # # MANAGEMENT GmbH\nD-91074 Herzogenaurach #### ##### ### Tel.: 09132/82-3811\n\n", "msg_date": "Wed, 12 Aug 1998 13:50:02 +0100 (WETDST)", "msg_from": "Holger Mitterwald <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] Query based on date/time field" } ]
[ { "msg_contents": "EXPLAIN VERBOSE now prints the plan to your screen, and pretty-prints\nthe plan to the postmaster log file.\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 4 Aug 1998 11:04:46 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "EXPLAIN VERBOSE" } ]
[ { "msg_contents": "> Log Message:\n> MergeSort was sometimes called mergejoin and was confusing. Now\n> it is now only mergejoin.\n\nThis text is wrong. I meant to say:\n\nMergeJoin was sometimes called mergesort in the code and was confusing. \nNow it is now only mergejoin.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 4 Aug 1998 13:08:36 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [COMMITTERS] 'pgsql/src/include/utils lsyscache.h'" } ]
[ { "msg_contents": "Let's say we have a table with two entries:\n\nname\tnr\n----------\nfoo\t1\nbar\t2\n\nand a C program doing the following:\n\n...\ni=1;\nexec sql declare C cursor for select name from table where nr=:i;\ni=2;\nexec sql open C;\n...\n\nWhich row will be selected?\n\nI guess I'll try Oracle as soon as I find time.\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Tue, 4 Aug 1998 19:12:09 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Standards question" }, { "msg_contents": "> i=1;\n> exec sql declare C cursor for select name from table where nr=:i;\n> i=2;\n> exec sql open C;\n> Which row will be selected?\n\nThings should evaluate at the \"open\". I recall that the cursor\ndeclaration is allowed to happen up in the declarations section of the\nprogram or routine (at least on my old Ingres installation)...\n\n - Tom\n", "msg_date": "Wed, 05 Aug 1998 01:39:54 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Standards question" }, { "msg_contents": ">>>>> \"Thomas\" == Thomas G Lockhart <[email protected]> writes:\n\n >> i=1; \n >> exec sql declare C cursor for select name from table where nr=:i; \n >> i=2; \n >> exec sql open C; Which row will be selected?\n\n Thomas> Things should evaluate at the \"open\".\n [...]\n\nThis is also how it works with Oracle.\n\nroland\n-- \nRoland B. Roberts, PhD Custom Software Solutions\[email protected] 101 West 15th St #4NN\n New York, NY 10011\n\n", "msg_date": "04 Aug 1998 22:00:09 -0400", "msg_from": "Roland Roberts <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Standards question" } ]
[ { "msg_contents": "I just checked with Oracle. The declare cursor command is ignored by Oracle,\nonly an open cursor is issued.\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Tue, 4 Aug 1998 19:49:55 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Standards question" } ]
[ { "msg_contents": "I have worked with Vadim privately on the remaining OR clause index\nissues, and I am done. Please start testing, everyone.\n\nThe only open item is whether MergeJoin will try to use a multi-index OR\nclause in a join, but I doubt anyone uses such things. It would require\nyou to join a table as part of a join clause.\n\n\tselect *\n\tfrom tab1, tab2\n\twhere tab1.col1=2 or tab1.col1 = tab2.col2\n\nI am going to study the optimizer code, then figure out whether this\ncould ever be broken with the new index usage. I plan to complete this\nin time for 6.4.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 4 Aug 1998 21:18:28 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "OR clause status" }, { "msg_contents": "Bruce Momjian wrote:\n\n> I have worked with Vadim privately on the remaining OR clause index\n> issues, and I am done. Please start testing, everyone.\n>\n\nRan a few tests last night. So far, works great for single, non-internal,\nattributes. However, I was not able to get the query to use the table's oid\nindex when such an index existed. Did a VACUUM ANALYZE before the query.\nWill be doing some more testing over the next few days.\n\nHave not tried any mult-part keys. Will this patch handle a small number of\nOR'ed multi-part keys?\n\n\n", "msg_date": "Wed, 05 Aug 1998 09:14:27 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status" }, { "msg_contents": "David Hartwig <[email protected]> writes:\n> Ran a few tests last night. So far, works great for single, non-internal,\n> attributes. However, I was not able to get the query to use the table's oid\n> index when such an index existed.\n\nPerhaps this is an artifact of the type-coercion issue (see \"indexes and\nfloats\" thread on pg-hackers). I find I have to write something like\n\n\tWHERE oid = 123456::oid\n\nto get the system to use an index on OID. If I write\n\n\tWHERE oid = 123456\n\nit takes it, but does it by sequential scan :-(\n\nI do not know if it's acted like that all along or it's a result\nof Tom's type coercion fixes of a couple months ago.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 05 Aug 1998 10:45:17 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status " }, { "msg_contents": "> Bruce Momjian wrote:\n> \n> > I have worked with Vadim privately on the remaining OR clause index\n> > issues, and I am done. Please start testing, everyone.\n> >\n> \n> Ran a few tests last night. So far, works great for single, non-internal,\n> attributes. However, I was not able to get the query to use the table's oid\n> index when such an index existed. Did a VACUUM ANALYZE before the query.\n> Will be doing some more testing over the next few days.\n\nTry:\n\ttest=> explain select * from test where oid = 3::oid or oid = 4::oid;\n\tNOTICE: QUERY PLAN:\n\t\n\tIndex Scan using i_test2 on test (cost=4.10 size=1 width=4)\n\nThomas will have to deal with this before 6.4. The auto-casting of type\noid is not working.\n\n\n> \n> Have not tried any mult-part keys. Will this patch handle a small number of\n> OR'ed multi-part keys?\n\nThis is another item that I think does not work. The code handles AND\nand OR separately, making this hard to handle:\n\n\tkey1 = 7 and (key2 = 99 or key2 = 100)\n\nIt will use the first part of the key to get key1 = 7, but recognize\nthat the first part of the key was matches and use the key2 part. I am\ngoing to study the optimizer code for 6.4, so I may be able to get it\nworking. Not sure yet.\n\nIt will certainly use the first part of a multi-part key if the first\nkey is the one matching the OR clause.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 12:45:47 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR clause status" }, { "msg_contents": "> > Ran a few tests last night. So far, works great for single, \n> > non-internal, attributes. However, I was not able to get the query \n> > to use the table's oid index when such an index existed. Did a \n> > VACUUM ANALYZE before the query.\n> Thomas will have to deal with this before 6.4. The auto-casting of \n> type oid is not working.\n\nI think the OID auto-casting should be very easy (painfully easy,\nactually, if that doesn't jinx it). Once the development tree becomes\nunbroken :) Haven't finished reading mail yet, so may already work, eh?\n\n - Tom\n", "msg_date": "Thu, 06 Aug 1998 04:10:29 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status" }, { "msg_contents": "> > > Ran a few tests last night. So far, works great for single, \n> > > non-internal, attributes. However, I was not able to get the query \n> > > to use the table's oid index when such an index existed. Did a \n> > > VACUUM ANALYZE before the query.\n> > Thomas will have to deal with this before 6.4. The auto-casting of \n> > type oid is not working.\n> \n> I think the OID auto-casting should be very easy (painfully easy,\n> actually, if that doesn't jinx it). Once the development tree becomes\n> unbroken :) Haven't finished reading mail yet, so may already work, eh?\n\nYes, I think there are some very good reasons to evaluate functions on\nconstants inside the parser. There are some operations that look at\nindex selectivity that need to know the constant value, rather than\nknowing if the function returns an int. For example x > 3 looks at the\npg_statistics table to see max/min values.\n\nYou certainly don't want to be evaluating functions on constants inside\nthe optimizer.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 00:35:36 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR clause status" }, { "msg_contents": "> > I think the OID auto-casting should be very easy\n> > Once the development tree becomes unbroken...\n> Yes, I think there are some very good reasons to evaluate functions on\n> constants inside the parser.\n\nI wasn't actually suggesting making real changes to the parser. I\n_think_ I can get the OID vs int4 coersion problem fixed with a one-line\nchange to a header file, but need a working tree to do it :(\n\nAny progress on getting the tree to compile? Are there some people who\ndon't see a problem??\n\n> There are some operations that look at\n> index selectivity that need to know the constant value, rather than\n> knowing if the function returns an int. For example x > 3 looks at \n> the pg_statistics table to see max/min values.\n> \n> You certainly don't want to be evaluating functions on constants \n> inside the optimizer.\n\n?? Why not? It is an optimization after all. I have never looked at the\noptimizer code however. Are you saying that the current optimizer\ndoesn't have a pass or phase where functions could be evaluated? Should\nwe add a pass to do this? I've been a bit worried about coding too many\noptimizations into the parser, since they might become pretty obscure\nburied in there.\n\n - Tom\n", "msg_date": "Thu, 06 Aug 1998 06:09:31 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status" }, { "msg_contents": "> > > I think the OID auto-casting should be very easy\n> > > Once the development tree becomes unbroken...\n> > Yes, I think there are some very good reasons to evaluate functions on\n> > constants inside the parser.\n> \n> I wasn't actually suggesting making real changes to the parser. I\n> _think_ I can get the OID vs int4 coersion problem fixed with a one-line\n> change to a header file, but need a working tree to do it :(\n> \n> Any progress on getting the tree to compile? Are there some people who\n> don't see a problem??\n> \n> > There are some operations that look at\n> > index selectivity that need to know the constant value, rather than\n> > knowing if the function returns an int. For example x > 3 looks at \n> > the pg_statistics table to see max/min values.\n> > \n> > You certainly don't want to be evaluating functions on constants \n> > inside the optimizer.\n> \n> ?? Why not? It is an optimization after all. I have never looked at the\n> optimizer code however. Are you saying that the current optimizer\n> doesn't have a pass or phase where functions could be evaluated? Should\n> we add a pass to do this? I've been a bit worried about coding too many\n> optimizations into the parser, since they might become pretty obscure\n> buried in there.\n\nThe optimizer is much too complicated to be putting fmgr() function\ncalls in there. I know the parser is bad too, but I think it is best to\ndo it there. We already do some of it there anyway.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 11:37:25 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR clause status" }, { "msg_contents": "> Perhaps this is an artifact of the type-coercion issue (see \"indexes \n> and floats\" thread on pg-hackers). I find I have to write something \n> like\n> WHERE oid = 123456::oid\n> to get the system to use an index on OID. If I write\n> WHERE oid = 123456\n> it takes it, but does it by sequential scan :-(\n> I do not know if it's acted like that all along or it's a result\n> of Tom's type coercion fixes of a couple months ago.\n\nHi Bruce. You are right, the optimizer is confusing :)\n\nI'm not sure if you were looking at this already, but I was thinking of\nfinding the place where the optimizer decides whether an index can be\nused in a query, in particular when constants are involved. Seems like\nthe overhead/operations involved should be identical whether the terms\nhave the same type or not; in the cases above\n WHERE oid = 123456::oid\nwould use oideq() and\n WHERE oid = 123456\nwould use oidint4eq().\n\nWhy would Postgres give up on using an index in the second case? In both\ncases there is one call to a function to evaluate the equality. Do the\ntypes need to match up for other reasons?\n\nI was thinking of adding the IS_BINARY_COMPATIBLE() macro as an\noptimization in the place where indices are being chosen, but then got\nconfused as to why Postgres would care in the first place. Also, haven't\nfound the area where these decisions are made.\n\nAny hints? Anyone else rummaged around that code?\n\n - Tom\n", "msg_date": "Fri, 07 Aug 1998 14:53:28 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status" }, { "msg_contents": "> > Perhaps this is an artifact of the type-coercion issue (see \"indexes \n> > and floats\" thread on pg-hackers). I find I have to write something \n> > like\n> > WHERE oid = 123456::oid\n> > to get the system to use an index on OID. If I write\n> > WHERE oid = 123456\n> > it takes it, but does it by sequential scan :-(\n> > I do not know if it's acted like that all along or it's a result\n> > of Tom's type coercion fixes of a couple months ago.\n> \n> Hi Bruce. You are right, the optimizer is confusing :)\n> \n> I'm not sure if you were looking at this already, but I was thinking of\n> finding the place where the optimizer decides whether an index can be\n> used in a query, in particular when constants are involved. Seems like\n> the overhead/operations involved should be identical whether the terms\n> have the same type or not; in the cases above\n> WHERE oid = 123456::oid\n> would use oideq() and\n> WHERE oid = 123456\n> would use oidint4eq().\n> \n> Why would Postgres give up on using an index in the second case? In both\n> cases there is one call to a function to evaluate the equality. Do the\n> types need to match up for other reasons?\n\n\nBecause the PARSER converts :: casts to constants. It does not handle\nfunctions-on-consts conversions.\n\nIn scan.l, :: is converted to TYPECAST, and then in gram.y:\n\n | a_expr TYPECAST Typename\n {\n $$ = (Node *)$1;\n /* AexprConst can be either A_Const or ParamNo */\n if (nodeTag($1) == T_A_Const) {\n ((A_Const *)$1)->typename = $3;\n } else if (nodeTag($1) == T_Param) {\n ((ParamNo *)$1)->typename = $3;\n /* otherwise, try to transform to a function call */\n } else {\n FuncCall *n = makeNode(FuncCall);\n n->funcname = $3->name;\n n->args = lcons($1,NIL);\n $$ = (Node *)n;\n }\n }\n\n\nAs you can see, if it is a constant as passed from scan.l, a constant is\ncreated with the type of the cast, so it does become a constant.\n\nThen in parse_expr.c, we have:\n\n case T_A_Const:\n {\n A_Const *con = (A_Const *) expr;\n Value *val = &con->val;\n \n if (con->typename != NULL)\n result = parser_typecast(val, con->typename, -1);\n else\n result = (Node *) make_const(val);\n break;\n }\n\nAnd parser_typecast does, because the constant is an integer:\n\n case T_Integer:\n const_string = (char *) palloc(256);\n string_palloced = true;\n sprintf(const_string, \"%ld\", expr->val.ival);\n\nwhich then does the conversion of the int to a string, and makes a\nconversion back to the proper type:\n\n cp = stringTypeString(tp, const_string, atttypmod);\n\nstringTypeString does:\n\t\n\t/* Given a type structure and a string, returns the internal form of\n\t that string */\n\tchar * \n\tstringTypeString(Type tp, char *string, int32 atttypmod)\n\t{ \n\t Oid op;\n\t Oid typelem;\n\t \n\t op = ((TypeTupleForm) GETSTRUCT(tp))->typinput;\n\t typelem = ((TypeTupleForm) GETSTRUCT(tp))->typelem; /* XXX - used for\n\t * array_in */\n\t return ((char *) fmgr(op, string, typelem, atttypmod));\n\t}\n\nand then makes a new constant:\n\n adt = makeConst(typeTypeId(tp),\n len,\n (Datum) lcp,\n false,\n typeByVal(tp),\n false, /* not a set */\n true /* is cast */ );\n\n\nThe problem is that wrapping a function around the const is not going\nthrough this code. I will see if I can add the proper calls to get it\nworking.\n\n\n> \n> I was thinking of adding the IS_BINARY_COMPATIBLE() macro as an\n> optimization in the place where indices are being chosen, but then got\n> confused as to why Postgres would care in the first place. Also, haven't\n> found the area where these decisions are made.\n> \n> Any hints? Anyone else rummaged around that code?\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 7 Aug 1998 11:41:30 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR clause status" }, { "msg_contents": "> > Perhaps this is an artifact of the type-coercion issue (see \"indexes \n> > and floats\" thread on pg-hackers). I find I have to write something \n> > like\n> > WHERE oid = 123456::oid\n> > to get the system to use an index on OID. If I write\n> > WHERE oid = 123456\n> > it takes it, but does it by sequential scan :-(\n> > I do not know if it's acted like that all along or it's a result\n> > of Tom's type coercion fixes of a couple months ago.\n> \n> Hi Bruce. You are right, the optimizer is confusing :)\n> \n> I'm not sure if you were looking at this already, but I was thinking of\n> finding the place where the optimizer decides whether an index can be\n> used in a query, in particular when constants are involved. Seems like\n> the overhead/operations involved should be identical whether the terms\n> have the same type or not; in the cases above\n> WHERE oid = 123456::oid\n> would use oideq() and\n> WHERE oid = 123456\n> would use oidint4eq().\n> \n> Why would Postgres give up on using an index in the second case? In both\n> cases there is one call to a function to evaluate the equality. Do the\n> types need to match up for other reasons?\n> \n> I was thinking of adding the IS_BINARY_COMPATIBLE() macro as an\n> optimization in the place where indices are being chosen, but then got\n> confused as to why Postgres would care in the first place. Also, haven't\n> found the area where these decisions are made.\n> \n> Any hints? Anyone else rummaged around that code?\n\nIn looking at the code, part of the problem is that you are creating a\nFuncCall node in coerce_type, so I have to make sure I convert normal\nfuncs with constants to constants, and your type-conversion funcs too,\nwhich will not be picked up in the normal expression parsing because\nthey were not there originally. (Assuming the function is cache-able.)\n\nIn the case of x=3, does your code try to convert the constant to the\ntype of the variable, or does it try and do both. We can convert:\n\t\n\tx = int4(3)\n\nand not\n\tint4(x) = 3\n\nor\n\tint4(x) = int4(3)\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 7 Aug 1998 12:30:21 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] OR clause status" }, { "msg_contents": "> > I was thinking of\n> > finding the place where the optimizer decides whether an index can \n> > be used in a query, in particular when constants are involved.\n> > WHERE oid = 123456::oid\n> > would use oideq() and\n> > WHERE oid = 123456\n> > would use oidint4eq().\n> > Why would Postgres give up on using an index in the second case?\n\nBefore we go ripping into the parser, I think it would help to\nunderstand the area of the optimizer or planner which decides whether or\nnot to use an index. Look, these first queries use an index:\n\nregression=> explain select * from tenk1 where oid = 3000::oid;\nIndex Scan using tenk1_oid on tenk1 (cost=2.05 size=1 width=148)\nregression=> explain select * from tenk1 where oid < 3000::oid;\nIndex Scan using tenk1_oid on tenk1 (cost=257.67 size=3334 width=148)\nregression=> explain select * from tenk1 where oid > 3000::oid;\nIndex Scan using tenk1_oid on tenk1 (cost=257.67 size=3334 width=148)\n\nBut the next queries do not:\n\nregression=> explain select * from tenk1 where oid != 3000::oid;\nSeq Scan on tenk1 (cost=574.00 size=9999 width=148)\nregression=> explain select * from tenk1 where oid = 3000;\nSeq Scan on tenk1 (cost=574.00 size=1 width=148)\n\nAfaik, the parser handles every one of these queries _exactly_ the same,\nwith slightly different outcomes due to the slight differences in\noperators or types. But the parse tree will have the same kind of nodes,\nwith function calls used to evaluate the operators.\n\nSo how does the optimizer conclude that a node coming from the parser is\na possibility for an index scan? Let's find this out before masking the\nbehavior in the parser.\n\n> In looking at the code, part of the problem is that you are creating a\n> FuncCall node in coerce_type, so I have to make sure I convert normal\n> funcs with constants to constants, and your type-conversion funcs too,\n> which will not be picked up in the normal expression parsing because\n> they were not there originally. (Assuming the function is cache-able.)\n\nI think Vadim suggested that if we do something in the parser we create\na PARAM_EXEC node to do a one-time evaluation in the executor. Seems\npreferable to doing a brute-force conversion via strings in the\nparser...\n\n - Tom\n", "msg_date": "Sat, 08 Aug 1998 06:53:04 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR clause status" } ]
[ { "msg_contents": "Michael wrote:\n>Let's say we have a table with two entries:\n>\n>name\tnr\n>----------\n>foo\t1\n>bar\t2\n\n>and a C program doing the following:\n>\n>..\n>i=1;\n>exec sql declare C cursor for select name from table where nr=:i;\n>i=2;\n>exec sql open C;\n>..\n>\n>Which row will be selected?\n\nSince it is usually allowed to do one declare and then many \nopen, fetch, fetch ...\nopen, fetch ....\nit has to be i=2 (bar)\n\nAndreas\n\n", "msg_date": "Wed, 5 Aug 1998 09:10:46 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Standards question" }, { "msg_contents": "On Wed, Aug 05, 1998 at 09:10:46AM +0200, Andreas Zeugswetter wrote:\n> Since it is usually allowed to do one declare and then many \n> open, fetch, fetch ...\n> open, fetch ....\n> it has to be i=2 (bar)\n\nYes, that was what I expected. However, I wanted to be sure.\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Wed, 5 Aug 1998 20:19:19 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Standards question" } ]
[ { "msg_contents": "Hello!\n\nI've written the SPI procedure which allows to delete large\nobjects referenced by currently deleted or updated tuples.\nI tested it with PostgreSQL v6.3.2 and seem it works.\nIf PostgreSQL developers team is interested in it, I'll send\nthe sources to this mailing list or to somebody personally.\n\nSorry for my English.\n\nBest regards,\nSergey E. Levov ([email protected])\n", "msg_date": "Wed, 5 Aug 1998 18:22:22 +0400 (MSD)", "msg_from": "\"Sergey E. Levov\" <[email protected]>", "msg_from_op": true, "msg_subject": "SPI procedure for removing large objects" }, { "msg_contents": "On Wed, 5 Aug 1998, Sergey E. Levov wrote:\n\n> Hello!\n> \n> I've written the SPI procedure which allows to delete large\n> objects referenced by currently deleted or updated tuples.\n> I tested it with PostgreSQL v6.3.2 and seem it works.\n> If PostgreSQL developers team is interested in it, I'll send\n> the sources to this mailing list or to somebody personally.\n\nI'll be interested (I wrote the copy in contrib/lo - post 6.3.2 source\ntree).\n\nThere was some talk about 5 weeks ago about using vacuum to pick up any\nstragglers. I have some ideas on this, but can't try them out at the\nmoment - I haven't had a working backend for about 3 weeks now :-(\n\n> Sorry for my English.\n\nNo problem - I'm English, and sometimes it's worse ;-)\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Wed, 5 Aug 1998 19:00:12 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "Peter,\n\nI have just finished up some other stuff in the backend, and I was\nwondering what to do next. My personal list include a cleanup of the lo\ntype. Specifically:\n\n 1. Assign a fixed OID to the LO type so that attributes of this type\ncan easily be identified.\n\n 2. Write a VACUUM LO procedure.\n\n 3. Extend/verify the existing internal lo functions to work with the\nnew type.\n\nI know that more can/should be done in this area, but I only have so much\ntime. I am aware the you have done some work on this in the contrib area.\nWere you planning on handling any (or all) of these issues as part of the\n6.4 base release? I will gladly move on to something else.\n\nPeter T Mount wrote:\n\n> On Wed, 5 Aug 1998, Sergey E. Levov wrote:\n>\n> > Hello!\n> >\n> > I've written the SPI procedure which allows to delete large\n> > objects referenced by currently deleted or updated tuples.\n> > I tested it with PostgreSQL v6.3.2 and seem it works.\n> > If PostgreSQL developers team is interested in it, I'll send\n> > the sources to this mailing list or to somebody personally.\n>\n> I'll be interested (I wrote the copy in contrib/lo - post 6.3.2 source\n> tree).\n>\n> There was some talk about 5 weeks ago about using vacuum to pick up any\n> stragglers. I have some ideas on this, but can't try them out at the\n> moment - I haven't had a working backend for about 3 weeks now :-(\n\n\n\n", "msg_date": "Wed, 05 Aug 1998 14:50:42 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "> Peter,\n> \n> I have just finished up some other stuff in the backend, and I was\n> wondering what to do next. My personal list include a cleanup of the lo\n> type. Specifically:\n> \n> 1. Assign a fixed OID to the LO type so that attributes of this type\n> can easily be identified.\n> \n> 2. Write a VACUUM LO procedure.\n> \n> 3. Extend/verify the existing internal lo functions to work with the\n> new type.\n> \n> I know that more can/should be done in this area, but I only have so much\n> time. I am aware the you have done some work on this in the contrib area.\n> Were you planning on handling any (or all) of these issues as part of the\n> 6.4 base release? I will gladly move on to something else.\n> \n\nWe should also make a large object type, rather than using inv_ to\nidentify it. It is on the TODO list, and I can implement it whenever\nyou want.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 15:31:37 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "On Wed, 5 Aug 1998, David Hartwig wrote:\n\n> Peter,\n> \n> I have just finished up some other stuff in the backend, and I was\n> wondering what to do next. My personal list include a cleanup of the lo\n> type. Specifically:\n> \n> 1. Assign a fixed OID to the LO type so that attributes of this type\n> can easily be identified.\n> \n> 2. Write a VACUUM LO procedure.\n> \n> 3. Extend/verify the existing internal lo functions to work with the\n> new type.\n> \n> I know that more can/should be done in this area, but I only have so much\n> time. I am aware the you have done some work on this in the contrib area.\n> Were you planning on handling any (or all) of these issues as part of the\n> 6.4 base release? I will gladly move on to something else.\n\nI claimed the parts of the TODO list that deal with these issues a few\nweeks ago. Since then, I've tried several solutions (the one in contrib\nwas an attempt that uses triggers. It works but has holes - like DROP\nTABLE doesnt fire a trigger).\n\nThe method I think is best is the vacuum procedure. Now, I have here the\nbasic outline for it, and how it interacts with the existing system using\noid's, but currently I can't test it as postgresql is still broken (for\nme). \n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Wed, 5 Aug 1998 22:01:48 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "On Wed, 5 Aug 1998, Bruce Momjian wrote:\n\n> > Peter,\n> > \n> > I have just finished up some other stuff in the backend, and I was\n> > wondering what to do next. My personal list include a cleanup of the lo\n> > type. Specifically:\n> > \n> > 1. Assign a fixed OID to the LO type so that attributes of this type\n> > can easily be identified.\n> > \n> > 2. Write a VACUUM LO procedure.\n> > \n> > 3. Extend/verify the existing internal lo functions to work with the\n> > new type.\n> > \n> > I know that more can/should be done in this area, but I only have so much\n> > time. I am aware the you have done some work on this in the contrib area.\n> > Were you planning on handling any (or all) of these issues as part of the\n> > 6.4 base release? I will gladly move on to something else.\n> > \n> \n> We should also make a large object type, rather than using inv_ to\n> identify it. It is on the TODO list, and I can implement it whenever\n> you want.\n\nagreed - although that would imply a different method of storing them. One\nof the problems I have with VACUUM LO is that using the existing oid\nmethod (for compatibility) would not work with the new type.\n\nEither using a different form of storage, or a different prefix would sort\nthis problem (the latter would be the easiest).\n\n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n> \n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Wed, 5 Aug 1998 22:04:43 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "> On Wed, 5 Aug 1998, Bruce Momjian wrote:\n> \n> > > Peter,\n> > > \n> > > I have just finished up some other stuff in the backend, and I was\n> > > wondering what to do next. My personal list include a cleanup of the lo\n> > > type. Specifically:\n> > > \n> > > 1. Assign a fixed OID to the LO type so that attributes of this type\n> > > can easily be identified.\n> > > \n> > > 2. Write a VACUUM LO procedure.\n> > > \n> > > 3. Extend/verify the existing internal lo functions to work with the\n> > > new type.\n> > > \n> > > I know that more can/should be done in this area, but I only have so much\n> > > time. I am aware the you have done some work on this in the contrib area.\n> > > Were you planning on handling any (or all) of these issues as part of the\n> > > 6.4 base release? I will gladly move on to something else.\n> > > \n> > \n> > We should also make a large object type, rather than using inv_ to\n> > identify it. It is on the TODO list, and I can implement it whenever\n> > you want.\n> \n> agreed - although that would imply a different method of storing them. One\n> of the problems I have with VACUUM LO is that using the existing oid\n> method (for compatibility) would not work with the new type.\n> \n> Either using a different form of storage, or a different prefix would sort\n> this problem (the latter would be the easiest).\n> \n\nOK, give me a day or two.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 17:40:06 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "\n\nPeter T Mount wrote:\n\n> On Wed, 5 Aug 1998, David Hartwig wrote:\n>\n> > Peter,\n> >\n> > I have just finished up some other stuff in the backend, and I was\n> > wondering what to do next. My personal list include a cleanup of the lo\n> > type. Specifically:\n> >\n> > 1. Assign a fixed OID to the LO type so that attributes of this type\n> > can easily be identified.\n> >\n> > 2. Write a VACUUM LO procedure.\n> >\n> > 3. Extend/verify the existing internal lo functions to work with the\n> > new type.\n> >\n> > I know that more can/should be done in this area, but I only have so much\n> > time. I am aware the you have done some work on this in the contrib area.\n> > Were you planning on handling any (or all) of these issues as part of the\n> > 6.4 base release? I will gladly move on to something else.\n>\n> I claimed the parts of the TODO list that deal with these issues a few\n> weeks ago.\n\nI will move on to something else unless their is something I can assist you\nwith.\n\n> Since then, I've tried several solutions (the one in contrib\n\n> was an attempt that uses triggers. It works but has holes - like DROP\n> TABLE doesnt fire a trigger).\n>\n\nActually, the trigger is still worth having in the bag-o-tricks. It can keep\nnumerous additions and removals of tuples with LOs from filling up the disk\nbefore the vacuum gets executed.\n\n> The method I think is best is the vacuum procedure. Now, I have here the\n> basic outline for it, and how it interacts with the existing system using\n> oid's, but currently I can't test it as postgresql is still broken (for\n> me).\n\n\n\n", "msg_date": "Wed, 05 Aug 1998 18:05:58 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "\n\nPeter T Mount wrote:\n\n> On Wed, 5 Aug 1998, Bruce Momjian wrote:\n>\n> > > Peter,\n> > >\n> > > I have just finished up some other stuff in the backend, and I was\n> > > wondering what to do next. My personal list include a cleanup of the lo\n> > > type. Specifically:\n> > >\n> > > 1. Assign a fixed OID to the LO type so that attributes of this type\n> > > can easily be identified.\n> > >\n> > > 2. Write a VACUUM LO procedure.\n> > >\n> > > 3. Extend/verify the existing internal lo functions to work with the\n> > > new type.\n> > >\n> > > I know that more can/should be done in this area, but I only have so much\n> > > time. I am aware the you have done some work on this in the contrib area.\n> > > Were you planning on handling any (or all) of these issues as part of the\n> > > 6.4 base release? I will gladly move on to something else.\n> > >\n> >\n> > We should also make a large object type, rather than using inv_ to\n> > identify it. It is on the TODO list, and I can implement it whenever\n> > you want.\n>\n> agreed - although that would imply a different method of storing them. One\n> of the problems I have with VACUUM LO is that using the existing oid\n> method (for compatibility) would not work with the new type.\n>\n\nI see it that way also. But I do not perceive this to be a problem. Users who\nhave been using OIDs to link to their large_objects will continue to operate as\nthey always have. I can't see how we could attempt to promote the functionality\nof existing install base. The problem, which is the essential problem, is that\nwe can presume nothing about the relationship between an arbitrary OID type column\nand the large objects themselves.\n\nHowever as part of a conversion, the DBA may be able to UPDATE pg_attribute\nmanually and change the type from OID to LO. ??? Or we provide a script to do\nthis where the DBA enters the large object columns???\n\n> Either using a different form of storage, or a different prefix would sort\n> this problem (the latter would be the easiest).\n>\n\n\n\n", "msg_date": "Wed, 05 Aug 1998 18:06:18 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "> \n> \n> Peter T Mount wrote:\n> \n> > On Wed, 5 Aug 1998, Bruce Momjian wrote:\n> >\n> > > > Peter,\n> > > >\n> > > > I have just finished up some other stuff in the backend, and I was\n> > > > wondering what to do next. My personal list include a cleanup of the lo\n> > > > type. Specifically:\n> > > >\n> > > > 1. Assign a fixed OID to the LO type so that attributes of this type\n> > > > can easily be identified.\n> > > >\n> > > > 2. Write a VACUUM LO procedure.\n> > > >\n> > > > 3. Extend/verify the existing internal lo functions to work with the\n> > > > new type.\n> > > >\n> > > > I know that more can/should be done in this area, but I only have so much\n> > > > time. I am aware the you have done some work on this in the contrib area.\n> > > > Were you planning on handling any (or all) of these issues as part of the\n> > > > 6.4 base release? I will gladly move on to something else.\n> > > >\n> > >\n> > > We should also make a large object type, rather than using inv_ to\n> > > identify it. It is on the TODO list, and I can implement it whenever\n> > > you want.\n> >\n> > agreed - although that would imply a different method of storing them. One\n> > of the problems I have with VACUUM LO is that using the existing oid\n> > method (for compatibility) would not work with the new type.\n> >\n\nMy change will allow large objects themselves to be identified inside\nthe backend without have to see if their name is inv_. Currently, we\nflag indexes and normal relations, and view/rules. Large objects\nthemselves will have their own type.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 22:04:48 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "On Wed, 5 Aug 1998, David Hartwig wrote:\n\n> \n> \n> Peter T Mount wrote:\n> \n> > On Wed, 5 Aug 1998, Bruce Momjian wrote:\n> >\n> > > > Peter,\n> > > >\n> > > > I have just finished up some other stuff in the backend, and I was\n> > > > wondering what to do next. My personal list include a cleanup of the lo\n> > > > type. Specifically:\n> > > >\n> > > > 1. Assign a fixed OID to the LO type so that attributes of this type\n> > > > can easily be identified.\n> > > >\n> > > > 2. Write a VACUUM LO procedure.\n> > > >\n> > > > 3. Extend/verify the existing internal lo functions to work with the\n> > > > new type.\n> > > >\n> > > > I know that more can/should be done in this area, but I only have so much\n> > > > time. I am aware the you have done some work on this in the contrib area.\n> > > > Were you planning on handling any (or all) of these issues as part of the\n> > > > 6.4 base release? I will gladly move on to something else.\n> > > >\n> > >\n> > > We should also make a large object type, rather than using inv_ to\n> > > identify it. It is on the TODO list, and I can implement it whenever\n> > > you want.\n> >\n> > agreed - although that would imply a different method of storing them. One\n> > of the problems I have with VACUUM LO is that using the existing oid\n> > method (for compatibility) would not work with the new type.\n> >\n> \n> I see it that way also. But I do not perceive this to be a problem. Users who\n> have been using OIDs to link to their large_objects will continue to operate as\n> they always have. I can't see how we could attempt to promote the functionality\n> of existing install base. The problem, which is the essential problem, is that\n> we can presume nothing about the relationship between an arbitrary OID type column\n> and the large objects themselves.\n\nActually, if what Bruce is saying about LO then this problem may go away.\n\n> However as part of a conversion, the DBA may be able to UPDATE pg_attribute\n> manually and change the type from OID to LO. ??? Or we provide a script to do\n> this where the DBA enters the large object columns???\n\nI don't think it would hurt to have a script to to the conversion -\nespecially for those who are upgrading existing databases.\n\n> > Either using a different form of storage, or a different prefix would sort\n> > this problem (the latter would be the easiest).\n> >\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Thu, 6 Aug 1998 06:45:16 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "On Wed, 5 Aug 1998, David Hartwig wrote:\n\n> Peter T Mount wrote:\n> \n> > On Wed, 5 Aug 1998, David Hartwig wrote:\n> >\n> > > Peter,\n> > >\n> > > I have just finished up some other stuff in the backend, and I was\n> > > wondering what to do next. My personal list include a cleanup of the lo\n> > > type. Specifically:\n> > >\n> > > 1. Assign a fixed OID to the LO type so that attributes of this type\n> > > can easily be identified.\n> > >\n> > > 2. Write a VACUUM LO procedure.\n> > >\n> > > 3. Extend/verify the existing internal lo functions to work with the\n> > > new type.\n> > >\n> > > I know that more can/should be done in this area, but I only have so much\n> > > time. I am aware the you have done some work on this in the contrib area.\n> > > Were you planning on handling any (or all) of these issues as part of the\n> > > 6.4 base release? I will gladly move on to something else.\n> >\n> > I claimed the parts of the TODO list that deal with these issues a few\n> > weeks ago.\n> \n> I will move on to something else unless their is something I can assist you\n> with.\n> \n> > Since then, I've tried several solutions (the one in contrib\n> \n> > was an attempt that uses triggers. It works but has holes - like DROP\n> > TABLE doesnt fire a trigger).\n> >\n> \n> Actually, the trigger is still worth having in the bag-o-tricks. It can keep\n> numerous additions and removals of tuples with LOs from filling up the disk\n> before the vacuum gets executed.\n\nI think for small tables, then relying on VACUUM LO would be enough.\nHowever, the trigger would be a viable option for DBA's when either the\ndatabase is huge, or has a lot of traffic.\n\n> > The method I think is best is the vacuum procedure. Now, I have here the\n> > basic outline for it, and how it interacts with the existing system using\n> > oid's, but currently I can't test it as postgresql is still broken (for\n> > me).\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Thu, 6 Aug 1998 06:47:14 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "Hello!\n\nIn message\n <[email protected]> Peter\n T Mount writes:\n\n>On Wed, 5 Aug 1998, David Hartwig wrote:\n\n>> Peter,\n>> \n>> I have just finished up some other stuff in the backend, and I was\n>> wondering what to do next. My personal list include a cleanup of the lo\n>> type. Specifically:\n>> \n>> 1. Assign a fixed OID to the LO type so that attributes of this type\n>> can easily be identified.\n>> \n>> 2. Write a VACUUM LO procedure.\n>> \n>> 3. Extend/verify the existing internal lo functions to work with the\n>> new type.\n>> \n>> I know that more can/should be done in this area, but I only have so much\n>> time. I am aware the you have done some work on this in the contrib area.\n>> Were you planning on handling any (or all) of these issues as part of the\n>> 6.4 base release? I will gladly move on to something else.\n\n>I claimed the parts of the TODO list that deal with these issues a few\n>weeks ago. Since then, I've tried several solutions (the one in contrib\n>was an attempt that uses triggers. It works but has holes - like DROP\n>TABLE doesnt fire a trigger).\n\nMy procedure uses triggers also. As for DROP TABLE, I think, user always\ncan do DELETE FROM <table> before dropping table which use large objects.\n\n>The method I think is best is the vacuum procedure. Now, I have here the\n>basic outline for it, and how it interacts with the existing system using\n>oid's, but currently I can't test it as postgresql is still broken (for\n>me). \n\nI think, in some cases triggers have such advantage as they allow\nremove an unused large objects on the fly, and therefore save disc space.\n\nAnd couple words about my procedure. It was written as add-on for\nmy PostgreSQL ODBC driver for UNIX to allow driver's users to work\nwith SQL_LONGVARCHAR and SQL_LONGVARBINARY data types. This add-on \nincludes script which create two new data types (longchar and longbinary) \nand procedures for conversion between new types and oids, C source\nfor SPI procedure and conversion functions(which are very simple),\nand trigger creation example.\nWhen this stuff installed, it is possible to create tables with new\ndata types, and store long data just usings existing large object functions\nand type casting, like: \n INSERT INTO <table> VALUES(lo_import('etc/motd')::longchar);\n\nBest regards,\nSergey Levov ([email protected])\n", "msg_date": "Thu, 6 Aug 1998 12:53:01 +0400 (MSD)", "msg_from": "\"Sergey E. Levov\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "Hello Peter,\n\nIn message\n <[email protected]>\n Peter T Mount writes:\n\n>On Wed, 5 Aug 1998, Sergey E. Levov wrote:\n>> \n>> I've written the SPI procedure which allows to delete large\n>> objects referenced by currently deleted or updated tuples.\n>> I tested it with PostgreSQL v6.3.2 and seem it works.\n>> If PostgreSQL developers team is interested in it, I'll send\n>> the sources to this mailing list or to somebody personally.\n\n>I'll be interested (I wrote the copy in contrib/lo - post 6.3.2 source\n>tree).\n\nBelow is an uuencoded .tgz archive with sources.\n\nBest regards,\nSergey Levov ([email protected])\n\n------------------------- cut --------------------------\nbegin 644 spi.tgz\nM'XL(`.BJRC4``^T9:5/CR)6OZE_QAF$*B<$G-J2XLL86K%,>F\\@FNUM)RBM+\nM;5M!2!X=,&0W_SVOU=TZ?,`FN[!;-711(+U^]]6O1;AP*ELOO*!1/6HV80O8\nMJB[]%2]PV&PVCNJUHT8=WX^.CJI;T'QIQ=B*P\\@,`+8\"WX^>PGN84^J^AD*O\nMNT*,O^N/`WKGW].R]2(R:M7J8:.Q,?Z']8.ZB'^MV:P=`=3J]?KA%E1?1)NE\nM]97'O[)'8`]R&0\"EDF)3ET847#.84?`G_Z)6!`&=TH!Z%K5A\\@@<PP9&O';Y\nM`<0+VV0X4;QPZ4;$(44ACZ\"7H4?O_7M00P1\\XWA3/[AS;LUR$&M(6R'DO>-9\nM;FQ3.`TCV_'+\\W-%42I[@(@0+@+'BZ8,+X^&P%D1+PHL,Z36W:*(2K]0*X[\\\nMH(+ED!`@?C1W0L\"?A[D9P:,?@T>9,3X\\^,$M/#C1'(;7W2(?R[^[,ST[K*#H\nMV8P&R\"MG*C(M;9<`$4#LAXEE)'I<4)M.`6UH8\"R\\V<3QS.#Q9'7#FIO!\"2'?\nM4G,Q8FY5TLBI][YC:R=DX-B*XEIC?%,E!6`@:[@GWQ7<'+N6BKARBY--4C*N\nM09Z00SCI)$]*\\OIP7\\_->\\I<%=`H#CQ(MQE,%[YFIF?::^0GPGPTXHYAR2)\\\nM=,)9(N6,1A((GGE'&0=&8U#7C!S?P\\>`NA*?(V+(`KDMT#-M>&K\"&?1O>KT3\nM3B;5%*JOTOBNG2`MX4]H6A2YW%\\E]^A#CAS?!`N!F6!U:&@ERMGX(.U)L!@@\nM<!9Y<S`W%)%@J//),LSA$!9V48&85,Q[&5Q@?HYI\\/CW6OU/_UQAXF(3&#OV\nM\"AQK:LRMQC3@&=XV79?W\"!DJK`B3_?USDNP)ARFH[]IQ@/TD$@'OF)&I$5DI\nMU/5GJFX8`V,?MM,D.<[*Q@PH>'Z$NCB18[K.OZF]K7$=F!+#N1^[-HN)Q=5A\nMQ6\\,ODMURFLR,KI75[HQONP:>F=\\.3#&PU%KI'_2^R-U5<G2>30;TWL$:AI1\nM-BEJF=YN!(O`MV@80LH/$L(PKRJS(ERG;K<_U(V1\"/0&92]^&'.TYQ1]SK%%\nM?3G/O+()`YGY6#`;Q#'W\\NQ.\"&2N;R9(JX&A)S0R0D_*8&V!\\(QW-V/*PN>H\nMHIP0'>&E\\\\`>FY$LEW6.[>@]?:3_$L?^E+HWJP<44SM)X=(+:>](=OZ#X0CI\nM4RRJJRQ2CW$6,H\\X'F8^C2(\\]=:XA#4IUN<PRCRP8#L!.]E9SH5L5WA6LIK&\nMGL7<AZ>@ES0'AX9EZ..YC`2/^VFD,CS9]M-$EJS6=`/+QP/3]]S'LD`22;Y&\nM<=&?LR)0L=$A%(_?L>5['AJA:AJ<0O6)BLPAB]Z.=?;!WMYG;[(>6=VI3A([\nM<.#T3\"9-Z=S#9`D1^/'C<LRQAJTYM6X38G9@\\[/)GP*2!,XDCFAJ7*[]HI!$\nM)SS4&)$J).V#HV5!3XQ]ETTMJB!.3.-G^39:_O//L!9K.SNW$2WK`IGR;(GF\nMC@J9D>^H0JE[TXVI*A-V'W+ZY11D2PQ?:G)^H&8A9B\\Z&7T?>Z[CW:H?'`W=\nM+,1H)[+2\\T9F6:\\5]HJ:LL748^.:%%=+&*:K@)\\KL,T,F7CI@G?K?\"`KKN@#\nM[==I1HI/_#?C,,4C+9RKFNQOR12B)@H@#.L=)R^R=KX3$Y0D03PMV<BHUH]W\nM3]))$61Y9%RBDGA+I%P.61X:UQ!SS!SY[WTS^CH6N_]_,F_IU''I2\\EXYOY?\nM:]1J_/Y?.ZK7:PV$U)JUQMO]_S76>_(>9/R3$RP],M-SO8PH`?T<X[00PE7_\nM!H_P6_H.+^37?AC-`CK\\:P]\"/PYP=!0CA8\\E3X9&N],USJ`2AT%EX0=16,$[\nMD3G!,RK$]X0T_.Q6V'4Z]UXZ+!^4ZY4PL`B1]^H=E3/3TE0MS[!EFRXJ`1'[\nM2A'E)+<'?1SF+ICP';67/&CL8D](^[+7NAI^/$.&_'$\\[&E0ZF;\\A404/67W\nM;D._[/9'X[_IQL5@J&?TI<[2#O5L9TK(J&5<Z:/A6>;%';73&]Y<7G:_UW)?\nM6=!.U*:GM_J7W9[.-1*T&B$X.AT?%R\".AUF:0/$WTSXU42/OE1T5!_91J\\=L\nML5#G5N>37D2J<\"!16(39YP38*],OYEUR\\63:P%Y.T1.P?2@RW=F9+G%$\",/S\nMT%>%C6.BW-UB,*\"T6%*4?&\"2C@'_)-E\"E.`.2LCWFQ/X!U':9S\\N'NP?D^<0\nM9[,2Q5'B>#RX^,MWG?%Q4<9LFV&QYB&PI.X,,;6#H9W\"SBF<HPQ\"+)>:WC&D\nM8E/_H@O\\K_6X*7[_Y8'YK64\\T_\\/JHVF_/Y[=-\"L8_\\_.*C6W_K_:ZS>H-6!\nM75%E629D!;6+5Z..,;B&RYM^>]0=]',G!)M2E_;X8.HO3!R\"5W<G3^V*\"?.I\nMW4FV2]K8TT;Z>K6(8NBC&Z,_!(Y/E-;P:2N)TFOUKVY:5SKL6KM$&CWZX5K/\nM?7@MPN176JE*`1G4[!;G133PV(78FT7SL\\9^]CGF2V&G5MW/$2WBZ(Q]^'6\\\nM#.K'D03C8P;'P\\J,W>AL=S>#+<P0^^CD,;G%$&V-GN(6\\,?5=\"FO<M<,29O&\nMV;$EZ-E0\"[SE@*_(G&0RQ>WD%:3R*@\"5?<U?%I=>QEY\"YF2S3'&+^W525^M5\nM,B[(?4)P(EE\\71#M8*>FI?)R`G'.V&3HNG\"NBV=>F.A;_Z,P&:W-YN5CN6*<\nM]?\\:5ZB/9TVS?H%IO_<A];9>;!7G/W$G^(UE/#/_0:UYE,Q_!XU&K5IG]_^#\nM1O7@;?Y[C25'`O[?CVR((LJ%?CDP=.#_!H&!`3?7'8:*G>84K_$N/2<*8H#>\nJ:G^;_&^-*/KW>OL&4:Z-05OOW!CZTJSX]E'O;;VM/]3Z+SAEY:H`*```\n`\nend\nsize 2157\n", "msg_date": "Fri, 7 Aug 1998 11:26:50 +0400 (MSD)", "msg_from": "\"Sergey E. Levov\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "On Thu, 6 Aug 1998, Sergey E. Levov wrote:\n\n> Hello!\n> \n> In message\n> <[email protected]> Peter\n> T Mount writes:\n> \n> >On Wed, 5 Aug 1998, David Hartwig wrote:\n> \n> >> Peter,\n> >> \n> >> I have just finished up some other stuff in the backend, and I was\n> >> wondering what to do next. My personal list include a cleanup of the lo\n> >> type. Specifically:\n> >> \n> >> 1. Assign a fixed OID to the LO type so that attributes of this type\n> >> can easily be identified.\n> >> \n> >> 2. Write a VACUUM LO procedure.\n> >> \n> >> 3. Extend/verify the existing internal lo functions to work with the\n> >> new type.\n> >> \n> >> I know that more can/should be done in this area, but I only have so much\n> >> time. I am aware the you have done some work on this in the contrib area.\n> >> Were you planning on handling any (or all) of these issues as part of the\n> >> 6.4 base release? I will gladly move on to something else.\n> \n> >I claimed the parts of the TODO list that deal with these issues a few\n> >weeks ago. Since then, I've tried several solutions (the one in contrib\n> >was an attempt that uses triggers. It works but has holes - like DROP\n> >TABLE doesnt fire a trigger).\n> \n> My procedure uses triggers also. As for DROP TABLE, I think, user always\n> can do DELETE FROM <table> before dropping table which use large objects.\n\nBecause JDBC & ODBC (WinTel mainly) allow existing apps (which were never\nintented to be used with postgresql, but now can), we can't assume that\nthe client will be able to issue a DELETE FROM. \n\nIt was partly because of this, why I started to look at using Vacuum to\npick up unreferenced large objects.\n\nI have heared that some people simply delete the files - but that screws\nup that database's system tables.\n\n> >The method I think is best is the vacuum procedure. Now, I have here the\n> >basic outline for it, and how it interacts with the existing system using\n> >oid's, but currently I can't test it as postgresql is still broken (for\n> >me). \n> \n> I think, in some cases triggers have such advantage as they allow\n> remove an unused large objects on the fly, and therefore save disc space.\n\nTrue, which is why I think the trigger should be available in the\nbackend with the rest of the lo_ functions. Otherwise it will be the only\none the user has to add in manually.\n\n> And couple words about my procedure. It was written as add-on for\n> my PostgreSQL ODBC driver for UNIX to allow driver's users to work\n> with SQL_LONGVARCHAR and SQL_LONGVARBINARY data types. This add-on \n> includes script which create two new data types (longchar and longbinary) \n> and procedures for conversion between new types and oids, C source\n> for SPI procedure and conversion functions(which are very simple),\n> and trigger creation example.\n\nI'd be interested in looking at those types for JDBC.\n\n--\nPeter Mount (at work) [email protected] or [email protected]\nIf you mail me here, please cc my home address [email protected]\n\n\n", "msg_date": "Fri, 7 Aug 1998 10:16:18 +0100 (BST)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "> Hello Peter,\n> \n> In message\n> <[email protected]>\n> Peter T Mount writes:\n> \n> >On Wed, 5 Aug 1998, Sergey E. Levov wrote:\n> >> \n> >> I've written the SPI procedure which allows to delete large\n> >> objects referenced by currently deleted or updated tuples.\n> >> I tested it with PostgreSQL v6.3.2 and seem it works.\n> >> If PostgreSQL developers team is interested in it, I'll send\n> >> the sources to this mailing list or to somebody personally.\n> \n> >I'll be interested (I wrote the copy in contrib/lo - post 6.3.2 source\n> >tree).\n> \n> Below is an uuencoded .tgz archive with sources.\n> \n> Best regards,\n> Sergey Levov ([email protected])\n> \n\nNot sure what to do with this.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 22 Aug 1998 07:17:23 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" }, { "msg_contents": "On Sat, 22 Aug 1998, Bruce Momjian wrote:\n\n> > Hello Peter,\n> > \n> > In message\n> > <[email protected]>\n> > Peter T Mount writes:\n> > \n> > >On Wed, 5 Aug 1998, Sergey E. Levov wrote:\n> > >> \n> > >> I've written the SPI procedure which allows to delete large\n> > >> objects referenced by currently deleted or updated tuples.\n> > >> I tested it with PostgreSQL v6.3.2 and seem it works.\n> > >> If PostgreSQL developers team is interested in it, I'll send\n> > >> the sources to this mailing list or to somebody personally.\n> > \n> > >I'll be interested (I wrote the copy in contrib/lo - post 6.3.2 source\n> > >tree).\n> > \n> > Below is an uuencoded .tgz archive with sources.\n> > \n> > Best regards,\n> > Sergey Levov ([email protected])\n> > \n> \n> Not sure what to do with this.\n\nI first had a quick look just after I received it, and it looks similar to\nwhat's in contrib/lo.\n\nI'm not sure what to do with it either.\n\n-- \n Peter T Mount [email protected]\n Main Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n Java PDF Generator: http://www.retep.org.uk/pdf\n\n", "msg_date": "Sun, 23 Aug 1998 20:34:17 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SPI procedure for removing large objects" } ]
[ { "msg_contents": "unsubscribe [email protected]\n\n", "msg_date": "Wed, 05 Aug 1998 11:01:46 -0400", "msg_from": "fcheese <[email protected]>", "msg_from_op": true, "msg_subject": "UNSUBSCRIBE!" } ]
[ { "msg_contents": "I did a CVSup a few minutes ago, and tried to do a clean install.\nconfigure seemed to do the right thing, but initdb was not happy. Looks\nlike (perhaps) the recent changes to initdb to allow non-interactive use\nmight have broken things?\n\nRegarding specific symptoms:\n1) libpq.so.1 did get made and is in the right place afaik. Don't know\nwhy pg_id is complaining.\n2) initdb has a syntax error in the script.\n3) initdb does not print a valid uid for the postgres user.\n4) Bootstrapping the template database fails.\n\nI haven't done a clean install (or a cvs update) for a few weeks, and\nI've seen a bit of traffic on the list about problems like this. Help!\n\n - Tom\n\ngolem$ initdb\ninitdb: using /opt/postgres/current/lib/local1_template1.bki.source as\ninput to create the template database.\ninitdb: using /opt/postgres/current/lib/global1.bki.source as input to\ncreate the global classes.\ninitdb: using /opt/postgres/current/lib/pg_hba.conf.sample as the\nhost-based authentication control file.\n\npg_id: can't load library 'libpq.so.1'\n/opt/postgres/current/bin/initdb: [: =: unary operator expected\npg_id: can't load library 'libpq.so.1'\npg_id: can't load library 'libpq.so.1'\n/opt/postgres/current/bin/initdb: [: too many arguments\nWe are initializing the database system with username postgres (uid=).\nThis user will own all the files and must also own the server process.\n\nCreating Postgres database system directory /opt/postgres/current/data\n\nCreating Postgres database system directory\n/opt/postgres/current/data/base\n\ninitdb: creating template database in\n/opt/postgres/current/data/base/template1\nRunning: postgres -boot -C -F -D/opt/postgres/current/data -Q template1\nERROR: pg_atoi: error in \"f\": can't parse \"f\"\nERROR: pg_atoi: error in \"f\": can't parse \"f\"\ninitdb: could not create template database\ninitdb: cleaning up by wiping out\n/opt/postgres/current/data/base/template1\ngolem$\n", "msg_date": "Wed, 05 Aug 1998 15:08:51 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": true, "msg_subject": "Broken source tree" }, { "msg_contents": ">I did a CVSup a few minutes ago, and tried to do a clean install.\n>configure seemed to do the right thing, but initdb was not\n>happy. Looks\n\nSeems linux users have been experiencing problems with initdb, and I\ndecided to make another challenge of installing PostgreSQL to my\nRedHat 4.0 box from scratch. (I did cvs up a few hours ago). So far no\nproblem was found.\n \n>like (perhaps) the recent changes to initdb to allow non-interactive use\n\t\t\t\t\t ~~~~~~~~~~~~~~~~~~~~~~~~~\n>might have broken things?\n\nI didn't know about this. Maybe you mean the patches I have sent\nrecently?\n\n>Regarding specific symptoms:\n>1) libpq.so.1 did get made and is in the right place afaik. Don't know\n>why pg_id is complaining.\n\ndon't know too.\n\n>2) initdb has a syntax error in the script.\n\nmaybe due to pg_id returning null string?\n--\nTatsuo Ishii\[email protected]\n", "msg_date": "Thu, 06 Aug 1998 13:42:56 +0900", "msg_from": "[email protected]", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Broken source tree " }, { "msg_contents": "> >I did a CVSup a few minutes ago, and tried to do a clean install.\n> >configure seemed to do the right thing, but initdb was not\n> >happy. Looks\n> \n> Seems linux users have been experiencing problems with initdb, and I\n> decided to make another challenge of installing PostgreSQL to my\n> RedHat 4.0 box from scratch. (I did cvs up a few hours ago). So far no\n> problem was found.\n> \n> >like (perhaps) the recent changes to initdb to allow non-interactive use\n> \t\t\t\t\t ~~~~~~~~~~~~~~~~~~~~~~~~~\n> >might have broken things?\n> \n> I didn't know about this. Maybe you mean the patches I have sent\n> recently?\n> \n> >Regarding specific symptoms:\n> >1) libpq.so.1 did get made and is in the right place afaik. Don't know\n> >why pg_id is complaining.\n> \n> don't know too.\n> \n> >2) initdb has a syntax error in the script.\n> \n> maybe due to pg_id returning null string?\n> --\n> Tatsuo Ishii\n> [email protected]\n> \n\nMulti-byte pg_class_mb.h and others had duplicate copies of the file in\nthem. I am committing a fix now.\n\nAs far as I am concerned, if you want to just add the endcoding field to\nvarious tables, go ahead. It is easier than maintaining two copies of\nthe files, and should make your job easier. \n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 01:08:55 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Broken source tree" }, { "msg_contents": ">Multi-byte pg_class_mb.h and others had duplicate copies of the file in\n>them. I am committing a fix now.\n\nThanks.\n\n>As far as I am concerned, if you want to just add the endcoding field to\n>various tables, go ahead. It is easier than maintaining two copies of\n>the files, and should make your job easier. \n\nThanks again! If there's no objection, I will go ahead.\n--\nTatsuo Ishii\[email protected]\n", "msg_date": "Thu, 06 Aug 1998 18:24:51 +0900", "msg_from": "[email protected]", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Broken source tree " }, { "msg_contents": ">>Multi-byte pg_class_mb.h and others had duplicate copies of the file in\n>>them. I am committing a fix now.\n>\n>Thanks.\n>\n>>As far as I am concerned, if you want to just add the endcoding field to\n>>various tables, go ahead. It is easier than maintaining two copies of\n>>the files, and should make your job easier. \n>\n>Thanks again! If there's no objection, I will go ahead.\n\nIncluded patches are mainly for this purpose. \n\no note that now pg_database has a new attribuite \"encoding\" even if\nMULTIBYTE is not enabled. So be sure to run initdb.\n\no these patches are made against the latest source tree (after Bruce's\nmassive patch, I think) BTW, I noticed that after running regression,\nthe oid field of pg_type seems disappeared.\n\n\tregression=> select oid from pg_type;\n\tERROR: attribute 'oid' not found\n\nthis happens after the constraints test. This occures with/without my\npatches. strange...\n\no pg_database_mb.h, pg_class_mb.h, pg_attribute_mb.h are no longer\nused, and shoud be removed.\n\no GetDatabaseInfo() in utils/misc/database.c removed (actually in\n#ifdef 0). seems nobody uses.\n\ntouched files are:\n\nIndex: src/backend/bootstrap/Makefile\nIndex: src/backend/bootstrap/bootparse.y\nIndex: src/backend/bootstrap/bootscanner.l\nIndex: src/backend/catalog/Makefile\nIndex: src/backend/commands/copy.c\nIndex: src/backend/commands/dbcommands.c\nIndex: src/backend/commands/rename.c\nIndex: src/backend/parser/gram.y\nIndex: src/backend/storage/lmgr/Makefile\nIndex: src/backend/storage/lmgr/lmgr.c\nIndex: src/backend/storage/smgr/md.c\nIndex: src/backend/tcop/utility.c\nIndex: src/backend/utils/cache/Makefile\nIndex: src/backend/utils/cache/fcache.c\nIndex: src/backend/utils/init/postinit.c\nIndex: src/backend/utils/mb/conv.c\nIndex: src/backend/utils/mb/wchar.c\nIndex: src/backend/utils/misc/database.c\nIndex: src/bin/initdb/initdb.sh\nIndex: src/bin/pg_dump/pg_dumpall\nIndex: src/include/miscadmin.h\nIndex: src/include/catalog/pg_attribute.h\nIndex: src/include/catalog/pg_class.h\nIndex: src/include/catalog/pg_database.h\nIndex: src/include/commands/dbcommands.h\nIndex: src/include/mb/pg_wchar.h\nIndex: src/include/nodes/parsenodes.h\n\n---------------------------------------------------------------------\nbegin 644 mb.patch.gz\nM'XL(\"+N\"VC4``VUB+G!A=&-H`.P\\>U_;2))_BT_1>)@@@XSU\\`L8N\"6.DWA#\nM@,-D=F>3K\"/+LE$B2QI)#F&3?/>KZH<>[email protected]?5K>J2_7JZJKNDOK>\nMV/YP0*+0JH],ZYWMC>LCWX^C.#2#^G/SG3UQ7'OCZ-O_;5QV!P21'9#Z/`KK\nMKF^9;MUZ'X7PN'HPC?YTZW=3H;S?\".TX=.SWCC<E(?Q$CN\\1;4]K;HR=R834\nM+%(+L4D2PG=V=I*&I.WO=^IJNZZWB-HX,-0#K2W1T;5:;1&J4]?VB=H^,#H'\nM6@O19/]1M+JN&\"JA34(<SW+G8YOL[=7A?X%K;^KZ(].%^_!_]_'IR9,!V3TB\nMM?[>WD:-.).Q/2'/7YQ>]1_^<=6#'@8\"$%OR\\X?TN@J](`UGPG`X$_M/(F_)\nMW6Y5(5/+JB9X$>W?/+]FAZ$?4H:`/KU-X*JVT;]+R7@5F&%D[]VN5\\\\90DI5\nMK:LY5>LJR9*/:LFT<ZK4#U3M0#<DB@/E4P9XE\\X-36D80N>_\"*57\\CS0J[WK\nM2@[$,F/3]:?U:[O\\7C`=FC.\\68.;2\\91#!^#E$;SV![.1F)D`9CEFE&4@MAN\nM9)=2(##>025%)W!QZ\\P`^K.9Z8VC.G`0VK-%/)X_MJ,Z_5M\\BRHEN8^J`K$;\nMG15-.;),S[/#/7?]QIR04NZY\\N:L,7-.61`&G?04^+!]B>(1)KT(NH(C4S..\nM+%5&%/NA.;7K(V#ZW:*FQ$U_,BF[Y<3V+(C#;[;GE8VUT!A-R[*CJ`Z`WKS$\nM%`&/ZT3QXDT^,IX'`&0)4P1A@>BI*18Z\"%UIZ,NRY+@F<\\]RT(#+9#89?T??\nM\\`63_NX)?<>,#>V;$!1=#\\)(+[(3SGCTSKY-)-A1C$;I9!9$K3/T6*2A?/KJ\nM^>FKKQIXZ*I$1W]=X-%0FHF-P?]/>F</G_6/R%Y]:GNC=\\Y>=(TWE@,,`#T]\nM?WAR\"M##`<@$XPQS/`Y\">/X''KIPS24R4,@KP+3\\#XQF#\"`C,V)3%3O>FZ%C\nMCB#LH:WHVAS[-W!=BF`:^O.``<.CRB!I\"(2V6_M*\\@L>GB7_'MI+1A?07@\"8\nM\"]^*%')ZWOTN^@`R@M\"W&$'Q;<#YR+M3DG,*I8@<[]J&21VQ`=Q?41G9(1H^\nM%U%LQN`U'>L.3'Y@AR:X-C;\"#[B;(=R9L5\\_$%><@S)LKNE-Y^`E&3A$\":4F\nM@]BFT]\">FC&'=@)7L$.9N^=1W*UQ_0*;-BZIM(6+0>@$,1,$E0YXA1)<&=O]\nM*DT7F-1]FLZHN<PJOU+'Q9B^6L>X%#04HUF^F#8;2BL)3+Y%R<6COT[)RZBJ\nM&YO))&<)G[9'W;`_#RU8<[9DYJ&K>)7S8)B^2=$U]`^>GE]<#:HY6/A).O/#\nMR#'9^@O1C\\73,N121X,A<QLS%2K:?W?9_;N(K2@:$:F,Y0>W>]9:@I$\\\":6Q\nM2-/(Q2)-@W\":<2:QR^5\\N-&0Z$BTF`*8.U/A=A+I\"GMK\"7LKR`6!Y.G4#A?B\nMP]^R@>\\Q*F%W.;S=S>\";C3!<O;&N38IJ5X2KNVA%O\\`XQ[-)?W#>O3HYE:TJ\nMD67\\>WQ$MM7M*GGP@-#V;]!N;U>KF3&_GYR^Z+$1\\*=&X9&>(M9;FM)J\"[]$\nM?:1%D\"*RTP497MKF^$1X8_EQ_[1'=B:!@LF92W:<R)N[KL+AQ[;KS*J'+([C\nMK&P*E.]]9TP08X+M?!YG$#(4D&Z\")>00*C#K8N)$0S,,S5N*GJ.$?JGKS[WX\nM:AZX=B1?VJZ)Y@^&Q\"X$+?:'V`X]PAYV,?'GL4+5W&HJ;4VH>7VLS[W(F7KV\nM^*?+H,@<-%5M*9JJ:>EL@)8*77HR(R0D39(L1\"TA!9(T]L'LCHB:Z7)8NW`.\nM4)`91*C>H6C9GN6/@7':D1.)%+W47R=P;P]S$Z48O4`&)&!X:\\<00SBV%P_%\nM#;E*$48OM=<)F9FM28ZS>W[QQ_#BY*K[%-FJ[T#,2R`BB`G5\"BP9(;DQ(V(2\nMS[YQ<>*!-YN#E$UR]N+TE\"1A#-FI%PM;4SN*IH%D^?R3I,_T+SQ'WD29TM5!\nMDA),+YW=7:28R9[\"@9R/2._O5\\.3JZO3WAE,=XV/LB'RDGN7E^>7\"JDLF30`\nMI@2\")J;Q-8E]G[@^+'`$V3D@OXXK\"KWT?&I(C+P,-4C+]BMUF][DW,L/4@#U\nM-1WWF8DU,R%@>GP';P`X/RX8)#8G?DCD0R);0!W'4B6;G%+\".G9WJ90^)G*T\nM4([T(4`U^?2)T([M5]XV-)A`9=[U:AN][V9\"1I7-$TTW0)OM9C)/OD\";Q78L\nM@86J\"00TZ9QA5BU,>4C[9-%42%3-`M=JO`5\"D=\\>J8=O?V,3[RU(`*1'[Q%D\nMEL`\\L>1)((;C#CV1)[8_P<ZJZ\"3\"RF4T\\A2XF\"L)A9\"97/]6-ELL=,:>3!,/\nMZC1B?QC9(203LIQS3#O5!*N\"5H5J2'JJU2KS*FRGJG1R9&3SI;-D<>&@-`Y7\nMG#6[2=B:1Y/^XS/G<'&\"?95'QPYG%=?-'LI,G',$\\F>:D!=8Y#+/]3*QK[H\"\nM,/5D'YM#M@K!PMFL-#4YB>`^<\"@7M%SHJ*K\"4^$I&T54S=K3JCXN._>^D[,K\nM7LH:.CB_1B<3-VC[FJ+IJI'Z0_!\"P1R<#&)5\"'4UA+D(YBU+O\"#EU0'?Y7#?\nMY61\\%\\.X(W.6G2I'O\"LP\"HD)2&$]'\"H5SV<Q!^]*GL8C<;GF%\"I+R!<<,>;H\nM1\\UE.PJ2JE9ZR%@*R5*K=J%A-`REL;^07]\"(&+*E8/C>M.;SF<Q]U2@PX^O$\nM<XT\\<V:+^)5[0RNT(<L?C^0L3#H\"QR=!P;DSQLAT-'3&\"K>^.<QN:!Y2=AAE\nM^?#_AU+&W+#P!BO16231?579;Z<1HR0>Q0<I)$-?&M1N@H\\+P/#CB3R:3V!Q\nM=3R`CY$D/[N#3&2X8@CA8CPRZ2\\5;`612%*%O#?=N1T1^=7VKQ%.9/@=\\U]H\nM5P\\K@H8,46#70F(2NL@/MC7\\<VZ'MT@.#Q)1*\\A=)^,Q?CAWJ7?^$C[OY3=%\nMRSBG6T-W,7^7TPEMQ+YFAR.(*#]!:N1/D!HDH1OM5C26G4Q3E^AHU'\\AU%T.\nM!LL8M*53RM_FL>-&=?N#Y?#=F,5;,^M#O'@G<XK(]@R/[SFB_*WPB/*XZ(AR\nM\"53`+1Y1_N8',627_[+#[email protected]\"A&$=@!W)<Q.<9F<.-YX:+JNV/KT\nMPPBS3YK2>LC&V?EPT.N^N.Q?_9&4(Y17UM#RA;`^#<W9>BIJ<@246)Z^IV?W\nM\"[%).,5H(.PRM:<.4=6#1N>@V93H2)3\"(HRP.;WDU!*C'?C33J,=T97XKC3N\nMD%C,M=7\"^(PF3:([G^[\\K7_UE/3.NN>/^F=/(%PGGA^3:!X$?@@K2T6D6I+D\nMU8XS\\:V:<X448&L+^N4S'VQEI^KQ(`OBFV)>FDAX,\\=+TX\"NEIJ-W/\"I;!TC\nMC(O#=*,D>PI80.$3.[ZR9X$+\"V2O./S^)JX*[%9LQ;JS:;C6X_=\"0DH]:\"?G\nM0#NKGL`W\\`2^<\\\\!O%[L/C50?DGEWVK%?_6OK?\\[?_C7`2@4);.'*;SU#GYF\nM<S=VX)>Z7Y]$(\"!XNB].@H!:K=Q;Y81-\\:YEQ2P@HWS-;.?7S#;A=*-NV.7B\nM>JDS?<-(E$@!S%WJ;FA*4\\O46RQ7T%@L0\"JKW>&_/[5Z9V.Y@&=FSPIK>))\"\nMK_D$!</+=(#KQOUF$Z&^9N/U&DU\"1*G)&*V<R1@M0FE&[>)%:@H:T<`.('!J\nM2G042B(/D1A+I]!8FJV.TNSH::X!\\4A#DOP;SPZ9^V6Y\"V8JV**[1+AS%,^\"\nM\"U@H#HM,A.-!.`#K)9M$67V7#(-UY-*\\><1C^;XW\\>7Q\"-)YA3R@-,$ORQ!8\nMMO4@@[]ZF!A>[4LQ50\\7C)%O8HYQ/1^/G'%V[_+QR=7)*2SFL_'(A5CL)HP/\nM\"\":5_@1`R:^16-=_G=.L@3Z3XF!)*15Y^XZBO)9F*\"V]\\TTZ^7^U?*E:6FI;\nM:6G-4A<26WY0Q[S\"B==TM)ZGH-1Y-/*O%S2:)*4:S2MI)4Y\"A2BC>:#!JM.1\nMZ'B4QS+8O;ZD\"8;=ZF26'@S>=H*(%N;,(SPP8)GFE8GQ7Z5[V3NYZCUZ6!&!\nM7O=IK_MLV'\\\\/'EX?@EWY&JI?P&S%]LQ43R+,7!EZ;EH,4MD+;O8%E?\"D;?!\nM9\"=3&L'0=X<B:F&\\E]>)LH34,JUK>ZW!:A$=WSM6;396B56+;6CML2K$*50Z\nM$)DZWGO(RWT\\:&=_Q8WH-A*7;N9ZPB]6BV2SFN`CU^)5BNCX@E>7$M)1>Z*Q\nM&,\\:!^I^^NI2(10SBOU\"H\\!7EPJJU#,A)2LL+\"U%9SL]I;?32LVUU*OS#1#Z\nM$X<VDB'V>J;8X:)3DJMBDT<,8XH;S1U(I[RE*)G=Y:(6I>PPN<K?2V$C',\\!\nM*_&C&\"_6:9$+A)3'ROE\",L,@&>K1>M+F<MRLXX)GL`VB(KA[#+/55MJM+TFU\nM5K.L7*5Z7JT+!67I:G8G(HZE,-ERG5'P9YW^%7:\";!GE\\6G'4/:-HO.>/DCO\nM!9BR,Y:QO5\"8Q,Y)>A\\\"\"`!$_(?A*C].X5O^A<L]QT`?4A!`I@CH^4N#[/!0\nM$N)D/)FAN_4,*#VDV2D,\"K[ODY;B5RZM_D7WF7U++L#BIJ$=]0,+FDDLT5&5\nMSAWI@:9W%\"U]K6\\I.TC2`<HK#Y9FMRCJE\\]/_G[QY.+DZBG9)=KKLN`J>X:U\nM%($/[%B(Y`S]TEUZ*XKVF?\"28/_Y;7(71,?(A.[BB.WKT\"UG$;1<!U36CWXW\nM7;#6[*@JRRDR*05?S#5%,]1[O\"=,3\\OWWJ_3;R8DE\"_B^36<<(IW:.$M7J8A\nM78/`VFUH!TT\\(]9XW6T&Y'X7:;3V%:/=S%3>0D=#;:6UWC/'TK&2T9/A2B&!\nM@F4_\"CGM#ON#\\TZGN3]LIA5FNZ2^@X4M.^1DT.WW$<LQ>=[OTKXZ_,WZ(S.R\nM'$<'K/)\"'8V[5%D3,*?`2S!8[0QV6-HAJPLAY.8:5$%D6G!%CHE*RW,M#8LS\nMW-W=:C6IN-D)=G=Q&QON/2#JA_:$;H0C`[OT;J8XZ3-#+G@\"1AA'E+E\"GE!:\nME*]%GJCPOH6K!9X`7X8G6E&B(0CRDRDNHD>R#_WI/.K\"(^4'E(P'`6<9F*8O\nME)\"/#!K\"FNC:G[MC,K*Y!BF')\"LX1AU))%8F-Y(KQ$&[',8CE[Y.PJ]?8B$8\nMH_7CX+]/A_2)\"JDDUQ6%J$IJ)THJWL\\*QF``6#_A5\")!'WLONL._7@`*=L'&\nMVW-K^#9($;`VP\\#@<N.[9WQ\\]RP=;WGY\\9:7CN^>Y<8_N^3CGUVFX]^%^?'O\nMPG3\\LTL<?Y?38@'%>KT6IV%EMR5H1B_#KPL<5SMQ7'F8%3R7UH*T(U,ES3IT\nMX;EX+9\\(QX3M\\0:^G)<U/U\"3^EEA2D2SG5M@,0SVQHFOA]3GB1NLJBP/#@92\nM#&YY1>!@#\\7@[\\($O)!KO:T8AI&^QO21)[email protected].$@$_;D!M49CW7%/%\nMX3N\\AG'?VNU$5CV)F-<Y%_*$E$^(_\"F!UB(9ZE&7:7,Y(==QDT9C)P8E<'=.\nM#E4Q6IFIH<*:OOPZS2HI:K*!0N]^[0LUV9'J!EUHGJ2!*HT4,:Z#-?9B[KH)\nMQ[`:0IH]8R]43$)_EGO3E@XHJ>M7=453V]E7*%I8YR]DL)'6`S\\^.1WT:``C\nM%5'%%L!L>,K6;K@HS95$&5PA9>VFHG62`T#@N';//\\YF4N?V'?*>#5[XQE\\=\nM&4W&F==&<$),7',:L8UW#?(=K9,&A.L@>#$E7)7^(@7H+?R232-3O@<LS6S3\nMB_`H8FK',<YC,\\9M1-QNI/7NT9X`K;.+>!X,QR,,(Q^#@0XS9EDE3WI7@ZO+\nM%]TK&:!$X1DO08GBT)H%/\"UB2&K'O\")N#U%4L>97Y0<G'\\4F/94(/`U&U([C\nMH2_.EB0LF_:LX%9F8OK]Y/(1)$7R`SF#FZJ\\*E)-29(!:M#_1Z\\(BM00Q]-'\nMEX-_5$5ML+1#L4-.NN+`S\"LI',/4CWV\"+V`DY<9TPZO55O1]+5/C\\N-5L>2^\nM:*4AS'QX7))5,U\\3\\XJ9U`$S8##OJVN''EC%U^#T`)\\Y=V.Z(\\BO*]A(H-DQ\nM1NK5^#%+B@Y8V5RPD(IXNE91[K*3368G]`>3_Z4R'S$XD[)O,A5LYLY-_O.L\nML^R-'VDG4P6U*+[%%]6*K3L;Q3@>W2P=C_@/?E#C9P8O!<\\O/YS,QRR-%DEI\nM1N>9M-)(I$&TUH':/&AJ$AV/$[L`3`0LAE8<L\"R__YN\\M?#+THK#3Y:>/SH[\nM>=X[>H.3\"DV4;*EO0#V).ON/CE0&FG0=#8?)]7\"X03/GEX34/%+92FY4R.M#\nMF-E>\":4-Q>@TLA\\2L*UKGU1.QM1DDGF;SO=\\!?3>WEZ%496.]0-(\\#,P%4CE\nMZ_$LJ#/7L;>U!;.5)_HO2>U?A=3\"M&;8>.FUG)*R=7$^N'IRV1L,!R\\N>I<O\nM^H]2.JOPL)*GT8V]+T.[E9'^2L^8.%P2O[\"G1-?^31%T5ER6ZX-8\\_(J&,!-\nMJ0GZTM(-K9^JKQ\\CN1\\FL`6_A0/F`,-_3??G?@:MD((OR+<R9./,39O)1H2Z\nM3S<BF@?&?IIO+<'=[[X:':69N(3>V:,-(?BMCP\\'GZG]!,`6J<'_)Z3V)ZG%\nMGT@<DNU/VP3_^T2FH1V0VGNR_<_42+#_%1@2VP0$/8T)KI\\/3P8]\\NCABT'O\nM$BP%>_#(`!XQQK-M*;$L!#BJO*&$O*K0#V;`BFR[MA7C6Q+48[(OIS#R^0SY\nMN>0GU=;?RD>16IHMI94IGKNYMD,;AT`\\20.6+4'&(2+^Q%$S5CF?Z4Q\\@V*0\nM,G*Q?,]#&HIF-:*MI*YS,0+<$H(X+$.:0\"PA96^PH(62K8_:;F7K+Y7/*3@_\nM/WD)Z/ZK`NN:353RFA>V*:W]--9>@S!0'D\";J.HAM6O;#3Y1TTDBKN/ZV'Y?\nMQT\\[(+18UTK$B#M1R=\"C[3>9#6>R)2SKS79.W*@3OJRMH!R`@@6*97`_7$L9\nM[RL^WX2;3>9XYGA[/S5H+'A\\^0E__@U'0R59HG$:9MK+9_P&?D358.\\W%@(F\nMKE<OWE#16DKF`PZYT^SLW@S/1O$;$AXIW,G#-.S_\\/DVQXV;)(N[7*5X<[A6\nM+15(P/E+R*@??6EW=_$#9?FOCJW#V(LI*;?[_,MV1F/APVDBYLAT%5@_QAU&\nM0\\0=A;#)!\"A^H:\"M:.EY`-]3Q&\\6A,[T&F).JTH`4T,AE_;4]F*ZM8+;%B\\\\\nMAWZ=+;[%GJ[I.A,_]!R38=E$+%O]\\0%9E`;EG!0P0F;^[*UC>K@O2K8RQ)R=\nM7_4&]%(B]-')AR4)^V(6C0UP,\\6)J+X(V!4\"X:?@[(C@=[RH@\"BGR0[C#^64\nMUO8P9I=Y;6@_EM<B+>MZ0]'3#^NRW2^ZF\\*3BW,(IHY@&9$)>$.=\\%T;29+0\nM?@@FR@B-W_H@1(.>FH;_3^`_!_^R_92[$8Y')N#3#>@D#4\"C)VAB0!$)-)OW\nMH$'_@'B:;#@AQE>08\\6TR%[2VTA-B^#H+\\?B<R0MSE(MS])J2#[`@D6Q=`26\nM$H;HGB?58YJ._F_5HUB^<HB,[V00C?\\0@[A[.>1EJ6M>\"CD5Y1^XR'^U&%;Z\nM#.E\\\">3-Y>6O0;^@KXOE;PEN[4M?PCWEM&`I,%9;\"MZ\\H9^Y9)^$V][&LX.1\nMS20)Z9)EC\\GHE@'1)VYO[Q%BS<,0R'9O?]+BEU9,4W9SB[RNPPH/L?K/X+8P\nMRC=4X#^)\\A_U!MU+N5(IF8DP\"S68C,F7E4FGC><L%T]PGTVE_X%TP$$9A#>&\nMF'$.\"9_:*?8BUT7GN)S[ZC/I=`KPA_?C+Z&^P?&+[TB3?;60?OT^_#0\"Y[+C\nMQO,_W5U+<]HP$#Z;7[''/I(.?@\"F.3E`$@=C.L%ICPR3TB8S!#/!F22'_O=J\nM];`DO&Z=F32T/5KSR9;7^J3=U>[Z7Y%=L&_9_7IUUL';>UZ@]4#JJ[G:Q5SM\nM>N5JD=8MN/ZB;Y1Q'\\-1_,['-J_L6GI'+>1?LE*;8L!7!N(E_@<3Q<H^$/M2\nMN5#+3$',YWE]\"\\4/C)]5\\+-A#$!'_X`CE5@5I!$XCM!\">4.Q?\"QX`ZJ!1_PL\nM_G-T$4?'R0B8FGN:G<%)/$J&0E7^`7C*CW<U3_IY3BUW[I#!*(ZS&QH`5SG;\nM;K:;?(VOFL,\"-CFO]2(N\"BSFRMV+LC\\*2H0BX0<R;Z2VN0_BM(D+03ZXJ1#>\nMJP9]R/QB<MFW4*B9@L<-/;T:.,Y5?KMA,^T.H]>WQ0*)@<$4QAU;9.112\\5.\nMJ+K+*3/@M^8KH1KNMW1AYFA];[WRO+2OW-^@I-%D/(Q\"\"5/&%\\[NEDKJ$9$-\nM^`4_G<Z5#WA^QAV.\\OC%\"+#ZT_((7DL>VD;T&XDM:\"(P:E<F*O+M9U>F!E(?\nM;&''6H`U^G=V8<#KW3Q>^?>Q8+<N8/,MV>T?>'W;GZ0^T2P^'<=),HQ&DVGJ\nM.NPR&UU,6G4%\"$RO]?.K\\-7YOYM4&J0<W+SSU^6VN,N?=GK;!<+U)!L>#Z:3\nM290.9YJ4*)YJN8'R8,0,=-W+R8PY@'KCW+;-P1BSU/KD)3&]>-U)I?+9L\";Z\nMGM>KI@1O9$9=)6U2G_N8N;5JA=`58\\4T-183F;_1EKD4O.?Y8K-8+[=+>RF4\nMF1JNB1Q<W]#`\\05X)G\"<L\\FXMDF\"N.P+^\"8N6]P\\\")R^WV4:#Z;#$00(9(K>\nM%9;/NLQ.#D,;QQ@UFL<I8UH:)=!!].1^A3'0H@0=\\(Y6ER3*XM2%+F+CV?00\nMT[$@P8A\\<`FD!ST\"Z1%('T(\"Z1/(`/H$,B\"03\"-O$]`.`>V\"ZQ+0+@'M,9./\nM@/8(:,@L80(:$M`^N`$![8L9P&?H:I4_L#FYA<4=UX)`E#?6)]GY>O6TLZR>\nMQS/P/;[DS*YOOA6`#6)*\"^/!\"ZM1^B]/FC*_2O\"&9U&I9*\\*M=S&U/*:4LMO\nM2*V@*;4ZSZ)6]QG4H@A#4XLB#$TMBC`TM4C\"U'\"+(DP-MRC\"U'\"+(DP-MRC\"\nMU'\"K\\[K<(O;OZK]!][&)5T=1[\\*QM<5.`-;@^6YN-.B-NHW>#Z_+-FJ'WX5O\nMZ\"2RW-+IVB]!V#X(PE)C=+`,9+9@RCU6][!3VX6V=224*S.L4H;:B-!]`RY-\nM7(2CS'B^#Q:&4EWK(C-4P:S2<):/E!'YJKFE@LL9]`U;&IE@OR\\?#07JK7Q\"\nB^2,`&$CM<U;<%CIT9-?@DF:7,.)0/+*@S$^A@^G/\"'L``)E@\n`\nend\n", "msg_date": "Wed, 19 Aug 1998 18:26:07 +0900", "msg_from": "[email protected]", "msg_from_op": false, "msg_subject": "new MB patch and pg_type oid problem" }, { "msg_contents": "> >>Multi-byte pg_class_mb.h and others had duplicate copies of the file in\n> >>them. I am committing a fix now.\n> >\n> >Thanks.\n> >\n> >>As far as I am concerned, if you want to just add the endcoding field to\n> >>various tables, go ahead. It is easier than maintaining two copies of\n> >>the files, and should make your job easier. \n> >\n> >Thanks again! If there's no objection, I will go ahead.\n> \n> Included patches are mainly for this purpose. \n> \n> o note that now pg_database has a new attribuite \"encoding\" even if\n> MULTIBYTE is not enabled. So be sure to run initdb.\n> \n> o these patches are made against the latest source tree (after Bruce's\n> massive patch, I think) BTW, I noticed that after running regression,\n> the oid field of pg_type seems disappeared.\n> \n> \tregression=> select oid from pg_type;\n> \tERROR: attribute 'oid' not found\n\nI just tried:\n\n\tselect oid from pg_type;\n\nand it worked.\n\n> \n> this happens after the constraints test. This occures with/without my\n> patches. strange...\n\nWhat contraints test?\n\n> \n> o pg_database_mb.h, pg_class_mb.h, pg_attribute_mb.h are no longer\n> used, and shoud be removed.\n> \n> o GetDatabaseInfo() in utils/misc/database.c removed (actually in\n> #ifdef 0). seems nobody uses.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 19 Aug 1998 10:46:54 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: new MB patch and pg_type oid problem" }, { "msg_contents": ">> o these patches are made against the latest source tree (after Bruce's\n>> massive patch, I think) BTW, I noticed that after running regression,\n>> the oid field of pg_type seems disappeared.\n>> \n>> \tregression=> select oid from pg_type;\n>> \tERROR: attribute 'oid' not found\n>\n>I just tried:\n>\n>\tselect oid from pg_type;\n>\n>and it worked.\n>\n>> \n>> this happens after the constraints test. This occures with/without my\n>> patches. strange...\n>\n>What contraints test?\n\nThe constraints test in the regression test suite. Following step\nshould reproduce the problem.\n\n------------------------------------------------\n% cd src/test/regress\n% gmake all\n% createdb test\n% psql -c \"select count(oid) from pg_type\" test\ncount\n-----\n 106\n(1 row)\n% psql test < sql/constraints.sql \n% psql -c \"select count(oid) from pg_type\" test\nERROR: attribute 'oid' not found\n------------------------------------------------\n\nI found the problem while debugging pg_dump command. I ran the\nregression test, then tried to dump the regression database using\npg_dump that failed with an error message:\n\n\tgetTypes(): SELECT failed\n\nInspecting the regression test step by step, I found the \"no oid\nattribute problem\" had occured right after the constraints test.\n--\nTatsuo Ishii\[email protected]\n", "msg_date": "Thu, 20 Aug 1998 10:15:52 +0900", "msg_from": "[email protected]", "msg_from_op": false, "msg_subject": "Re: new MB patch and pg_type oid problem " }, { "msg_contents": "> >> o these patches are made against the latest source tree (after Bruce's\n> >> massive patch, I think) BTW, I noticed that after running regression,\n> >> the oid field of pg_type seems disappeared.\n> >> \n> >> \tregression=> select oid from pg_type;\n> >> \tERROR: attribute 'oid' not found\n> >\n> >I just tried:\n> >\n> >\tselect oid from pg_type;\n> >\n> >and it worked.\n> >\n> >> \n> >> this happens after the constraints test. This occures with/without my\n> >> patches. strange...\n> >\n> >What contraints test?\n> \n> The constraints test in the regression test suite. Following step\n> should reproduce the problem.\n> \n> ------------------------------------------------\n> % cd src/test/regress\n> % gmake all\n> % createdb test\n> % psql -c \"select count(oid) from pg_type\" test\n> count\n> -----\n> 106\n> (1 row)\n> % psql test < sql/constraints.sql \n> % psql -c \"select count(oid) from pg_type\" test\n> ERROR: attribute 'oid' not found\n> ------------------------------------------------\n> \n> I found the problem while debugging pg_dump command. I ran the\n> regression test, then tried to dump the regression database using\n> pg_dump that failed with an error message:\n> \n> \tgetTypes(): SELECT failed\n> \n> Inspecting the regression test step by step, I found the \"no oid\n> attribute problem\" had occured right after the constraints test.\n\nI see the following change to pg_attribute. I am researching why.\n\nThey are exactly the rows you say are missing.\n\n---------------------------------------------------------------------------\n\n*** /tmp/c\tThu Aug 20 11:43:41 1998\n--- /tmp/d\tThu Aug 20 11:44:10 1998\n***************\n*** 12,21 ****\n 1247\ttypoutput\t24\t0\t4\t12\t0\t-1\t-1\tt\tf\ti\tf\tf\n 1247\ttypreceive\t24\t0\t4\t13\t0\t-1\t-1\tt\tf\ti\tf\tf\n 1247\ttypsend\t24\t0\t4\t14\t0\t-1\t-1\tt\tf\ti\tf\tf\n- 1247\ttypalign\t18\t0\t1\t15\t0\t-1\t-1\tt\tf\tc\tf\tf\n- 1247\ttypdefault\t25\t0\t-1\t16\t0\t-1\t-1\tf\tf\ti\tf\tf\n- 1247\tctid\t27\t0\t6\t-1\t0\t-1\t-1\tf\tf\ti\tf\tf\n- 1247\toid\t26\t0\t4\t-2\t0\t-1\t-1\tt\tf\ti\tf\tf\n 1247\txmin\t28\t0\t4\t-3\t0\t-1\t-1\tf\tf\ti\tf\tf\n 1247\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n 1247\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n--- 12,17 ----\n***************\n*** 393,395 ****\n--- 389,503 ----\n 17184\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n 17184\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n 17184\tcmax\t29\t0\t4\t-6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143776\ti\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tf\tt\n+ 143776\tx\t25\t0\t-1\t2\t0\t-1\t-1\tf\tf\ti\tf\tt\n+ 143776\tf\t701\t0\t8\t3\t0\t-1\t-1\tf\tf\td\tf\tt\n+ 143776\tctid\t27\t0\t6\t-1\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143776\toid\t26\t0\t4\t-2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143776\txmin\t28\t0\t4\t-3\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143776\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143776\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143776\tcmax\t29\t0\t4\t-6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143795\tsequence_name\t19\t0\t32\t1\t0\t-1\t-1\tf\tf\td\tf\tf\n+ 143795\tlast_value\t23\t0\t4\t2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143795\tincrement_by\t23\t0\t4\t3\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143795\tmax_value\t23\t0\t4\t4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143795\tmin_value\t23\t0\t4\t5\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143795\tcache_value\t23\t0\t4\t6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143795\tis_cycled\t18\t0\t1\t7\t0\t-1\t-1\tt\tf\tc\tf\tf\n+ 143795\tis_called\t18\t0\t1\t8\t0\t-1\t-1\tt\tf\tc\tf\tf\n+ 143795\tctid\t27\t0\t6\t-1\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143795\toid\t26\t0\t4\t-2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143795\txmin\t28\t0\t4\t-3\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143795\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143795\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143795\tcmax\t29\t0\t4\t-6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143812\ti1\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tf\tt\n+ 143812\ti2\t23\t0\t4\t2\t0\t-1\t-1\tt\tf\ti\tf\tt\n+ 143812\tctid\t27\t0\t6\t-1\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143812\toid\t26\t0\t4\t-2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143812\txmin\t28\t0\t4\t-3\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143812\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143812\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143812\tcmax\t29\t0\t4\t-6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143828\tx\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143828\tctid\t27\t0\t6\t-1\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143828\toid\t26\t0\t4\t-2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143828\txmin\t28\t0\t4\t-3\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143828\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143828\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143828\tcmax\t29\t0\t4\t-6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143841\tsequence_name\t19\t0\t32\t1\t0\t-1\t-1\tf\tf\td\tf\tf\n+ 143841\tlast_value\t23\t0\t4\t2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143841\tincrement_by\t23\t0\t4\t3\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143841\tmax_value\t23\t0\t4\t4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143841\tmin_value\t23\t0\t4\t5\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143841\tcache_value\t23\t0\t4\t6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143841\tis_cycled\t18\t0\t1\t7\t0\t-1\t-1\tt\tf\tc\tf\tf\n+ 143841\tis_called\t18\t0\t1\t8\t0\t-1\t-1\tt\tf\tc\tf\tf\n+ 143841\tctid\t27\t0\t6\t-1\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143841\toid\t26\t0\t4\t-2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143841\txmin\t28\t0\t4\t-3\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143841\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143841\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143841\tcmax\t29\t0\t4\t-6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143858\tx\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143858\ty\t25\t0\t-1\t2\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143858\tz\t23\t0\t4\t3\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143858\tctid\t27\t0\t6\t-1\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143858\toid\t26\t0\t4\t-2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143858\txmin\t28\t0\t4\t-3\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143858\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143858\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143858\tcmax\t29\t0\t4\t-6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143872\tsequence_name\t19\t0\t32\t1\t0\t-1\t-1\tf\tf\td\tf\tf\n+ 143872\tlast_value\t23\t0\t4\t2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143872\tincrement_by\t23\t0\t4\t3\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143872\tmax_value\t23\t0\t4\t4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143872\tmin_value\t23\t0\t4\t5\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143872\tcache_value\t23\t0\t4\t6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143872\tis_cycled\t18\t0\t1\t7\t0\t-1\t-1\tt\tf\tc\tf\tf\n+ 143872\tis_called\t18\t0\t1\t8\t0\t-1\t-1\tt\tf\tc\tf\tf\n+ 143889\tx\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tf\tt\n+ 143889\ty\t25\t0\t-1\t2\t0\t-1\t-1\tf\tf\ti\tf\tt\n+ 143889\tz\t23\t0\t4\t3\t0\t-1\t-1\tt\tf\ti\tf\tt\n+ 143889\tctid\t27\t0\t6\t-1\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143889\toid\t26\t0\t4\t-2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143889\txmin\t28\t0\t4\t-3\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143889\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143889\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143889\tcmax\t29\t0\t4\t-6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143911\tsequence_name\t19\t0\t32\t1\t0\t-1\t-1\tf\tf\td\tf\tf\n+ 143911\tlast_value\t23\t0\t4\t2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143911\tincrement_by\t23\t0\t4\t3\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143911\tmax_value\t23\t0\t4\t4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143911\tmin_value\t23\t0\t4\t5\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143911\tcache_value\t23\t0\t4\t6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143911\tis_cycled\t18\t0\t1\t7\t0\t-1\t-1\tt\tf\tc\tf\tf\n+ 143911\tis_called\t18\t0\t1\t8\t0\t-1\t-1\tt\tf\tc\tf\tf\n+ 143911\tctid\t27\t0\t6\t-1\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143911\toid\t26\t0\t4\t-2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143911\txmin\t28\t0\t4\t-3\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143911\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143911\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143911\tcmax\t29\t0\t4\t-6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143928\txd\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143928\tyd\t25\t0\t-1\t2\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143928\tzd\t23\t0\t4\t3\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143946\tx\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143946\ty\t25\t0\t-1\t2\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143946\tz\t23\t0\t4\t3\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143946\tctid\t27\t0\t6\t-1\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143946\toid\t26\t0\t4\t-2\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143946\txmin\t28\t0\t4\t-3\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143946\tcmin\t29\t0\t4\t-4\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143946\txmax\t28\t0\t4\t-5\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143946\tcmax\t29\t0\t4\t-6\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143961\ti\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tt\tf\n+ 143961\tt\t25\t0\t-1\t2\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 143979\ti\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tt\tf\n+ 143979\tt\t25\t0\t-1\t2\t0\t-1\t-1\tf\tf\ti\tt\tf\n+ 143997\ti\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 143997\tt\t25\t0\t-1\t2\t0\t-1\t-1\tf\tf\ti\tf\tf\n+ 144017\ti\t23\t0\t4\t1\t0\t-1\t-1\tt\tf\ti\tf\tf\n+ 144017\tt\t25\t0\t-1\t2\t0\t-1\t-1\tf\tf\ti\tf\tf\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 20 Aug 1998 11:47:29 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: new MB patch and pg_type oid problem" }, { "msg_contents": "> >> o these patches are made against the latest source tree (after Bruce's\n> >> massive patch, I think) BTW, I noticed that after running regression,\n> >> the oid field of pg_type seems disappeared.\n> >> \n> >> \tregression=> select oid from pg_type;\n> >> \tERROR: attribute 'oid' not found\n> >\n> >I just tried:\n> >\n> >\tselect oid from pg_type;\n> >\n> >and it worked.\n> >\n> >> \n> >> this happens after the constraints test. This occures with/without my\n> >> patches. strange...\n> >\n> >What contraints test?\n> \n> The constraints test in the regression test suite. Following step\n> should reproduce the problem.\n> \n> ------------------------------------------------\n> % cd src/test/regress\n> % gmake all\n> % createdb test\n> % psql -c \"select count(oid) from pg_type\" test\n> count\n> -----\n> 106\n> (1 row)\n> % psql test < sql/constraints.sql \n> % psql -c \"select count(oid) from pg_type\" test\n> ERROR: attribute 'oid' not found\n> ------------------------------------------------\n> \n> I found the problem while debugging pg_dump command. I ran the\n> regression test, then tried to dump the regression database using\n> pg_dump that failed with an error message:\n> \n> \tgetTypes(): SELECT failed\n> \n> Inspecting the regression test step by step, I found the \"no oid\n> attribute problem\" had occured right after the constraints test.\n\nOK, I have fixed this problem in the code. I had messed up index\ndestruction badly.\n\nThe constraint regression test works now for me, while it did not\nbefore. Should be good.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 20 Aug 1998 19:06:07 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: new MB patch and pg_type oid problem" }, { "msg_contents": "Applied.\n\n\n> >>Multi-byte pg_class_mb.h and others had duplicate copies of the file in\n> >>them. I am committing a fix now.\n> >\n> >Thanks.\n> >\n> >>As far as I am concerned, if you want to just add the endcoding field to\n> >>various tables, go ahead. It is easier than maintaining two copies of\n> >>the files, and should make your job easier. \n> >\n> >Thanks again! If there's no objection, I will go ahead.\n> \n> Included patches are mainly for this purpose. \n> \n> o note that now pg_database has a new attribuite \"encoding\" even if\n> MULTIBYTE is not enabled. So be sure to run initdb.\n> \n> o these patches are made against the latest source tree (after Bruce's\n> massive patch, I think) BTW, I noticed that after running regression,\n> the oid field of pg_type seems disappeared.\n> \n> \tregression=> select oid from pg_type;\n> \tERROR: attribute 'oid' not found\n\nFixed earlier, thanks to your report.\n\n\n> \n> this happens after the constraints test. This occures with/without my\n> patches. strange...\n> \n> o pg_database_mb.h, pg_class_mb.h, pg_attribute_mb.h are no longer\n> used, and shoud be removed.\n> \n> o GetDatabaseInfo() in utils/misc/database.c removed (actually in\n> #ifdef 0). seems nobody uses.\n> \n> touched files are:\n> \n> Index: src/backend/bootstrap/Makefile\n> Index: src/backend/bootstrap/bootparse.y\n> Index: src/backend/bootstrap/bootscanner.l\n> Index: src/backend/catalog/Makefile\n> Index: src/backend/commands/copy.c\n> Index: src/backend/commands/dbcommands.c\n> Index: src/backend/commands/rename.c\n> Index: src/backend/parser/gram.y\n> Index: src/backend/storage/lmgr/Makefile\n> Index: src/backend/storage/lmgr/lmgr.c\n> Index: src/backend/storage/smgr/md.c\n> Index: src/backend/tcop/utility.c\n> Index: src/backend/utils/cache/Makefile\n> Index: src/backend/utils/cache/fcache.c\n> Index: src/backend/utils/init/postinit.c\n> Index: src/backend/utils/mb/conv.c\n> Index: src/backend/utils/mb/wchar.c\n> Index: src/backend/utils/misc/database.c\n> Index: src/bin/initdb/initdb.sh\n> Index: src/bin/pg_dump/pg_dumpall\n> Index: src/include/miscadmin.h\n> Index: src/include/catalog/pg_attribute.h\n> Index: src/include/catalog/pg_class.h\n> Index: src/include/catalog/pg_database.h\n> Index: src/include/commands/dbcommands.h\n> Index: src/include/mb/pg_wchar.h\n> Index: src/include/nodes/parsenodes.h\n> \n> ---------------------------------------------------------------------\n> begin 644 mb.patch.gz\n> M'XL(\"+N\"VC4``VUB+G!A=&-H`.P\\>U_;2))_BT_1>)@@@XSU\\`L8N\"6.DWA#\n> M@,-D=F>3K\"/+LE$B2QI)#F&3?/>KZH<>[email protected]?5K>J2_7JZJKNDOK>\n> MV/YP0*+0JH],ZYWMC>LCWX^C.#2#^G/SG3UQ7'OCZ-O_;5QV!P21'9#Z/`KK\n> MKF^9;MUZ'X7PN'HPC?YTZW=3H;S?\".TX=.SWCC<E(?Q$CN\\1;4]K;HR=R834\n> M+%(+L4D2PG=V=I*&I.WO=^IJNZZWB-HX,-0#K2W1T;5:;1&J4]?VB=H^,#H'\n> M6@O19/]1M+JN&\"JA34(<SW+G8YOL[=7A?X%K;^KZ(].%^_!_]_'IR9,!V3TB\n> MM?[>WD:-.).Q/2'/7YQ>]1_^<=6#'@8\"$%OR\\X?TN@J](`UGPG`X$_M/(F_)\n> MW6Y5(5/+JB9X$>W?/+]FAZ$?4H:`/KU-X*JVT;]+R7@5F&%D[]VN5\\\\90DI5\n> MK:LY5>LJR9*/:LFT<ZK4#U3M0#<DB@/E4P9XE\\X-36D80N>_\"*57\\CS0J[WK\n> M2@[$,F/3]:?U:[O\\7C`=FC.\\68.;2\\91#!^#E$;SV![.1F)D`9CEFE&4@MAN\n> M9)=2(##>025%)W!QZ\\P`^K.9Z8VC.G`0VK-%/)X_MJ,Z_5M\\BRHEN8^J`K$;\n> MG15-.;),S[/#/7?]QIR04NZY\\N:L,7-.61`&G?04^+!]B>(1)KT(NH(C4S..\n> M+%5&%/NA.;7K(V#ZW:*FQ$U_,BF[Y<3V+(C#;[;GE8VUT!A-R[*CJ`Z`WKS$\n> M%`&/ZT3QXDT^,IX'`&0)4P1A@>BI*18Z\"%UIZ,NRY+@F<\\]RT(#+9#89?T??\n> M\\`63_NX)?<>,#>V;$!1=#\\)(+[(3SGCTSKY-)-A1C$;I9!9$K3/T6*2A?/KJ\n> M^>FKKQIXZ*I$1W]=X-%0FHF-P?]/>F</G_6/R%Y]:GNC=\\Y>=(TWE@,,`#T]\n> M?WAR\"M##`<@$XPQS/`Y\">/X''KIPS24R4,@KP+3\\#XQF#\"`C,V)3%3O>FZ%C\n> MCB#LH:WHVAS[-W!=BF`:^O.``<.CRB!I\"(2V6_M*\\@L>GB7_'MI+1A?07@\"8\n> M\"]^*%')ZWOTN^@`R@M\"W&$'Q;<#YR+M3DG,*I8@<[]J&21VQ`=Q?41G9(1H^\n> M%U%LQN`U'>L.3'Y@AR:X-C;\"#[B;(=R9L5\\_$%><@S)LKNE-Y^`E&3A$\":4F\n> M@]BFT]\">FC&'=@)7L$.9N^=1W*UQ_0*;-BZIM(6+0>@$,1,$E0YXA1)<&=O]\n> M*DT7F-1]FLZHN<PJOU+'Q9B^6L>X%#04HUF^F#8;2BL)3+Y%R<6COT[)RZBJ\n> M&YO))&<)G[9'W;`_#RU8<[9DYJ&K>)7S8)B^2=$U]`^>GE]<#:HY6/A).O/#\n> MR#'9^@O1C\\73,N121X,A<QLS%2K:?W?9_;N(K2@:$:F,Y0>W>]9:@I$\\\":6Q\n> M2-/(Q2)-@W\":<2:QR^5\\N-&0Z$BTF`*8.U/A=A+I\"GMK\"7LKR`6!Y.G4#A?B\n> MP]^R@>\\Q*F%W.;S=S>\";C3!<O;&N38IJ5X2KNVA%O\\`XQ[-)?W#>O3HYE:TJ\n> MD67\\>WQ$MM7M*GGP@-#V;]!N;U>KF3&_GYR^Z+$1\\*=&X9&>(M9;FM)J\"[]$\n> M?:1%D\"*RTP497MKF^$1X8_EQ_[1'=B:!@LF92W:<R)N[KL+AQ[;KS*J'+([C\n> MK&P*E.]]9TP08X+M?!YG$#(4D&Z\")>00*C#K8N)$0S,,S5N*GJ.$?JGKS[WX\n> M:AZX=B1?VJZ)Y@^&Q\"X$+?:'V`X]PAYV,?'GL4+5W&HJ;4VH>7VLS[W(F7KV\n> M^*?+H,@<-%5M*9JJ:>EL@)8*77HR(R0D39(L1\"TA!9(T]L'LCHB:Z7)8NW`.\n> M4)`91*C>H6C9GN6/@7':D1.)%+W47R=P;P]S$Z48O4`&)&!X:\\<00SBV%P_%\n> M#;E*$48OM=<)F9FM28ZS>W[QQ_#BY*K[%-FJ[T#,2R`BB`G5\"BP9(;DQ(V(2\n> MS[YQ<>*!-YN#E$UR]N+TE\"1A#-FI%PM;4SN*IH%D^?R3I,_T+SQ'WD29TM5!\n> MDA),+YW=7:28R9[\"@9R/2._O5\\.3JZO3WAE,=XV/LB'RDGN7E^>7\"JDLF30`\n> MI@2\")J;Q-8E]G[@^+'`$V3D@OXXK\"KWT?&I(C+P,-4C+]BMUF][DW,L/4@#U\n> M-1WWF8DU,R%@>GP';P`X/RX8)#8G?DCD0R);0!W'4B6;G%+\".G9WJ90^)G*T\n> M4([T(4`U^?2)T([M5]XV-)A`9=[U:AN][V9\"1I7-$TTW0)OM9C)/OD\";Q78L\n> M@86J\"00TZ9QA5BU,>4C[9-%42%3-`M=JO`5\"D=\\>J8=O?V,3[RU(`*1'[Q%D\n> MEL`\\L>1)((;C#CV1)[8_P<ZJZ\"3\"RF4T\\A2XF\"L)A9\"97/]6-ELL=,:>3!,/\n> MZC1B?QC9(203LIQS3#O5!*N\"5H5J2'JJU2KS*FRGJG1R9&3SI;-D<>&@-`Y7\n> MG#6[2=B:1Y/^XS/G<'&\"?95'QPYG%=?-'LI,G',$\\F>:D!=8Y#+/]3*QK[H\"\n> M,/5D'YM#M@K!PMFL-#4YB>`^<\"@7M%SHJ*K\"4^$I&T54S=K3JCXN._>^D[,K\n> M7LH:.CB_1B<3-VC[FJ+IJI'Z0_!\"P1R<#&)5\"'4UA+D(YBU+O\"#EU0'?Y7#?\n> MY61\\%\\.X(W.6G2I'O\"LP\"HD)2&$]'\"H5SV<Q!^]*GL8C<;GF%\"I+R!<<,>;H\n> M1\\UE.PJ2JE9ZR%@*R5*K=J%A-`REL;^07]\"(&+*E8/C>M.;SF<Q]U2@PX^O$\n> M<XT\\<V:+^)5[0RNT(<L?C^0L3#H\"QR=!P;DSQLAT-'3&\"K>^.<QN:!Y2=AAE\n> M^?#_AU+&W+#P!BO16231?579;Z<1HR0>Q0<I)$-?&M1N@H\\+P/#CB3R:3V!Q\n> M=3R`CY$D/[N#3&2X8@CA8CPRZ2\\5;`612%*%O#?=N1T1^=7VKQ%.9/@=\\U]H\n> M5P\\K@H8,46#70F(2NL@/MC7\\<VZ'MT@.#Q)1*\\A=)^,Q?CAWJ7?^$C[OY3=%\n> MRSBG6T-W,7^7TPEMQ+YFAR.(*#]!:N1/D!HDH1OM5C26G4Q3E^AHU'\\AU%T.\n> M!LL8M*53RM_FL>-&=?N#Y?#=F,5;,^M#O'@G<XK(]@R/[SFB_*WPB/*XZ(AR\n> M\"53`+1Y1_N8',627_[+#[email protected]\"A&$=@!W)<Q.<9F<.-YX:+JNV/KT\n> MPPBS3YK2>LC&V?EPT.N^N.Q?_9&4(Y17UM#RA;`^#<W9>BIJ<@246)Z^IV?W\n> M\"[%).,5H(.PRM:<.4=6#1N>@V93H2)3\"(HRP.;WDU!*C'?C33J,=T97XKC3N\n> MD%C,M=7\"^(PF3:([G^[\\K7_UE/3.NN>/^F=/(%PGGA^3:!X$?@@K2T6D6I+D\n> MU8XS\\:V:<X448&L+^N4S'VQEI^KQ(`OBFV)>FDAX,\\=+TX\"NEIJ-W/\"I;!TC\n> MC(O#=*,D>PI80.$3.[ZR9X$+\"V2O./S^)JX*[%9LQ;JS:;C6X_=\"0DH]:\"?G\n> M0#NKGL`W\\`2^<\\\\!O%[L/C50?DGEWVK%?_6OK?\\[?_C7`2@4);.'*;SU#GYF\n> M<S=VX)>Z7Y]$(\"!XNB].@H!:K=Q;Y81-\\:YEQ2P@HWS-;.?7S#;A=*-NV.7B\n> M>JDS?<-(E$@!S%WJ;FA*4\\O46RQ7T%@L0\"JKW>&_/[5Z9V.Y@&=FSPIK>))\"\n> MK_D$!</+=(#KQOUF$Z&^9N/U&DU\"1*G)&*V<R1@M0FE&[>)%:@H:T<`.('!J\n> M2G042B(/D1A+I]!8FJV.TNSH::X!\\4A#DOP;SPZ9^V6Y\"V8JV**[1+AS%,^\"\n> M\"U@H#HM,A.-!.`#K)9M$67V7#(-UY-*\\><1C^;XW\\>7Q\"-)YA3R@-,$ORQ!8\n> MMO4@@[]ZF!A>[4LQ50\\7C)%O8HYQ/1^/G'%V[_+QR=7)*2SFL_'(A5CL)HP/\n> M\"\":5_@1`R:^16-=_G=.L@3Z3XF!)*15Y^XZBO)9F*\"V]\\TTZ^7^U?*E:6FI;\n> M:6G-4A<26WY0Q[S\"B==TM)ZGH-1Y-/*O%S2:)*4:S2MI)4Y\"A2BC>:#!JM.1\n> MZ'B4QS+8O;ZD\"8;=ZF26'@S>=H*(%N;,(SPP8)GFE8GQ7Z5[V3NYZCUZ6!&!\n> M7O=IK_MLV'\\\\/'EX?@EWY&JI?P&S%]LQ43R+,7!EZ;EH,4MD+;O8%E?\"D;?!\n> M9\"=3&L'0=X<B:F&\\E]>)LH34,JUK>ZW!:A$=WSM6;396B56+;6CML2K$*50Z\n> M$)DZWGO(RWT\\:&=_Q8WH-A*7;N9ZPB]6BV2SFN`CU^)5BNCX@E>7$M)1>Z*Q\n> M&,\\:!^I^^NI2(10SBOU\"H\\!7EPJJU#,A)2LL+\"U%9SL]I;?32LVUU*OS#1#Z\n> M$X<VDB'V>J;8X:)3DJMBDT<,8XH;S1U(I[RE*)G=Y:(6I>PPN<K?2V$C',\\!\n> M*_&C&\"_6:9$+A)3'ROE\",L,@&>K1>M+F<MRLXX)GL`VB(KA[#+/55MJM+TFU\n> M5K.L7*5Z7JT+!67I:G8G(HZE,-ERG5'P9YW^%7:\";!GE\\6G'4/:-HO.>/DCO\n> M!9BR,Y:QO5\"8Q,Y)>A\\\"\"`!$_(?A*C].X5O^A<L]QT`?4A!`I@CH^4N#[/!0\n> M$N)D/)FAN_4,*#VDV2D,\"K[ODY;B5RZM_D7WF7U++L#BIJ$=]0,+FDDLT5&5\n> MSAWI@:9W%\"U]K6\\I.TC2`<HK#Y9FMRCJE\\]/_G[QY.+DZBG9)=KKLN`J>X:U\n> M%($/[%B(Y`S]TEUZ*XKVF?\"28/_Y;7(71,?(A.[BB.WKT\"UG$;1<!U36CWXW\n> M7;#6[*@JRRDR*05?S#5%,]1[O\"=,3\\OWWJ_3;R8DE\"_B^36<<(IW:.$M7J8A\n> M78/`VFUH!TT\\(]9XW6T&Y'X7:;3V%:/=S%3>0D=#;:6UWC/'TK&2T9/A2B&!\n> M@F4_\"CGM#ON#\\TZGN3]LIA5FNZ2^@X4M.^1DT.WW$<LQ>=[OTKXZ_,WZ(S.R\n> M'$<'K/)\"'8V[5%D3,*?`2S!8[0QV6-HAJPLAY.8:5$%D6G!%CHE*RW,M#8LS\n> MW-W=:C6IN-D)=G=Q&QON/2#JA_:$;H0C`[OT;J8XZ3-#+G@\"1AA'E+E\"GE!:\n> ME*]%GJCPOH6K!9X`7X8G6E&B(0CRDRDNHD>R#_WI/.K\"(^4'E(P'`6<9F*8O\n> ME)\"/#!K\"FNC:G[MC,K*Y!BF')\"LX1AU))%8F-Y(KQ$&[',8CE[Y.PJ]?8B$8\n> MH_7CX+]/A_2)\"JDDUQ6%J$IJ)THJWL\\*QF``6#_A5\")!'WLONL._7@`*=L'&\n> MVW-K^#9($;`VP\\#@<N.[9WQ\\]RP=;WGY\\9:7CN^>Y<8_N^3CGUVFX]^%^?'O\n> MPG3\\LTL<?Y?38@'%>KT6IV%EMR5H1B_#KPL<5SMQ7'F8%3R7UH*T(U,ES3IT\n> MX;EX+9\\(QX3M\\0:^G)<U/U\"3^EEA2D2SG5M@,0SVQHFOA]3GB1NLJBP/#@92\n> M#&YY1>!@#\\7@[\\($O)!KO:T8AI&^QO21)[email protected].$@$_;D!M49CW7%/%\n> MX3N\\AG'?VNU$5CV)F-<Y%_*$E$^(_\"F!UB(9ZE&7:7,Y(==QDT9C)P8E<'=.\n> M#E4Q6IFIH<*:OOPZS2HI:K*!0N]^[0LUV9'J!EUHGJ2!*HT4,:Z#-?9B[KH)\n> MQ[`:0IH]8R]43$)_EGO3E@XHJ>M7=453V]E7*%I8YR]DL)'6`S\\^.1WT:``C\n> M%5'%%L!L>,K6;K@HS95$&5PA9>VFHG62`T#@N';//\\YF4N?V'?*>#5[XQE\\=\n> M&4W&F==&<$),7',:L8UW#?(=K9,&A.L@>#$E7)7^(@7H+?R232-3O@<LS6S3\n> MB_`H8FK',<YC,\\9M1-QNI/7NT9X`K;.+>!X,QR,,(Q^#@0XS9EDE3WI7@ZO+\n> M%]TK&:!$X1DO08GBT)H%/\"UB2&K'O\")N#U%4L>97Y0<G'\\4F/94(/`U&U([C\n> MH2_.EB0LF_:LX%9F8OK]Y/(1)$7R`SF#FZJ\\*E)-29(!:M#_1Z\\(BM00Q]-'\n> MEX-_5$5ML+1#L4-.NN+`S\"LI',/4CWV\"+V`DY<9TPZO55O1]+5/C\\N-5L>2^\n> M:*4AS'QX7))5,U\\3\\XJ9U`$S8##OJVN''EC%U^#T`)\\Y=V.Z(\\BO*]A(H-DQ\n> M1NK5^#%+B@Y8V5RPD(IXNE91[K*3368G]`>3_Z4R'S$XD[)O,A5LYLY-_O.L\n> ML^R-'VDG4P6U*+[%%]6*K3L;Q3@>W2P=C_@/?E#C9P8O!<\\O/YS,QRR-%DEI\n> M1N>9M-)(I$&TUH':/&AJ$AV/$[L`3`0LAE8<L\"R__YN\\M?#+THK#3Y:>/SH[\n> M>=X[>H.3\"DV4;*EO0#V).ON/CE0&FG0=#8?)]7\"X03/GEX34/%+92FY4R.M#\n> MF-E>\":4-Q>@TLA\\2L*UKGU1.QM1DDGF;SO=\\!?3>WEZ%496.]0-(\\#,P%4CE\n> MZ_$LJ#/7L;>U!;.5)_HO2>U?A=3\"M&;8>.FUG)*R=7$^N'IRV1L,!R\\N>I<O\n> M^H]2.JOPL)*GT8V]+T.[E9'^2L^8.%P2O[\"G1-?^31%T5ER6ZX-8\\_(J&,!-\n> MJ0GZTM(-K9^JKQ\\CN1\\FL`6_A0/F`,-_3??G?@:MD((OR+<R9./,39O)1H2Z\n> M3S<BF@?&?IIO+<'=[[X:':69N(3>V:,-(?BMCP\\'GZG]!,`6J<'_)Z3V)ZG%\n> MGT@<DNU/VP3_^T2FH1V0VGNR_<_42+#_%1@2VP0$/8T)KI\\/3P8]\\NCABT'O\n> M$BP%>_#(`!XQQK-M*;$L!#BJO*&$O*K0#V;`BFR[MA7C6Q+48[(OIS#R^0SY\n> MN>0GU=;?RD>16IHMI94IGKNYMD,;AT`\\20.6+4'&(2+^Q%$S5CF?Z4Q\\@V*0\n> M,G*Q?,]#&HIF-:*MI*YS,0+<$H(X+$.:0\"PA96^PH(62K8_:;F7K+Y7/*3@_\n> M/WD)Z/ZK`NN:353RFA>V*:W]--9>@S!0'D\";J.HAM6O;#3Y1TTDBKN/ZV'Y?\n> MQT\\[(+18UTK$B#M1R=\"C[3>9#6>R)2SKS79.W*@3OJRMH!R`@@6*97`_7$L9\n> M[RL^WX2;3>9XYGA[/S5H+'A\\^0E__@U'0R59HG$:9MK+9_P&?D358.\\W%@(F\n> MKE<OWE#16DKF`PZYT^SLW@S/1O$;$AXIW,G#-.S_\\/DVQXV;)(N[7*5X<[A6\n> M+15(P/E+R*@??6EW=_$#9?FOCJW#V(LI*;?[_,MV1F/APVDBYLAT%5@_QAU&\n> M0\\0=A;#)!\"A^H:\"M:.EY`-]3Q&\\6A,[T&F).JTH`4T,AE_;4]F*ZM8+;%B\\\\\n> MAWZ=+;[%GJ[I.A,_]!R38=E$+%O]\\0%9E`;EG!0P0F;^[*UC>K@O2K8RQ)R=\n> M7_4&]%(B]-')AR4)^V(6C0UP,\\6)J+X(V!4\"X:?@[(C@=[RH@\"BGR0[C#^64\n> MUO8P9I=Y;6@_EM<B+>MZ0]'3#^NRW2^ZF\\*3BW,(IHY@&9$)>$.=\\%T;29+0\n> M?@@FR@B-W_H@1(.>FH;_3^`_!_^R_92[$8Y')N#3#>@D#4\"C)VAB0!$)-)OW\n> MH$'_@'B:;#@AQE>08\\6TR%[2VTA-B^#H+\\?B<R0MSE(MS])J2#[`@D6Q=`26\n> M$H;HGB?58YJ._F_5HUB^<HB,[V00C?\\0@[A[.>1EJ6M>\"CD5Y1^XR'^U&%;Z\n> M#.E\\\">3-Y>6O0;^@KXOE;PEN[4M?PCWEM&`I,%9;\"MZ\\H9^Y9)^$V][&LX.1\n> MS20)Z9)EC\\GHE@'1)VYO[Q%BS<,0R'9O?]+BEU9,4W9SB[RNPPH/L?K/X+8P\n> MRC=4X#^)\\A_U!MU+N5(IF8DP\"S68C,F7E4FGC><L%T]PGTVE_X%TP$$9A#>&\n> MF'$.\"9_:*?8BUT7GN)S[ZC/I=`KPA_?C+Z&^P?&+[TB3?;60?OT^_#0\"Y[+C\n> MQO,_W5U+<]HP$#Z;7[''/I(.?@\"F.3E`$@=C.L%ICPR3TB8S!#/!F22'_O=J\n> M];`DO&Z=F32T/5KSR9;7^J3=U>[Z7Y%=L&_9_7IUUL';>UZ@]4#JJ[G:Q5SM\n> M>N5JD=8MN/ZB;Y1Q'\\-1_,['-J_L6GI'+>1?LE*;8L!7!N(E_@<3Q<H^$/M2\n> MN5#+3$',YWE]\"\\4/C)]5\\+-A#$!'_X`CE5@5I!$XCM!\">4.Q?\"QX`ZJ!1_PL\n> M_G-T$4?'R0B8FGN:G<%)/$J&0E7^`7C*CW<U3_IY3BUW[I#!*(ZS&QH`5SG;\n> M;K:;?(VOFL,\"-CFO]2(N\"BSFRMV+LC\\*2H0BX0<R;Z2VN0_BM(D+03ZXJ1#>\n> MJP9]R/QB<MFW4*B9@L<-/;T:.,Y5?KMA,^T.H]>WQ0*)@<$4QAU;9.112\\5.\n> MJ+K+*3/@M^8KH1KNMW1AYFA];[WRO+2OW-^@I-%D/(Q\"\"5/&%\\[NEDKJ$9$-\n> M^`4_G<Z5#WA^QAV.\\OC%\"+#ZT_((7DL>VD;T&XDM:\"(P:E<F*O+M9U>F!E(?\n> M;&''6H`U^G=V8<#KW3Q>^?>Q8+<N8/,MV>T?>'W;GZ0^T2P^'<=),HQ&DVGJ\n> M.NPR&UU,6G4%\"$RO]?.K\\-7YOYM4&J0<W+SSU^6VN,N?=GK;!<+U)!L>#Z:3\n> M290.9YJ4*)YJN8'R8,0,=-W+R8PY@'KCW+;-P1BSU/KD)3&]>-U)I?+9L\";Z\n> MGM>KI@1O9$9=)6U2G_N8N;5JA=`58\\4T-183F;_1EKD4O.?Y8K-8+[=+>RF4\n> MF1JNB1Q<W]#`\\05X)G\"<L\\FXMDF\"N.P+^\"8N6]P\\\")R^WV4:#Z;#$00(9(K>\n> M%9;/NLQ.#D,;QQ@UFL<I8UH:)=!!].1^A3'0H@0=\\(Y6ER3*XM2%+F+CV?00\n> MT[$@P8A\\<`FD!ST\"Z1%('T(\"Z1/(`/H$,B\"03\"-O$]`.`>V\"ZQ+0+@'M,9./\n> M@/8(:,@L80(:$M`^N`$![8L9P&?H:I4_L#FYA<4=UX)`E#?6)]GY>O6TLZR>\n> MQS/P/;[DS*YOOA6`#6)*\"^/!\"ZM1^B]/FC*_2O\"&9U&I9*\\*M=S&U/*:4LMO\n> M2*V@*;4ZSZ)6]QG4H@A#4XLB#$TMBC`TM4C\"U'\"+(DP-MRC\"U'\"+(DP-MRC\"\n> MU'\"K\\[K<(O;OZK]!][&)5T=1[\\*QM<5.`-;@^6YN-.B-NHW>#Z_+-FJ'WX5O\n> MZ\"2RW-+IVB]!V#X(PE)C=+`,9+9@RCU6][!3VX6V=224*S.L4H;:B-!]`RY-\n> M7(2CS'B^#Q:&4EWK(C-4P:S2<):/E!'YJKFE@LL9]`U;&IE@OR\\?#07JK7Q\"\n> B^2,`&$CM<U;<%CIT9-?@DF:7,.)0/+*@S$^A@^G/\"'L``)E@\n> `\n> end\n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 23 Aug 1998 21:13:40 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: new MB patch and pg_type oid problem" }, { "msg_contents": ">Applied.\n\nThanks. But patches for src/backend/catalog/Makefile seems missing in\nthe current source tree. Please apply attached patches.\n\nIt also includes some corrections to src/backend/util/mb/wchar.c.\n--\nTatsuo Ishii\[email protected]\n\n----------------------------------------------------------------\nIndex: backend/catalog/Makefile\n===================================================================\nRCS file: /usr/local/cvsroot/pgsql/src/backend/catalog/Makefile,v\nretrieving revision 1.12\ndiff -c -r1.12 Makefile\n*** Makefile\t1998/07/26 04:30:20\t1.12\n--- Makefile\t1998/08/25 03:59:43\n***************\n*** 24,52 ****\n \n GENBKI= ./genbki.sh\n \n- ifdef MULTIBYTE\n GLOBALBKI_SRCS= $(addprefix ../../include/catalog/, \\\n- pg_database_mb.h pg_variable.h pg_shadow.h \\\n- pg_group.h pg_log.h \\\n- )\n- else\n- GLOBALBKI_SRCS= $(addprefix ../../include/catalog/, \\\n pg_database.h pg_variable.h pg_shadow.h \\\n pg_group.h pg_log.h \\\n )\n- endif\n \n- ifdef MULTIBYTE\n LOCALBKI_SRCS= $(addprefix ../../include/catalog/, \\\n- pg_proc.h pg_type.h pg_attribute_mb.h pg_class_mb.h \\\n- pg_inherits.h pg_index.h pg_version.h pg_statistic.h \\\n- pg_operator.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \\\n- pg_language.h pg_parg.h \\\n- pg_aggregate.h pg_ipl.h pg_inheritproc.h \\\n- pg_rewrite.h pg_listener.h pg_description.h indexing.h \\\n- )\n- else\n- LOCALBKI_SRCS= $(addprefix ../../include/catalog/, \\\n pg_proc.h pg_type.h pg_attribute.h pg_class.h \\\n pg_inherits.h pg_index.h pg_version.h pg_statistic.h \\\n pg_operator.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \\\n--- 24,35 ----\n***************\n*** 54,60 ****\n pg_aggregate.h pg_ipl.h pg_inheritproc.h \\\n pg_rewrite.h pg_listener.h pg_description.h indexing.h \\\n )\n! endif\n global1.bki.source: $(GENBKI) $(GLOBALBKI_SRCS)\n \tsh $(SHOPTS) $(GENBKI) $(BKIOPTS) $(GLOBALBKI_SRCS) > $@ 2>global1.description\n \n--- 37,43 ----\n pg_aggregate.h pg_ipl.h pg_inheritproc.h \\\n pg_rewrite.h pg_listener.h pg_description.h indexing.h \\\n )\n! \n global1.bki.source: $(GENBKI) $(GLOBALBKI_SRCS)\n \tsh $(SHOPTS) $(GENBKI) $(BKIOPTS) $(GLOBALBKI_SRCS) > $@ 2>global1.description\n \nIndex: backend/utils/mb/wchar.c\n===================================================================\nRCS file: /usr/local/cvsroot/pgsql/src/backend/utils/mb/wchar.c,v\nretrieving revision 1.2\ndiff -c -r1.2 wchar.c\n*** wchar.c\t1998/08/24 01:14:01\t1.2\n--- wchar.c\t1998/08/25 04:00:20\n***************\n*** 13,18 ****\n--- 13,41 ----\n * supported in the client, you don't need to define \n * mb2wchar_with_len() function (SJIS is the case).\n */\n+ \n+ /*\n+ * SQL/ASCII\n+ */\n+ static void pg_ascii2wchar_with_len\n+ (const unsigned char *from, pg_wchar *to, int len)\n+ {\n+ while (*from && len > 0) {\n+ *to++ = *from++;\n+ len--;\n+ }\n+ *to = 0;\n+ }\n+ \n+ static int pg_ascii_mblen(const unsigned char *s)\n+ {\n+ return(1);\n+ }\n+ \n+ /*\n+ * EUC\n+ */\n+ \n static void pg_euc2wchar_with_len\n (const unsigned char *from, pg_wchar *to, int len)\n {\n***************\n*** 316,322 ****\n }\n \n pg_wchar_tbl pg_wchar_table[] = {\n! {0, 0},\n {pg_eucjp2wchar_with_len, pg_eucjp_mblen},\n {pg_euccn2wchar_with_len, pg_euccn_mblen},\n {pg_euckr2wchar_with_len, pg_euckr_mblen},\n--- 339,345 ----\n }\n \n pg_wchar_tbl pg_wchar_table[] = {\n! {pg_ascii2wchar_with_len, pg_ascii_mblen},\n {pg_eucjp2wchar_with_len, pg_eucjp_mblen},\n {pg_euccn2wchar_with_len, pg_euccn_mblen},\n {pg_euckr2wchar_with_len, pg_euckr_mblen},\n", "msg_date": "Tue, 25 Aug 1998 13:15:32 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: new MB patch and pg_type oid problem " }, { "msg_contents": "> >Applied.\n> \n> Thanks. But patches for src/backend/catalog/Makefile seems missing in\n> the current source tree. Please apply attached patches.\n> \n> It also includes some corrections to src/backend/util/mb/wchar.c.\n> --\n> Tatsuo Ishii\n> [email protected]\n\nDone.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 25 Aug 1998 00:19:29 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: new MB patch and pg_type oid problem" } ]
[ { "msg_contents": "I was wondering if the user GROUPS would be fixed for 6.4\nIt seems like an easy fix and a very useful one at that. If it's fixed\nin the current CVS please let me know.\n\t\t-DEJ\n", "msg_date": "Wed, 5 Aug 1998 10:43:01 -0500", "msg_from": "\"Jackson, DeJuan\" <[email protected]>", "msg_from_op": true, "msg_subject": "Don't forget about Groups" }, { "msg_contents": "> I was wondering if the user GROUPS would be fixed for 6.4\n> It seems like an easy fix and a very useful one at that. If it's fixed\n> in the current CVS please let me know.\n> \t\t-DEJ\n> \n> \n\nI have several e-mail messages in my mailbox describing the issues, but\nno one has dealt with them.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 12:55:54 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Don't forget about Groups" } ]
[ { "msg_contents": "> a couple of days ago, the problem you have seen was caused\n> by a re-naming of the libpq.so shared library (if my memory\n> doesn't fool me, from libpq.so.1.1 to libpq.so.1). Due\n> to an old link to the former name, the new shared lib was not\n> found; removing the link and installing a proper one to the\n> new library solved the curse...\n\nOK, all entries in the lib directory refer to libpq.so.1 . So where is\nthe \"old link\" you are referring to? Do I need to rerun ldconfig??\n\n - Tom\n", "msg_date": "Wed, 05 Aug 1998 15:49:54 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Broken source tree" }, { "msg_contents": "On Wed, 5 Aug 1998, Thomas G. Lockhart wrote:\n\n> > a couple of days ago, the problem you have seen was caused\n> > by a re-naming of the libpq.so shared library (if my memory\n> > doesn't fool me, from libpq.so.1.1 to libpq.so.1). Due\n> > to an old link to the former name, the new shared lib was not\n> > found; removing the link and installing a proper one to the\n> > new library solved the curse...\n> \n> OK, all entries in the lib directory refer to libpq.so.1 . So where is\n> the \"old link\" you are referring to? Do I need to rerun ldconfig??\n\nI had this Monday evening. I ran ldconfig (with the /usr/local/pgsql/lib\ndirectory in /etc/ld.so.conf), and initdb ran - but it's still failing\nabout half way through :-(\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Wed, 5 Aug 1998 18:56:01 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Broken source tree" } ]
[ { "msg_contents": "Is the following legal:\n\nif (<condition>) {\n exec sql declare cur cursor for\n select name, nr from table where nr < 10;\n}\nelse {\n exec sql declare cur cursor for\n select name, nr from table where nr >= 10;\n}\n\n\nThat is declaring one cursor in two different ways? Oracle cannot do that.\nWe can, though. Shall I disable this (and remove my last changes) or is this\na good feature (as I think it is) and we keep it? Only disadvantage is that\nthe declare tarnslates into a C statement and is not really a declaration\nanymore.\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Wed, 5 Aug 1998 21:18:40 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Declare Cursor question again" }, { "msg_contents": "> Shall I disable this (and remove my last changes) or is this\n> a good feature (as I think it is) and we keep it? Only disadvantage is \n> that the declare tarnslates into a C statement and is not really a \n> declaration anymore.\n\nOn my Ingres box, the \"declare cursor\" statements could appear up in or\nnear the declarations portion of the program or routine. Wouldn't\nassociating this statement with executable code put limitations on\nstatement location which other systems (and perhaps the standard) do not\nsee?\n\n - Tom\n", "msg_date": "Thu, 06 Aug 1998 06:17:18 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Declare Cursor question again" }, { "msg_contents": "On Thu, Aug 06, 1998 at 06:17:18AM +0000, Thomas G. Lockhart wrote:\n> On my Ingres box, the \"declare cursor\" statements could appear up in or\n> near the declarations portion of the program or routine. Wouldn't\n> associating this statement with executable code put limitations on\n> statement location which other systems (and perhaps the standard) do not\n> see?\n\nYes. In Oracle you can put it outside a function. \n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Thu, 6 Aug 1998 22:11:11 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Declare Cursor question again" } ]
[ { "msg_contents": "> > I was wondering if the user GROUPS would be fixed for 6.4\n> > It seems like an easy fix and a very useful one at that. If it's\n> fixed\n> > in the current CVS please let me know.\n> > \t\t-DEJ\n> \n> I have several e-mail messages in my mailbox describing the issues,\n> but\n> no one has dealt with them.\nMy understanding of the issue is that almost everything relating to\ngroups is already taken care of. The only thing missing is a way to\ncreate group, which to me means a simple addition to the parser. If\nanyone wants to point me to the right places (example, etc.) I'll put\ntogether the patch. But if there's more to the story I'd rather leave\nit to the pro's.\n\t-DEJ\n\n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania\n> 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 14:56:58 -0500", "msg_from": "\"Jackson, DeJuan\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] Don't forget about Groups" } ]
[ { "msg_contents": "> > \"Thomas G. Lockhart\" <[email protected]> writes:\n> > > The parser is converting this query to become\n> > > select x from f8 where x = float8(500);\n> > \n> > > The problem appears to be that the optimizer/executor does not\n> know how\n> > > to evaluate the constant string once-only, and insists on doing a\n> > > sequential scan for some reason.\n> > \n> > Ah, it's finally starting to make some sense to me. What you're\n> saying\n> > is that this is a failure to do constant-folding.\n> \n> \n> Yep. I believe it happens in the executor, but doesn't appear to\n> happen\n> in the optimizer at a time when it would be useful. You can create\n> functional indexes, and I think they are matched by the function, just\n> not constants.\n> \n> > \n> > Doing a sequential scan would be appropriate if the righthand side\n> of\n> > the comparison needed to be evaluated afresh at each row. If the\n> > optimizer thinks that, then that explains a lot.\n> \n> \n> Yep. I think that is the issue, and index matching does not\n> pre-evaluate a function on a constant.\n> \n> > \n> > The question then is why the righthand side doesn't look like a\n> > constant. I'd have expected that any expression not involving a\n> table\n> > attribute would be evaluated once (folded into a constant) before\n> any\n> > decisions are made on how to perform the scan. Is that reasonable,\n> or\n> > is there some aspect of SQL semantics that makes it wrong?\n> > \n> > If it is supposed to be happening, could it be that float8() is for\n> > some reason not marked as a safely foldable function?\n> > \n> > While I'm asking dumb questions: are \"float8(500)\" and \"500::float8\"\n> > treated differently? Actually, I can see that they are:\n> > \n> > \tplay=> explain select x from f8 where x = 500::float8;\n> > \tNOTICE: QUERY PLAN:\n> > \tIndex Scan using f8_i on f8 (cost=2.05 size=1 width=8)\n> > \n> > \tplay=> explain select x from f8 where x = float8(500);\n> > \tNOTICE: QUERY PLAN:\n> > \tSeq Scan on f8 (cost=40.00 size=100 width=8)\n> > \n> > But why? Is there a difference in semantics?\n> \n> Sure. In the :: case (or CAST (const AS type)), the parser actually\n> converts the type INSIDE the parser to the proper type. In the\n> float8()\n> case, the value conversion is delayed until the executor.\n> \n> I may be wrong in some of this, but that is what I think is happening.\n> \nThis would be logical to me because we allow function creation.\nConsider, if someone creates an SQL function on a table being updated\nthat returns a count of all rows who's index matches an int. Which\nwould mean that an insert using that function to select rows could need\nto be evaluated for each row.\nWell, I guess what I'm trying to say is that the current behavior could\nbe desired/being used by someone. It could also be used as a substitute\nfor a select trigger.\nOf course as always I could be completely wrong.\n\t\t-DEJ\n\n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania\n> 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 15:17:27 -0500", "msg_from": "\"Jackson, DeJuan\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] indexes and floats" }, { "msg_contents": "> This would be logical to me because we allow function creation.\n> Consider, if someone creates an SQL function on a table being updated\n> that returns a count of all rows who's index matches an int. Which\n> would mean that an insert using that function to select rows could \n> need to be evaluated for each row.\n> Well, I guess what I'm trying to say is that the current behavior \n> could be desired/being used by someone.\n\nAs you point out, the current behavior allows functions with\nside-effects to work, where if we change it then functions must be\nside-effect-free. Most functions do not have side effects, though one\nusing the SPI interface for example might be prone to them.\n\nWe _could_ add a column attribute for each function which declares a\nfunction as being \"safe\" or not.\n\n - Tom\n", "msg_date": "Thu, 06 Aug 1998 05:59:48 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] indexes and floats" } ]
[ { "msg_contents": "\nI've just run CVS UPDATE again, in another attempt to get initdb to run.\nAnyhow, I noticed that there was a message saying that there were\nconflicts. Any ideas?\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Wed, 5 Aug 1998 22:14:55 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": true, "msg_subject": "CVS and the backend" }, { "msg_contents": "> \n> I've just run CVS UPDATE again, in another attempt to get initdb to run.\n> Anyhow, I noticed that there was a message saying that there were\n> conflicts. Any ideas?\n> \n\nConflicts between your cvs tree and the current tree, meaning you\ncommitted stuff and it could not merge the changes into your tree?\n\nI use this script to remove changed files in my distribution.\n\n\t:\n\tcd /pgcvs &&\n\tpn pgcvs -qn update pgsql | grep '^M ' | cut -d' ' -f2 | xargs rm\n\tpgupdate\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 17:41:20 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS and the backend" }, { "msg_contents": "Peter T Mount <[email protected]> writes:\n> I've just run CVS UPDATE again, in another attempt to get initdb to run.\n> Anyhow, I noticed that there was a message saying that there were\n> conflicts. Any ideas?\n\nThat means CVS got confused about how to update your local file.\nTypically, it means that the file now on your disk is broken ---\nit will have both versions of the conflicting text. CVS is expecting\nyou to sort it out, which would be the right thing if the difference\ninvolved a change that you needed to commit to the source tree.\n\nIf the conflict is in a file that you have not got interesting private\nchanges in, the best thing is just to delete the local copy of that file\nand do cvs update again to fetch a clean copy.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 05 Aug 1998 21:37:35 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS and the backend " }, { "msg_contents": ">I've just run CVS UPDATE again, in another attempt to get initdb to run.\n>Anyhow, I noticed that there was a message saying that there were\n>conflicts. Any ideas?\n\ninitdb no more exists, instead initdb.sh added. Does this have any\nrelation to the confilicts?\n--\nTatsuo Ishii\[email protected]\n", "msg_date": "Thu, 06 Aug 1998 13:45:28 +0900", "msg_from": "[email protected]", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS and the backend " }, { "msg_contents": "On Wed, 5 Aug 1998, Bruce Momjian wrote:\n\n> > \n> > I've just run CVS UPDATE again, in another attempt to get initdb to run.\n> > Anyhow, I noticed that there was a message saying that there were\n> > conflicts. Any ideas?\n> > \n> \n> Conflicts between your cvs tree and the current tree, meaning you\n> committed stuff and it could not merge the changes into your tree?\n> \n> I use this script to remove changed files in my distribution.\n> \n> \t:\n> \tcd /pgcvs &&\n> \tpn pgcvs -qn update pgsql | grep '^M ' | cut -d' ' -f2 | xargs rm\n> \tpgupdate\n\nI'll try this.\n\nIt's strange, because I haven't actually made any changes recently, and\nthe errors have occured since I got a fresh set from the server.\n\nAs for the initdb problem, it's getting further now. It's now hanging\nwhile creating the pg_user view.\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Thu, 6 Aug 1998 06:34:55 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] CVS and the backend" }, { "msg_contents": "On Thu, 6 Aug 1998 [email protected] wrote:\n\n> >I've just run CVS UPDATE again, in another attempt to get initdb to run.\n> >Anyhow, I noticed that there was a message saying that there were\n> >conflicts. Any ideas?\n> \n> initdb no more exists, instead initdb.sh added. Does this have any\n> relation to the confilicts?\n\nJust to check, I removed initdb from the source, as well as the files that\nhad the conflicts. Reran cvs update, and it checked out initdb, so it's\nstill there.\n\nAnyhow, cvs doesn't report any conflicts now, so that's working. initdb\nseems to hang for a few minutes when creating pg_user:\n\nvacuuming template1\ncreating public pg_user view\nmv: /usr/local/dbase/data/base/template1/xpg_user: No such file or\ndirectory\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Thu, 6 Aug 1998 06:57:31 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] CVS and the backend " }, { "msg_contents": "On Thu, 6 August 1998, at 06:57:31, Peter T Mount wrote:\n\n> Anyhow, cvs doesn't report any conflicts now, so that's working. initdb\n> seems to hang for a few minutes when creating pg_user:\n> \n> vacuuming template1\n> creating public pg_user view\n> mv: /usr/local/dbase/data/base/template1/xpg_user: No such file or\n> directory\n\nthis is interesting. this is the same error I get when I use my SSL\npatch. if anyone knows what this is due to, I would love to remove\nthis bug from my patch!\n\ni don't really know enough to have any idea why this would happen. my\nssl changed should be *far* away from anything that would produce\nthis.\n", "msg_date": "Thu, 6 Aug 1998 15:19:21 -0700 (PDT)", "msg_from": "Brett McCormick <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS and the backend " }, { "msg_contents": "At 6:34 AM 98.8.6 +0100, Peter T Mount wrote:\n>On Wed, 5 Aug 1998, Bruce Momjian wrote:\n\n>It's strange, because I haven't actually made any changes recently, and\n>the errors have occured since I got a fresh set from the server.\n>\n>As for the initdb problem, it's getting further now. It's now hanging\n>while creating the pg_user view.\n\nPeter, can I get a copy of the sources you are having trouble with?\nThat might help to identify what is causing the trouble.\nI have experienced similar problem while I was developing the multi-byte\npatches.\n--\nTatsuo Ishii\[email protected]\n\n", "msg_date": "Fri, 7 Aug 1998 11:55:30 +0900", "msg_from": "[email protected] (Tatsuo Ishii)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS and the backend" }, { "msg_contents": "On Fri, 7 Aug 1998, Tatsuo Ishii wrote:\n\n> At 6:34 AM 98.8.6 +0100, Peter T Mount wrote:\n> >On Wed, 5 Aug 1998, Bruce Momjian wrote:\n> \n> >It's strange, because I haven't actually made any changes recently, and\n> >the errors have occured since I got a fresh set from the server.\n> >\n> >As for the initdb problem, it's getting further now. It's now hanging\n> >while creating the pg_user view.\n> \n> Peter, can I get a copy of the sources you are having trouble with?\n> That might help to identify what is causing the trouble.\n> I have experienced similar problem while I was developing the multi-byte\n> patches.\n\nOk, I'll tar them up as soon as I get home.\n\nAs an extra note: When it's creating the pg_user view, the cpu load slowly\nreaches about 1.3 then just sits there.\n\n--\nPeter Mount (at work) [email protected] or [email protected]\nIf you mail me here, please cc my home address [email protected]\n\n\n", "msg_date": "Fri, 7 Aug 1998 10:24:35 +0100 (BST)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS and the backend" }, { "msg_contents": "> > >It's strange, because I haven't actually made any changes recently, \n> > >and the errors have occured since I got a fresh set from the \n> > >server.\n> > >As for the initdb problem, it's getting further now. It's now \n> > >hanging while creating the pg_user view.\n\nMy problems with a fresh CVSup'd source went away when I ran ldconfig.\nThe name of the shared library has changed. One of the symptoms is that\nI got an \"atoi\" error partway through initdb.\n\nDon't know if it is related, but you might want to reconfigure your\nshared library database just to be safe...\n\n - Tom\n", "msg_date": "Fri, 07 Aug 1998 14:07:27 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS and the backend" }, { "msg_contents": "On Fri, 7 Aug 1998, Thomas G. Lockhart wrote:\n\n> > > >It's strange, because I haven't actually made any changes recently, \n> > > >and the errors have occured since I got a fresh set from the \n> > > >server.\n> > > >As for the initdb problem, it's getting further now. It's now \n> > > >hanging while creating the pg_user view.\n> \n> My problems with a fresh CVSup'd source went away when I ran ldconfig.\n> The name of the shared library has changed. One of the symptoms is that\n> I got an \"atoi\" error partway through initdb.\n\nI did get atoi errors for a while aswell, but apparently that was another\nproblem in the source, not ldconfig. You see, before the atoi errors, I\nwas getting some weird script errors in initdb itself, which were fixed by\nldconfig.\n\n> Don't know if it is related, but you might want to reconfigure your\n> shared library database just to be safe...\n\nI'm checking that now, and will fetch another fresh source tree at the\nsame time.\n\n> \n> - Tom\n> \n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Sat, 8 Aug 1998 11:30:10 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] CVS and the backend" }, { "msg_contents": "> > My problems with a fresh CVSup'd source went away when I ran \n> > ldconfig. The name of the shared library has changed. One of the \n> > symptoms is that I got an \"atoi\" error partway through initdb.\n> I did get atoi errors for a while aswell, but apparently that was \n> another problem in the source, not ldconfig. You see, before the atoi \n> errors, I was getting some weird script errors in initdb itself, which \n> were fixed by ldconfig.\n\nYes, I saw those too, and I think it was a missing result from pg_id\nwhich did it. Wasn't graceful and we should fix it before the v6.4\nrelease, otherwise many new installations will have the same trouble.\n\nThe script should check for a non-empty UID and barf or prompt for it\notherwise. Is anyone actively working on it? Don't remember who\nsubmitted the original patches but it would be nice if they would stick\nwith it and toughen it up a bit. Otherwise perhaps we should revert to\nthe original version. Like the features though...\n\n - Tom\n", "msg_date": "Sat, 08 Aug 1998 13:32:17 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS and the backend" } ]
[ { "msg_contents": "Is anything that anyone is doing for 6.4 going to shake out the problem\nwhere the test for equality between xmin and a constant integer fails.\n(i.e. WHERE xmin = 9999) If not, I would like to make the appropriate\nentries tweaks. We need this to to be in place to make use of the ODBC\nrow versioning feature.\n\n", "msg_date": "Wed, 05 Aug 1998 18:08:32 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": true, "msg_subject": "WHERE xmin = 9999" } ]
[ { "msg_contents": "Currently, large objects are stored internally as xinv### and xinx###.\n\nI would like to rename this for 6.4 to be _lobject_### to prevent\nnamespace collisions, and make them clearer for administrators.\n\nHowever, this may cause problems for backward compatability for large\nobject users. As I see there are going to be other new large object\nthings in 6.4, it may not be an issue.\n\nIs is OK to rename them internally?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 5 Aug 1998 23:53:58 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Large objects names" }, { "msg_contents": "> Currently, large objects are stored internally as xinv### and xinx###.\n> \n> I would like to rename this for 6.4 to be _lobject_### to prevent\n> namespace collisions, and make them clearer for administrators.\n> \n> However, this may cause problems for backward compatability for large\n> object users. As I see there are going to be other new large object\n> things in 6.4, it may not be an issue.\n> \n> Is is OK to rename them internally?\n\nI will probably keep the current names for a few releases. Once\ninterfaces start using the relkind field to identify them, rather than\nthe xinv* naming, I will be able to change the names to anything else\nand no external interface will care.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 01:27:53 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Large objects names" }, { "msg_contents": "On Wed, 5 Aug 1998, Bruce Momjian wrote:\n\n> Currently, large objects are stored internally as xinv### and xinx###.\n> \n> I would like to rename this for 6.4 to be _lobject_### to prevent\n> namespace collisions, and make them clearer for administrators.\n> \n> However, this may cause problems for backward compatability for large\n> object users. As I see there are going to be other new large object\n> things in 6.4, it may not be an issue.\n> \n> Is is OK to rename them internally?\n\nShouldn't be a problem. JDBC does refer to the xin prefix with the\ngetTables method, so it's simply a single change there.\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Thu, 6 Aug 1998 06:59:49 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Large objects names" }, { "msg_contents": "\n\nPeter T Mount wrote:\n\n> On Wed, 5 Aug 1998, Bruce Momjian wrote:\n>\n> > Currently, large objects are stored internally as xinv### and xinx###.\n> >\n> > I would like to rename this for 6.4 to be _lobject_### to prevent\n> > namespace collisions, and make them clearer for administrators.\n> >\n> > However, this may cause problems for backward compatability for large\n> > object users. As I see there are going to be other new large object\n> > things in 6.4, it may not be an issue.\n> >\n> > Is is OK to rename them internally?\n>\n> Shouldn't be a problem. JDBC does refer to the xin prefix with the\n> getTables method, so it's simply a single change there.\n>\n\nThe same goes for ODBC.\n\n", "msg_date": "Thu, 06 Aug 1998 09:14:44 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Large objects names" }, { "msg_contents": "> On Wed, 5 Aug 1998, Bruce Momjian wrote:\n> \n> > Currently, large objects are stored internally as xinv### and xinx###.\n> > \n> > I would like to rename this for 6.4 to be _lobject_### to prevent\n> > namespace collisions, and make them clearer for administrators.\n> > \n> > However, this may cause problems for backward compatability for large\n> > object users. As I see there are going to be other new large object\n> > things in 6.4, it may not be an issue.\n> > \n> > Is is OK to rename them internally?\n> \n> Shouldn't be a problem. JDBC does refer to the xin prefix with the\n> getTables method, so it's simply a single change there.\n\nSo does ODBC. Let's start using relkind = 'l', then I can change the\nname in a later release, and no one will see the change.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 11:34:09 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Large objects names" }, { "msg_contents": "> On Wed, 5 Aug 1998, Bruce Momjian wrote:\n> \n> > Currently, large objects are stored internally as xinv### and xinx###.\n> > \n> > I would like to rename this for 6.4 to be _lobject_### to prevent\n> > namespace collisions, and make them clearer for administrators.\n> > \n> > However, this may cause problems for backward compatability for large\n> > object users. As I see there are going to be other new large object\n> > things in 6.4, it may not be an issue.\n> > \n> > Is is OK to rename them internally?\n> \n> Shouldn't be a problem. JDBC does refer to the xin prefix with the\n> getTables method, so it's simply a single change there.\n\nI am suggesting changes in later releases to older interfaces can\ncommunicated with 6.4 without any problems.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 11:35:03 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Large objects names" }, { "msg_contents": "On Thu, 6 Aug 1998, Bruce Momjian wrote:\n\n> > On Wed, 5 Aug 1998, Bruce Momjian wrote:\n> > \n> > > Currently, large objects are stored internally as xinv### and xinx###.\n> > > \n> > > I would like to rename this for 6.4 to be _lobject_### to prevent\n> > > namespace collisions, and make them clearer for administrators.\n> > > \n> > > However, this may cause problems for backward compatability for large\n> > > object users. As I see there are going to be other new large object\n> > > things in 6.4, it may not be an issue.\n> > > \n> > > Is is OK to rename them internally?\n> > \n> > Shouldn't be a problem. JDBC does refer to the xin prefix with the\n> > getTables method, so it's simply a single change there.\n> \n> I am suggesting changes in later releases to older interfaces can\n> communicated with 6.4 without any problems.\n\nThat sounds ok.\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Thu, 6 Aug 1998 18:42:38 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Large objects names" }, { "msg_contents": "> On Thu, 6 Aug 1998, Bruce Momjian wrote:\n> \n> > > On Wed, 5 Aug 1998, Bruce Momjian wrote:\n> > > \n> > > > Currently, large objects are stored internally as xinv### and xinx###.\n> > > > \n> > > > I would like to rename this for 6.4 to be _lobject_### to prevent\n> > > > namespace collisions, and make them clearer for administrators.\n> > > > \n> > > > However, this may cause problems for backward compatability for large\n> > > > object users. As I see there are going to be other new large object\n> > > > things in 6.4, it may not be an issue.\n> > > > \n> > > > Is is OK to rename them internally?\n> > > \n> > > Shouldn't be a problem. JDBC does refer to the xin prefix with the\n> > > getTables method, so it's simply a single change there.\n> > \n> > I am suggesting changes in later releases to older interfaces can\n> > communicated with 6.4 without any problems.\n> \n> That sounds ok.\n\nYes. Older odbc/java/psql interfaces still use the xinv pattern to\nrestrict table lists. As new interfaces use relkind, I can then change\nthe internal name.\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 19:10:49 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Large objects names" } ]
[ { "msg_contents": "I'm trying to get Keystone (http://www.stonekeep.com/) to work and\nhave to emulate some MySQL functions. One of these is the ability to\nreturn the value of a column that is an auto-increment column after a\nrow was inserted, updated, or deleted. The interface I have to work\nwith is PHP. PHP has a function, pg_getlastoid, that lets me find the\noid of the last insert, update, or delete. I've looked at psql.c to\nfind out how to get the column attributes so I can figure out which\none(s) are auto increment (or rather, which ones are coming from a\nsequence definition via \"default nextval ('seqname')\").\n\nWhat I can't figure out is, given an oid, how can I figure out what\ntable it belongs to?\n\nroland\n-- \nRoland B. Roberts, PhD Custom Software Solutions\[email protected] 101 West 15th St #4NN\n New York, NY 10011\n\n", "msg_date": "06 Aug 1998 00:07:03 -0400", "msg_from": "Roland Roberts <[email protected]>", "msg_from_op": true, "msg_subject": "How do I find the table that an oid belongs to" }, { "msg_contents": ">>>>> \"Roland\" == Roland Roberts <[email protected]> writes:\n\n Roland> ... given an oid, how can I figure out what table it\n Roland> belongs to?\n\nI posted the above a few days ago, but got no takers. So, I'll post\nmy own solution. If someone can point me to a better way, please let\nme know. I particularly dislike looping over all the tables to find\nthe OID, but don't know how else to do this....\n\nThe code below is written for PHP, but if you know Perl, you'll have\nno problem following it.\n\n # Given a query handle, find the primary key of the row just inserted.\n function db_insertid ($r) {\n\tglobal $conn;\n\n\t$oid = pg_GetLastOID ($r);\n\tif (!$oid) {\n\t echo pg_ErrorMessage($dbh) . \"\\n\";\n\t return \"\";\n\t}\n\n\t# This will search through all the tables in database keystone to find\n\t# the row with OID $oid, then return the value of the primary key column\n\t# for that row.\t This is not exactly what mysql_insertid does, but it\n\t# fits with the use of db_insertid.\n\n\t# Search the system catalogues to find all the tables.\n\t$query\t= \"SELECT c.relname \"\n\t\t. \" FROM pg_class c \"\n\t\t. \" WHERE c.relkind = 'r'\"\n\t\t. \" AND c.relname !~ '^pg_'\";\n\n\t$res1 = pg_Exec ($conn, $query);\n\n\tif (!$res1) {\n\t echo pg_ErrorMessage ($conn) . \"\\n\";\n\t} else {\n\t # For each table, query to see if the OID is present.\n\t for ($idx = 0; $idx < pg_NumRows ($res1); $idx++) {\n\t\t$row = pg_Fetch_Row ($res1, $idx);\n\t\t$table = $row[0];\n\t\t$res2 = pg_Exec ($conn, \"select oid from $table where oid = $oid\");\n\t\tif (pg_NumRows ($res2) != 0) {\n\t\t # We found the OID in the current table, now find the name of the primary key column\n\t\t $query = \"SELECT a.attname FROM pg_class c, pg_attribute a, pg_index i, pg_class c2 \"\n\t\t\t . \" WHERE c.relname = '$table' \"\n\t\t\t . \" AND i.indrelid = c.oid \"\n\t\t\t . \" AND a.attrelid = c.oid \"\n\t\t\t . \" AND c2.oid = i.indexrelid \"\n\t\t\t . \" AND i.indkey[0] = a.attnum \"\n\t\t\t . \" AND c2.relname ~ '_pkey$'\";\n\t\t $res2 = pg_Exec ($conn, $query);\n\t\t if ($res2) {\n\t\t\t$pkname\t= pg_Result ($res2, 0, 0);\n\t\t\t$res2\t= pg_Exec (\"select $pkname from $table where oid = $oid\");\n\t\t\t$row\t= pg_Fetch_Row ($res2, 0);\n\t\t\treturn $row[0];\n\t\t } else {\n\t\t\treturn 0;\n\t\t }\n\t\t break;\n\t\t}\n\t }\n\t}\n };\n\n\nroland\n-- \nRoland B. Roberts, PhD Custom Software Solutions\[email protected] 101 West 15th St #4NN\n New York, NY 10011\n\n", "msg_date": "09 Aug 1998 17:18:41 -0400", "msg_from": "Roland Roberts <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] How do I find the table that an oid belongs to" } ]
[ { "msg_contents": "They now have their own relkind type, and this is now used by psql and\npg_dump.\n\nVadim, the sequence creation global variable hack is now gone, and\nrelkind is passed to DefineRelation and heap_create_with_catalog.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 01:11:48 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Large objects" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> They now have their own relkind type, and this is now used by psql and\n> pg_dump.\n> \n> Vadim, the sequence creation global variable hack is now gone, and\n> relkind is passed to DefineRelation and heap_create_with_catalog.\n\nNice.\n\nVadim\n", "msg_date": "Thu, 06 Aug 1998 13:19:58 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Large objects" } ]
[ { "msg_contents": "\n>Currently, large objects are stored internally as xinv### and xinx###.\n>\n>I would like to rename this for 6.4 to be _lobject_### to prevent\n>namespace collisions, and make them clearer for administrators.\n>\n>However, this may cause problems for backward compatability for large\n>object users. As I see there are going to be other new large object\n>things in 6.4, it may not be an issue.\n>\n>Is is OK to rename them internally?\n\nHow about giving them their own subdirectory large_object/_lob_###, \nthen there would be no naming conflict ?\nSince all others call them LOB I would use _lob_### instead.\n\nAndreas\n\n", "msg_date": "Thu, 6 Aug 1998 10:45:41 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Large objects names" }, { "msg_contents": "> \n> >Currently, large objects are stored internally as xinv### and xinx###.\n> >\n> >I would like to rename this for 6.4 to be _lobject_### to prevent\n> >namespace collisions, and make them clearer for administrators.\n> >\n> >However, this may cause problems for backward compatability for large\n> >object users. As I see there are going to be other new large object\n> >things in 6.4, it may not be an issue.\n> >\n> >Is is OK to rename them internally?\n> \n> How about giving them their own subdirectory large_object/_lob_###, \n> then there would be no naming conflict ?\n> Since all others call them LOB I would use _lob_### instead.\n\nThat would be interesting.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 11:43:02 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] Large objects names" } ]
[ { "msg_contents": ">Is the following legal:\n>if (<condition>) {\n> exec sql declare cur cursor for\n> select name, nr from table where nr < 10;\n>}\n>else {\n> exec sql declare cur cursor for\n> select name, nr from table where nr >= 10;\n>}\n>\n>That is declaring one cursor in two different ways? Oracle cannot do that.\n>We can, though. Shall I disable this (and remove my last changes) or is this\n>a good feature (as I think it is) and we keep it? Only disadvantage is that\n>the declare tarnslates into a C statement and is not really a declaration\n>anymore.\n\nInformix can't eighter:\ninformix@zeus:/usr/informix> esql hallo.ec\nesqlc: \"hallo.ec\", line 9: Error -33055: The name cur has already been used.\n1 error(s) found\n\nI guess the objective has to be: be fast during execution \nand therefore a declare is probably better.\n\nAndreas\n\n", "msg_date": "Thu, 6 Aug 1998 10:52:48 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Declare Cursor question again" }, { "msg_contents": "On Thu, Aug 06, 1998 at 10:52:48AM +0200, Andreas Zeugswetter wrote:\n> Informix can't eighter:\n> informix@zeus:/usr/informix> esql hallo.ec\n> esqlc: \"hallo.ec\", line 9: Error -33055: The name cur has already been used.\n> 1 error(s) found\n> \n> I guess the objective has to be: be fast during execution \n> and therefore a declare is probably better.\n\nIt doesn't make much of a speed difference. But my solution is not needed.\nThat's what prepare is for.\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Thu, 6 Aug 1998 22:11:58 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Declare Cursor question again" } ]
[ { "msg_contents": "I just did a fresh cvs update, and reinstall. initdb worked fine. This\nis under BSDI.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 11:52:39 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "current CVS tree" }, { "msg_contents": "On Thu, 6 Aug 1998, Bruce Momjian wrote:\n\n> I just did a fresh cvs update, and reinstall. initdb worked fine. This\n> is under BSDI.\n\nI've just done exactly the same thing, and finally it's working. I don't\nknow what had happened, but it's taken 4 weeks to get it working...\n\n-- \nPeter T Mount [email protected] or [email protected]\nMain Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n\n", "msg_date": "Sun, 9 Aug 1998 14:51:58 +0100 (GMT)", "msg_from": "Peter T Mount <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] current CVS tree" } ]
[ { "msg_contents": "\nI'm thinking of making a multi-type array but I have a sinking feeling\nthat it cannot be indexed in the standard way, i.e.\n\nselect table.field[i] from table;\n\nam I correct? is there any way around this?\n", "msg_date": "Thu, 6 Aug 1998 15:33:41 -0700 (PDT)", "msg_from": "Brett McCormick <[email protected]>", "msg_from_op": true, "msg_subject": "multi-type array" } ]
[ { "msg_contents": "[Sorry, my ISP managed to get itself on the RBL, so hub.org rejects my mail,\n and if I send mail to \"hackers\" mailing list from a different account, it \n gets rejected because that account isn't a subscriber to the list. So, I'm\n sending this individually.]\n\nI'm looking at implementing a procedural language for postgresql, and I\nhave a few questions I'd like to get feedback on before I start.\n\n1. First of all, is anybody already working on this? I would like to\n avoid duplication of effort, if possible.\n \n2. Looking at the code, it seems that I basically need to do three things:\n write a parser (using gram.y as a model), implement code to handle flow-\n control nodes in the parse tree for the executor, and write a small bit of\n glue for a handler (starting with the stub in \"man create_language\").\n Is this basically correct? Is there anything in these areas that is \n particularly fragile that I need to watch out for?\n\n3. I want to use Python as a model, because Python syntax is very simple,\n and the semantics are a very good fit with the postgres backend. One \n problem I see, though, is that Python is dynamically typed, and looking \n at the backend code, it looks like postgres is statically typed. If you\n have a Datum, there doesn't seem to be any way to know what's in it. \n Comments? Suggestions?\n \nThanks.\n \n -Michael Robinson\n\n\n\n\n", "msg_date": "Fri, 7 Aug 1998 11:05:40 +0800 (GMT)", "msg_from": "Michael Robinson <[email protected]>", "msg_from_op": true, "msg_subject": "Procedural language implementation questions" }, { "msg_contents": "We have already implemented python as an external interface, but not as\na procedural language inside the backend. Jan Wieck ([email protected])\nhas discussed implementing a procedural language, but I am not sure how\nfar he has gotten.\n\n> [Sorry, my ISP managed to get itself on the RBL, so hub.org rejects my mail,\n> and if I send mail to \"hackers\" mailing list from a different account, it \n> gets rejected because that account isn't a subscriber to the list. So, I'm\n> sending this individually.]\n> \n> I'm looking at implementing a procedural language for postgresql, and I\n> have a few questions I'd like to get feedback on before I start.\n> \n> 1. First of all, is anybody already working on this? I would like to\n> avoid duplication of effort, if possible.\n> \n> 2. Looking at the code, it seems that I basically need to do three things:\n> write a parser (using gram.y as a model), implement code to handle flow-\n> control nodes in the parse tree for the executor, and write a small bit of\n> glue for a handler (starting with the stub in \"man create_language\").\n> Is this basically correct? Is there anything in these areas that is \n> particularly fragile that I need to watch out for?\n> \n> 3. I want to use Python as a model, because Python syntax is very simple,\n> and the semantics are a very good fit with the postgres backend. One \n> problem I see, though, is that Python is dynamically typed, and looking \n> at the backend code, it looks like postgres is statically typed. If you\n> have a Datum, there doesn't seem to be any way to know what's in it. \n> Comments? Suggestions?\n> \n> Thanks.\n> \n> -Michael Robinson\n> \n> \n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 6 Aug 1998 23:18:08 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Procedural language implementation questions" } ]
[ { "msg_contents": "> > OK, all entries in the lib directory refer to libpq.so.1 . So where \n> > is the \"old link\" you are referring to? Do I need to rerun \n> > ldconfig??\n> The wrong link (that is, on my Linux box...) resided in \n> /usr/local/lib;\n> I had made it some time ago as a link to\n> /usr/local/pgsql/src/interfaces/libpq/libpq.so.1.1 (or something)\n\nThanks for the clue Ernst. I reran ldconfig and the source tree is now\nhappy. I have my system configured to have the ld database point to\n/opt/postgres/current/lib/ so it wasn't just a softlink change.\n\nSo the story is that the name of libpq.so.xx has changed. But why bother\nwith .1 or .1.1 in the first place? Shouldn't the numbering either\nchange for each new version of libpq interface, or be omitted\naltogether? Has anyone thought about having it match the Postgres\nrelease number?\n\n - Tom\n", "msg_date": "Fri, 07 Aug 1998 04:44:03 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Broken source tree" } ]
[ { "msg_contents": "I believe that clauses.c:join_clause_p properly only allows merge and\nhash joins on non-OR clauses. It is called from\ninitialize_join_clause_info().\n\nI can't get anything but a sequential scan on an OR clause, so I think\nwe are safe with the multi-index OR handling.\n\nI will keep checking, though.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 7 Aug 1998 01:10:18 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "OR clause and joins" } ]
[ { "msg_contents": "hello tom,\n\ndid you try informix SE on linux ? could you install it on red hat 4.2 ?\ni'll be installing red hat 5.0 on my machine and would like to know if\ninformix SE works with red hat.\n\noracle too has come up with a version on Linux, but of course its not for\nfree!!\n\nregards,\nnarayan\n\n\n\n\n\nInformix on Linux\n\n\nhello tom,\n\ndid you try informix SE on linux ? could you install it on red hat 4.2 ? i'll be installing red hat 5.0 on my machine and would like to know if informix SE works with red hat.\noracle too has come up with a version on Linux, but of course its not for free!!\n\nregards,\nnarayan", "msg_date": "Fri, 7 Aug 1998 18:32:01 +0530 ", "msg_from": "NARAYANI <[email protected]>", "msg_from_op": true, "msg_subject": "Informix on Linux" }, { "msg_contents": "> did you try informix SE on linux ? could you install it on red hat 4.2\n> ? i'll be installing red hat 5.0 on my machine and would like to know\n> if informix SE works with red hat.\n> \n> oracle too has come up with a version on Linux, but of course its not\n> for free!!\n\nI received a message back from Informix and they said that it appears\nthat it will run on RH5.0/5.1 without trouble, since the libc5 libraries\nare present. This is based on reports from users since they have not\nfinished testing it themselves yet. It already officially runs on RH4.2.\n\nI haven't had a chance to try running it myself yet.\n\n - Tom\n", "msg_date": "Fri, 07 Aug 1998 14:14:00 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Informix on Linux" }, { "msg_contents": "> \n> > did you try informix SE on linux ? could you install it on red hat 4.2\n> > ? i'll be installing red hat 5.0 on my machine and would like to know\n> > if informix SE works with red hat.\n> > \n> > oracle too has come up with a version on Linux, but of course its not\n> > for free!!\n> \n> I received a message back from Informix and they said that it appears\n> that it will run on RH5.0/5.1 without trouble, since the libc5 libraries\n> are present. This is based on reports from users since they have not\n> finished testing it themselves yet. It already officially runs on RH4.2.\n> \n> I haven't had a chance to try running it myself yet.\n> \n> - Tom\n\nI would like to point out that Informix SE for Linux is available TODAY\nfrom our website. Oracle for Linux is planned for the end of the year.\n\nI think our shipping SE version beats their latest and greatest vapor. ;-)\n\n-dg\n\nDavid Gould [email protected] 510.628.3783 or 510.305.9468 \nInformix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n - If simplicity worked, the world would be overrun with insects. -\n", "msg_date": "Fri, 7 Aug 1998 11:41:55 -0700 (PDT)", "msg_from": "[email protected] (David Gould)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Informix on Linux" }, { "msg_contents": "> > \n> > > did you try informix SE on linux ? could you install it on red hat 4.2\n> > > ? i'll be installing red hat 5.0 on my machine and would like to know\n> > > if informix SE works with red hat.\n> > > \n> > > oracle too has come up with a version on Linux, but of course its not\n> > > for free!!\n> > \n> > I received a message back from Informix and they said that it appears\n> > that it will run on RH5.0/5.1 without trouble, since the libc5 libraries\n> > are present. This is based on reports from users since they have not\n> > finished testing it themselves yet. It already officially runs on RH4.2.\n> > \n> > I haven't had a chance to try running it myself yet.\n> > \n> > - Tom\n> \n> I would like to point out that Informix SE for Linux is available TODAY\n> from our website. Oracle for Linux is planned for the end of the year.\n> \n> I think our shipping SE version beats their latest and greatest vapor. ;-)\n\nYes, but it is a shame Informix is coming as a \"me too\" to Linux, rather\nthan leading the pack. Now that they have decided to release the port,\nit is a shame they did not release it six months ago, so they looked\nmore like a leader.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 7 Aug 1998 15:06:01 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Informix on Linux" } ]
[ { "msg_contents": "Has something changed recently? I created a new database and it won't\nlet me insert unless I specifically grant myself privledges. It\nshows as being owned by me. Also, I can't create a view. It says\n\"pg_rewrite: Permission denied.\" and doesn't create the view.\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 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n", "msg_date": "Fri, 7 Aug 1998 12:25:00 -0400 (EDT)", "msg_from": "[email protected] (D'Arcy J.M. Cain)", "msg_from_op": true, "msg_subject": "Table permissions" } ]
[ { "msg_contents": "When experimenting with\tthreaded perl\nI noticed I had to lock access to the database\na one user at the time in order get reliable (no SEGV).\n\nUnfortunely it is 3 layer between my server and the wire,\nDBI, DBD::Pg och libpq.\nThinking I would start from the bottom:\nHas anyone any experience of the thread-safeness of libpq?\n\n\thave a good weekend,\n\n\t\tG�ran\n", "msg_date": "Fri, 07 Aug 1998 18:19:38 +0000", "msg_from": "Goran Thyni <[email protected]>", "msg_from_op": true, "msg_subject": "thread-safe libpq and DBD::Pg" }, { "msg_contents": "Goran Thyni <[email protected]> writes:\n> Has anyone any experience of the thread-safeness of libpq?\n\nPQconnectdb() is not thread-safe, because it scribbles temporary\ndata in the static PQconninfoOptions array. You can get around\nthat easily enough by not using PQconnectdb (or PQconndefaults)\n--- use PQsetdbLogin() instead. In any case the problem exists\nonly if different threads try to open database connections\nat the same time.\n\nAs far as I can think at the moment, ordinary operations while\nthe database connection is open should be thread safe. That's\nassuming that your libc (esp. malloc/free) is thread safe of course.\nIt also assumes that only one thread is using any one PGconn\nobject (at a time, anyway). Multiple threads using the same\nPGconn to issue concurrent requests definitely will not work.\n\nThere is also some thread risk during connection shutdown because\nlibpq momentarily commandeers the SIGPIPE handler. I am thinking\nit'd be nice to get rid of that code if possible --- see discussion\nfrom a couple weeks ago on the hackers (or was it interfaces?) list.\n\n\nI had thought a little bit about ripping out PQconnectdb's use of\nchangeable fields in PQconninfoOptions, but it looks like this\ncould break applications that access PQconninfoOptions.\nDoes anyone have any feelings about that, pro or con?\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 08 Aug 1998 14:30:37 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] thread-safe libpq and DBD::Pg " }, { "msg_contents": "I wrote:\n> Goran Thyni <[email protected]> writes:\n>> Has anyone any experience of the thread-safeness of libpq?\n\n> There is also some thread risk during connection shutdown because\n> libpq momentarily commandeers the SIGPIPE handler. I am thinking\n> it'd be nice to get rid of that code if possible --- see discussion\n> from a couple weeks ago on the hackers (or was it interfaces?) list.\n\nI have removed that SIGPIPE hacking from closePGconn() in a patch\njust submitted to pgsql-patches; that's one less thread safety violation\nin libpq. However, whilst I was poking about in the libpq innards I\nnoticed a couple of other ones :-(.\n\nPQprint() also manipulates the SIGPIPE handler in order to prevent\napplication termination if the pager subprocess it starts up decides\nto quit early. This is a good thing, I think, but it does create\na problem if the app is multi-threaded and other threads would prefer\na different SIGPIPE setting. (I suppose if signal handlers are\nthread-local in your environment then it's a non-issue anyway.)\n\nI also noticed that PQoidStatus() returns a pointer to a static\nchar array, which is a classic thread-safety booboo. I am thinking\nthat the cleanest solution is for it to copy the OID number into\nconn->errorMessage and return a pointer to that. This would mean\nthat the value would not be good after the next operation on the\nPGconn object, but I wouldn't imagine that any apps hold onto the\npointer very long anyway --- they probably always feed it to atoi\nimmediately. (Actually, why the dickens doesn't this routine\nreturn an Oid value directly? It could return InvalidOid in\ncase of trouble, just like PQftype does... but I suppose we don't\nwant to break application code just to make the API a tad cleaner.)\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 08 Aug 1998 20:51:18 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] thread-safe libpq and DBD::Pg " }, { "msg_contents": "", "msg_date": "Sat, 8 Aug 1998 23:12:09 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] thread-safe libpq and DBD::Pg" }, { "msg_contents": "> I also noticed that PQoidStatus() returns a pointer to a static\n> char array, which is a classic thread-safety booboo. I am thinking\n> that the cleanest solution is for it to copy the OID number into\n> conn->errorMessage and return a pointer to that. This would mean\n> that the value would not be good after the next operation on the\n> PGconn object, but I wouldn't imagine that any apps hold onto the\n> pointer very long anyway --- they probably always feed it to atoi\n> immediately. (Actually, why the dickens doesn't this routine\n> return an Oid value directly? It could return InvalidOid in\n> case of trouble, just like PQftype does... but I suppose we don't\n> want to break application code just to make the API a tad cleaner.)\n\nYes, it is very silly that PQoidStatus() returns a char*. I believe it\nwas only done that way because it was pulling the oid out of the\ncmdStatus field. We really should return an int. Perhaps we don't\nbecause we would be hardcoding the oid type on the client side. By\ndefault, we return all types as char *. I don't think we do this\nanywhere else in the protocol.\n\nThis is a complete guess. I believe it was added by Vadim in 6.2 or\n6.3.\n\nPerhaps we could double-use the cmdStatus field, perhaps when they ask\nfor the oid, we put a null after the oid value, and return a pointer to\nthe inside of the cmdStatus field. If the call for PQcmdStatus(), we\nremove the null and return the string. Strange, I admit.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 8 Aug 1998 23:50:55 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] thread-safe libpq and DBD::Pg" }, { "msg_contents": "Tom Lane wrote:\n> \n> Goran Thyni <[email protected]> writes:\n> > Has anyone any experience of the thread-safeness of libpq?\n> \n> PQconnectdb() is not thread-safe, because it scribbles temporary\n> data in the static PQconninfoOptions array. You can get around\n> that easily enough by not using PQconnectdb (or PQconndefaults)\n> --- use PQsetdbLogin() instead. In any case the problem exists\n> only if different threads try to open database connections\n> at the same time.\n> [...}\n\nTom,\nthanks for the reply.\nDBD::Pg dos indeed use PQconnectdb(),\nbut at least in my light test I get SEGV in $sth->fetch.\nThe problems are probably somewhere in DBDI or DBD::Pg or\nsomewhere in the interaction of the parts.\n\nI am looking into how much work a \"pure Perl\" interface\nshould amount to. Using native perl IO and pgsql-fe/be-protocol\nshould make \"pgsql-clienting\" even more portable over platforms.\n\n\tregards,\n\t\tG�ran\n", "msg_date": "Sun, 09 Aug 1998 08:16:36 +0000", "msg_from": "Goran Thyni <[email protected]>", "msg_from_op": true, "msg_subject": "Re: thread-safe libpq and DBD::Pg" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> Yes, it is very silly that PQoidStatus() returns a char*. I believe it\n> was only done that way because it was pulling the oid out of the\n> cmdStatus field. We really should return an int. Perhaps we don't\n> because we would be hardcoding the oid type on the client side.\n\nType Oid is already visible to libpq clients: it's returned by PQftype()\nas the type code for attributes. I think encouraging clients to store\noids as type Oid rather than some-int-type-chosen-at-random would be a\ngood thing, not a bad thing.\n\nHowever, improving the cleanliness of the API might not be worth the\ncost of breaking application code, even though this routine is probably\nnot very widely used. Does anyone else have an opinion pro or con?\n\n> Perhaps we could double-use the cmdStatus field, perhaps when they ask\n> for the oid, we put a null after the oid value, and return a pointer to\n> the inside of the cmdStatus field. If the call for PQcmdStatus(), we\n> remove the null and return the string. Strange, I admit.\n\nI had a variant of that idea: what's stored in cmdStatus looks like\n INSERT oidvalue count\nbut there's a fair amount of room left over (cmdStatus is 40 bytes ...\nand we could make it bigger if we wanted). We can make PQoidStatus\ncopy the oidvalue into the free space:\n cmdStatus = \"INSERT oidvalue count\\0oidvalue\\0\"\nand return a pointer to here ...............^\nThat way PQcmdStatus and PQoidStatus don't interfere with each other.\nThe result of PQoidStatus will still get zapped by the next interaction\nwith the backend, but at least it's not as transient as it would be in\nthe errorMessage field.\n\nBut, still, converting to an integer return value would be a *lot*\ncleaner.\n\nIf we were going to do that, I'd be strongly inclined to change\nPQcmdTuples to return an int (or more likely a long) as well.\nI can't envision any situation where people aren't writing\natoi(PQcmdTuples(conn)) so why not save them the trouble...\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 09 Aug 1998 11:49:25 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] thread-safe libpq and DBD::Pg " }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> > Yes, it is very silly that PQoidStatus() returns a char*. I believe it\n> > was only done that way because it was pulling the oid out of the\n> > cmdStatus field. We really should return an int. Perhaps we don't\n> > because we would be hardcoding the oid type on the client side.\n> \n> Type Oid is already visible to libpq clients: it's returned by PQftype()\n> as the type code for attributes. I think encouraging clients to store\n> oids as type Oid rather than some-int-type-chosen-at-random would be a\n> good thing, not a bad thing.\n> \n> However, improving the cleanliness of the API might not be worth the\n> cost of breaking application code, even though this routine is probably\n> not very widely used. Does anyone else have an opinion pro or con?\n> \n> > Perhaps we could double-use the cmdStatus field, perhaps when they ask\n> > for the oid, we put a null after the oid value, and return a pointer to\n> > the inside of the cmdStatus field. If the call for PQcmdStatus(), we\n> > remove the null and return the string. Strange, I admit.\n> \n> I had a variant of that idea: what's stored in cmdStatus looks like\n> INSERT oidvalue count\n> but there's a fair amount of room left over (cmdStatus is 40 bytes ...\n> and we could make it bigger if we wanted). We can make PQoidStatus\n> copy the oidvalue into the free space:\n> cmdStatus = \"INSERT oidvalue count\\0oidvalue\\0\"\n> and return a pointer to here ...............^\n> That way PQcmdStatus and PQoidStatus don't interfere with each other.\n> The result of PQoidStatus will still get zapped by the next interaction\n> with the backend, but at least it's not as transient as it would be in\n> the errorMessage field.\n> \n> But, still, converting to an integer return value would be a *lot*\n> cleaner.\n> \n> If we were going to do that, I'd be strongly inclined to change\n> PQcmdTuples to return an int (or more likely a long) as well.\n> I can't envision any situation where people aren't writing\n> atoi(PQcmdTuples(conn)) so why not save them the trouble...\n\nAnother idea I had was to a char* field to the result structure. \nInitialize it to NULL, then when they want oidStatus, we malloc() some\nmemory, assign it to our char*, and copy the string into there, and\nreturn that to the user. If we get called later, we can re-use the\nmemory, and free() it when we free the PQresult.\n\nIt was added in 6.2.\n\nIf we change it, we will have to require people using those calls to\nmodify their apps, rather than just relink with the new libpq. However,\nold binaries will run fine because they would be linked to the old\nlibpq.\n\nphp3 uses PQoidStatus, so I can imagine great problems if we change the\nlibpq interface. I am afraid we are stuck with char*.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 9 Aug 1998 13:34:39 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] thread-safe libpq and DBD::Pg" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> php3 uses PQoidStatus, so I can imagine great problems if we change the\n> libpq interface. I am afraid we are stuck with char*.\n\nYeah, I can't really see breaking applications just for a marginal\nimprovement in cleanliness.\n\nThere is a possible compromise however: we could leave PQcmdTuples and\nPQoidStatus defined as-is (but do something to get rid of PQoidStatus'\nuse of a static return area), and add two more functions that have more\nreasonable return conventions. The documentation could describe the\nolder functions as deprecated.\n\nPerhaps the int-returning forms could be named \"PQCmdTuples\" and\n\"PQOidStatus\" (note difference in capitalization) ... unless someone\nhas a better idea.\n\nDoes anyone think this is worth the trouble, or shall we leave bad\nenough alone?\n\nI do intend to get rid of the static return area for PQoidStatus in any\ncase. I'd also like to fix the problem with PQconninfoOptions not being\ntreated as a constant (specifically, the \"val\" fields are being used as\nworking storage). Is anyone aware of any applications that would be\nbroken by removing \"val\" from the PQconninfoOption struct?\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 09 Aug 1998 19:01:49 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] thread-safe libpq and DBD::Pg " }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> > php3 uses PQoidStatus, so I can imagine great problems if we change the\n> > libpq interface. I am afraid we are stuck with char*.\n> \n> Yeah, I can't really see breaking applications just for a marginal\n> improvement in cleanliness.\n> \n> There is a possible compromise however: we could leave PQcmdTuples and\n> PQoidStatus defined as-is (but do something to get rid of PQoidStatus'\n> use of a static return area), and add two more functions that have more\n> reasonable return conventions. The documentation could describe the\n> older functions as deprecated.\n> \n> Perhaps the int-returning forms could be named \"PQCmdTuples\" and\n> \"PQOidStatus\" (note difference in capitalization) ... unless someone\n> has a better idea.\n> \n> Does anyone think this is worth the trouble, or shall we leave bad\n> enough alone?\n\nPerhaps we can leave the change for a time when we want to change the\nlibpq interface in a more significant way. Having two functions just\nseems like a waste for such a rarely-called fuction.\n\n\n> \n> I do intend to get rid of the static return area for PQoidStatus in any\n> case. I'd also like to fix the problem with PQconninfoOptions not being\n> treated as a constant (specifically, the \"val\" fields are being used as\n> working storage). Is anyone aware of any applications that would be\n> broken by removing \"val\" from the PQconninfoOption struct?\n> \n> \t\t\tregards, tom lane\n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 9 Aug 1998 19:35:34 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] thread-safe libpq and DBD::Pg" } ]
[ { "msg_contents": "Let me ask about type coersion.\n\nWhen you have an int2 column called x, how do you place the conversion\nfunctions when it is being compared to an in4 constant?\n\n\tx = int2(500)\n\n\tint4(x) = 500\n\nThe first is good for indexing, the second is not. If they are both\nvariables or both constants, the handling does not matter.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 8 Aug 1998 02:42:07 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "type coersion" }, { "msg_contents": "<I changed \"x\" to \"i2\" in the example for clarity>\n\n> ... have an int2 column called i2, how do you place the conversion\n> functions when it is being compared to an in4 constant?\n> i2 = int2(500)\n> int4(i2) = 500\n> The first is good for indexing, the second is not. If they are both\n> variables or both constants, the handling does not matter.\n\nYes the handling does matter *in general*, since\n while i4 = 500.1\ncannot be evaluated as\n while i4 = int4(500.1)\nand get the right result.\nEven for the types in your example,\n while i2 = 4000000 \nshould execute correctly, even though we both know that *for this case*\nit doesn't make a lot of sense since the constant exceeds the range of\nthe column.\n\nActually, there are a lot of mixed-type comparison functions in pg_proc.\nFor example, there is a int24eq function which would be used for your\nquery outside of a \"where clause\". But, read on...\n\n*slaps forehead*\n\nIt dawned on me while I was waking up this morning that we'd forgotten a\nmajor bit of info about indexing. The pg_proc routines which are\ndeclared for =, <, >, etc. are _not_ directly used to access indices! It\nis of course the pg_am, pg_amop, and pg_amproc tables which are used for\nthis.\n\nHere are examples from v6.3.2:\n\nregression=> explain select * from tenk1 where unique1 = 3000;\nIndex Scan on tenk1 (cost=2.05 size=1 width=100)\nregression=> explain select * from tenk1 where unique1 = 3000+1;\nSeq Scan on tenk1 (cost=512.00 size=1000 width=100)\nregression=> explain select * from tenk1 where unique1 = int4(3000.1);\nSeq Scan on tenk1 (cost=512.00 size=1000 width=100)\n\nThe *only case* I've noticed so far which does better in v6.3.2 than\n\"v6.4today\" (not yet v6.4alpha :) is the one involving OIDs:\nregression=> explain select * from tenk1 where oid = 3000;\nIndex Scan on tenk1 (cost=2.05 size=1 width=100)\n\nAnd remember that there are a lot of cases which do better in v6.4today\nthan in earlier versions.\n\nLet's try to figure out how to get constant expressions using indices,\nrather than just patching to get mismatched constant values using them.\nAnd even for that I should be able to fix up the \"binary compatible\"\ncases such as OID and int4 without too much trouble. Just need to find\nthe right spot in the index handling.\n\nHowever, I should be able to find that by looking for references to the\npg_am* tables in the source code now that my brain is partly unwedged :)\nWill do that, and we might still want to figure out how to use Vadim's\nnew PARAM_EXEC nodes for function calls on constants and constant\nexpressions (e.g. func1(func2(const1+const2))+const3) in the parser.\n\n - Tom\n", "msg_date": "Sat, 08 Aug 1998 13:48:23 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: type coersion (was OR clause status)" }, { "msg_contents": "\"Thomas G. Lockhart\" <[email protected]> writes:\n> The *only case* I've noticed so far which does better in v6.3.2 than\n> \"v6.4today\" (not yet v6.4alpha :) is the one involving OIDs:\n> regression=> explain select * from tenk1 where oid = 3000;\n> Index Scan on tenk1 (cost=2.05 size=1 width=100)\n\nActually, I'm aware of another one: comparisons using \"> constant\"\nor \"< constant\" seem more likely to use an index in 6.3.2 than they\ndo in the sources I have. I have examples involving both datetime\nand int4 columns where \"where x = constant\" will be implemented by\nindex scan, but \"where x > constant\" will not. Explicit casts of\nthe righthand side make no difference. And it works fine in 6.3.2.\n\nI'm a couple of weeks behind the CVS tree, so I was going to wait\nuntil I'd confirmed it with up-to-the-minute sources before complaining.\nBut if you're proceeding on the assumption that the \"oid = integer\" case\nis the only thing that's broken, you may be misled.\n\nThe fact that casting doesn't affect this makes me think it is a\ndifferent problem than the must-cast-to-get-an-index-scan cases\nwe've discussed so far.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 08 Aug 1998 14:41:00 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status) " }, { "msg_contents": "\"Thomas G. Lockhart\" <[email protected]> writes:\n>> ... have an int2 column called i2, how do you place the conversion\n>> functions when it is being compared to an in4 constant?\n>> i2 = int2(500)\n>> int4(i2) = 500\n>> The first is good for indexing, the second is not. If they are both\n>> variables or both constants, the handling does not matter.\n\n> Yes the handling does matter *in general*, since\n> while i4 = 500.1\n> cannot be evaluated as\n> while i4 = int4(500.1)\n> and get the right result.\n> Even for the types in your example,\n> while i2 = 4000000 \n> should execute correctly, even though we both know that *for this case*\n> it doesn't make a lot of sense since the constant exceeds the range of\n> the column.\n\nThis is all a good point. I wonder whether it wouldn't help to make the\nparser's initial assignment of types to constants depend on how big the\nconstants are. In other words, if I write \"400\" the parser would\nimplicitly mark this as \"int2\", whereas if I write \"400000\" it would be\nimplicitly marked \"int4\". Then, subsequent implicit upward promotion\nwould cast 400::int2 to 400::int4 if int4 was actually the most\nappropriate thing to use *in context*.\n\nIt seems to me that this handles all the cases cited correctly:\n\twhere i2 = 400\nwill get implemented directly as int2 eq int2,\n\twhere i4 = 400\nwill promote 400::int2 to 400::int4 and then use an int4 eq int4\ncomparison op (of course we have to address the current failure to\nreduce int4(constant) to a constant, but IMHO that has to happen\nanyway),\n\twhere i2 = 400000\nwill get promoted to where int4(i2) = 400000::int4 and executed\ncorrectly (in this case returning no rows, but that's not a reason\nnot to do it right --- \"where i2 < 32768\" might be a more compelling\nexample). Likewise\n\twhere i4 = 500.1\nwill be executed with correct semantics as float8(i4) = 500.1::float8\nsince the parser will know that float8 is a \"wider\" type than int4.\n\nIt'd be nice if the same answer would work for \n\twhere f4 = 500.1\nbut I'm not sure that I care to see the parser deciding that \"float4\nis good enough for this constant\". We could too easily find that in\n\twhere f8 = 500.1\nthe parser might cast the constant down to float4 and back up to float8\nwith catastrophic loss of precision.\n\nIn the float case, is there some way that a constant might be marked\nas \"float of unspecified width\" (with the actual value held as a float8)\nuntil the type resolution pass is done? This would need to be\nconsidered \"equivalent\" to both float4 and float8, so that in\n\twhere f4 = 500.1\nthe type resolver doesn't decide it must rewrite f4 as float8(f4).\nThen at some late stage of the game we resolve the constant to float4\nrather than float8 if the context is float4. I'm not sure how the\ndetails should work, however. If we *could* make this work it might\nbe best to handle int2 vs. int4 constants the same way.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 08 Aug 1998 15:16:51 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status) " }, { "msg_contents": "> > Yes the handling does matter *in general*...\n> This is all a good point. I wonder whether it wouldn't help to make \n> the parser's initial assignment of types to constants depend on how \n> big the constants are.\n\nI agree that there is something to fix, including both of the indexing\nexample cases you are following. I've been seeing this as an opportunity\nto fix sub-optimal utilization of indices, and my recent changes to\nenhance the type conversion capabilities in the parser just put the\nindex handling in a harsher light.\n\nIf we come near release time, and no one has been able to penetrate the\nindex handling (to fix cases as simple as \"where x = 1 + 1\" which have\nnever worked) the we could fairly easily go back into the parser and\nbrute-force some non-general workarounds to get the few \"worse than\nbefore\" cases hacked around.\n\nIf we _can_ get the index handling to work more generally, then we have\nsubstantially enhanced the overall capabilities of Postgres.\n\nSo far, I haven't seen cases where the parser has tried to do \"the wrong\nthing\", only cases where \"the right thing\" causes the index handling to\nmiss the boat...\n\n - Tom\n", "msg_date": "Sun, 09 Aug 1998 22:30:23 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "\"Thomas G. Lockhart\" <[email protected]> writes:\n> So far, I haven't seen cases where the parser has tried to do \"the wrong\n> thing\", only cases where \"the right thing\" causes the index handling to\n> miss the boat...\n\nI disagree, actually. In the example\n\n\tselect ... where i2 = 400;\n\nI claim the parser is doing the wrong thing by representing this as\n\"where int4(i2) = 400::int4\" rather than \"where i2 = 400::int2\".\nIt is not really reasonable to expect the optimizer to clean up\nafter that initial mistake.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 09 Aug 1998 19:06:05 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status) " }, { "msg_contents": "> > > Yes the handling does matter *in general*...\n> > This is all a good point. I wonder whether it wouldn't help to make \n> > the parser's initial assignment of types to constants depend on how \n> > big the constants are.\n> \n> I agree that there is something to fix, including both of the indexing\n> example cases you are following. I've been seeing this as an opportunity\n> to fix sub-optimal utilization of indices, and my recent changes to\n> enhance the type conversion capabilities in the parser just put the\n> index handling in a harsher light.\n> \n> If we come near release time, and no one has been able to penetrate the\n> index handling (to fix cases as simple as \"where x = 1 + 1\" which have\n> never worked) the we could fairly easily go back into the parser and\n> brute-force some non-general workarounds to get the few \"worse than\n> before\" cases hacked around.\n> \n> If we _can_ get the index handling to work more generally, then we have\n> substantially enhanced the overall capabilities of Postgres.\n> \n> So far, I haven't seen cases where the parser has tried to do \"the wrong\n> thing\", only cases where \"the right thing\" causes the index handling to\n> miss the boat...\n\nI have found what is happening in the optimizer, and will explain soon.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 9 Aug 1998 19:33:59 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> If we come near release time, and no one has been able to penetrate the\n> index handling (to fix cases as simple as \"where x = 1 + 1\" which have\n> never worked) the we could fairly easily go back into the parser and\n> brute-force some non-general workarounds to get the few \"worse than\n> before\" cases hacked around.\n> \n> If we _can_ get the index handling to work more generally, then we have\n> substantially enhanced the overall capabilities of Postgres.\n> \n> So far, I haven't seen cases where the parser has tried to do \"the wrong\n> thing\", only cases where \"the right thing\" causes the index handling to\n> miss the boat...\n\nOK, here is what I have. I have a table called test, with one\nattribute. I execute:\n\n\tselect * from test where oid = 3;\n\nand the output plan is:\n\t\n\t(\n\t { EXPR \n\t :typeOid 0 \n\t :opType op \n\t :oper \n\t { OPER \n\t :opno 1137 \n\t :opid 0 \n\t :opresulttype 16 \n\t }\n\t \n\t :args (\n\t { VAR \n\t :varno 1 \n\t :varattno -2 \n\t :vartype 26 \n\t :vartypmod -1 \n\t :varlevelsup 0 \n\t :varnoold 1 \n\t :varoattno -2 \n\t }\n\t \n\t { CONST \n\t :consttype 23 \n\t :constlen 4 \n\t :constisnull false \n\t :constvalue 4 [ 3 0 0 0 ] \n\t :constbyval true\n\t }\n\t )\n\t }\n\t)\n\nWhy does the Var have a type 26(int), and the constant a type of\n23(oid)? Where's the conversion function?\n\t\nNow, the existance of the function doesn't help either, but that is a\ndifferent problem:\n\n\ttest=> explain select * from test where oid = oid(3);\n\tNOTICE: QUERY PLAN:\n\t\n\tSeq Scan on test (cost=1936.05 size=4916 width=8)\n\nIs it because there is a int4eqoid() function? How to use an index on that?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 9 Aug 1998 20:09:57 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> and the output plan is:\n> (\n> { EXPR\n> :typeOid 0\n> :opType op\n> :oper\n> { OPER\n> :opno 1137\n> :opid 0\n> :opresulttype 16\n> }\n> \n> :args (\n> { VAR\n> :varno 1\n> :varattno -2\n> :vartype 26\n> :vartypmod -1\n> :varlevelsup 0\n> :varnoold 1\n> :varoattno -2\n> }\n> \n> { CONST\n> :consttype 23\n> :constlen 4\n> :constisnull false\n> :constvalue 4 [ 3 0 0 0 ]\n> :constbyval true\n> }\n> )\n> }\n> )\n> \n> Why does the Var have a type 26(int), and the constant a type of\n> 23(oid)? Where's the conversion function? \n\nA conversion function is not necessary; the operator in the \"opno\" field\n(1137) corresponds to the oid of the entry in pg_operator for \"=\" with\nthe correct arguments.\n\n> Now, the existance of the function doesn't help either, but that is a\n> different problem:\n> test=> explain select * from test where oid = oid(3);\n> NOTICE: QUERY PLAN:\n> Seq Scan on test (cost=1936.05 size=4916 width=8)\n> Is it because there is a int4eqoid() function?\n\nYes. The function is called int4eqoid() (good guess :). And there is\nalso a function oideqint4(). \n\nThere is a chance that this case would actually work if we just removed\nthose functions, since (in my test code only) I've made int4 and oid\n\"binary compatible\" so the int4eq or oideq routines would be used\ninstead. The index support code might actually behave properly then.\n\n> How to use an index on that?\n\nSo that is the problem for this case; there is actually a function which\nmatches the arguments exactly, so it is specified. *And* the same\nfunction is (probably) not mentioned in the index configuration tables\npg_am*. \n\nHowever, if we allowed the index support code to look for possible\nmatches on indices for the non-constant terms, and then look for the\nbest possible match for conversion routines on other terms, and then did\nan \"optimizer substitution\", we might get better behavior. We would want\ncode to do the same kind of analysis for constant terms with function\ncalls and constant expressions too.\n\nI'd be happy to work on the actual substitution code, but still don't\nknow what the planner does with indices. I'm starting to poke through it\nlike you are, but am farther behind.\n\nI thought a good start would be to try addressing a case like this, and\nallow the planner/indexer/optimizer to substitute \"binary compatible\"\nindices. If we can succeed at that, then we would know what places need\nto be touched to do more, like handling function calls and expressions\nwith constants.\n\n - Tom\n", "msg_date": "Mon, 10 Aug 1998 01:52:22 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> \"Thomas G. Lockhart\" <[email protected]> writes:\n> > So far, I haven't seen cases where the parser has tried to do \"the wrong\n> > thing\", only cases where \"the right thing\" causes the index handling to\n> > miss the boat...\n> \n> I disagree, actually. In the example\n> \n> \tselect ... where i2 = 400;\n> \n> I claim the parser is doing the wrong thing by representing this as\n> \"where int4(i2) = 400::int4\" rather than \"where i2 = 400::int2\".\n> It is not really reasonable to expect the optimizer to clean up\n> after that initial mistake.\n\nI don't see that. If I do:\n\n\tselect * from test2 where i2 = 3;\n\nI don't see any constants being converted. The Var is still i2, and the\nConst is i4. This is as it is seen by the optimizer. It is using\nint24eq(opno = 532). This is valid when doing comparisons in the\nexecutor.\n\nThe problem is how do we use indexes for this? I am still researching\nthis.\n\n\n---------------------------------------------------------------------------\n\n\n(\n { EXPR\n :typeOid 0\n :opType op\n :oper\n { OPER\n :opno 532\n :opid 0\n :opresulttype 16\n }\n\n :args (\n { VAR\n :varno 1\n :varattno 1\n :vartype 21\n :vartypmod -1\n :varlevelsup 0\n :varnoold 1\n :varoattno 1\n }\n\n { CONST\n :consttype 23\n :constlen 4\n :constisnull false\n :constvalue 4 [ 3 0 0 0 ]\n :constbyval true\n }\n )\n }\n)\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 9 Aug 1998 21:57:40 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> > I claim the parser is doing the wrong thing by representing this as\n> > \"where int4(i2) = 400::int4\" rather than \"where i2 = 400::int2\".\n> > It is not really reasonable to expect the optimizer to clean up\n> > after that initial mistake.\n> I don't see that.\n\nYup. The parser is behaving as Bruce describes. The new type conversion\nstuff isn't the fundamental problem. It's the original features in the\nplanner when trying to use indices.\n\n> The problem is how do we use indexes for this? I am still researching\n> this.\n\nOK, let me know if I can help look into anything. In the meantime, I'll\nkeep poking at it a bit...\n\n - Tom\n", "msg_date": "Mon, 10 Aug 1998 02:43:48 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> > > I claim the parser is doing the wrong thing by representing this as\n> > > \"where int4(i2) = 400::int4\" rather than \"where i2 = 400::int2\".\n> > > It is not really reasonable to expect the optimizer to clean up\n> > > after that initial mistake.\n> > I don't see that.\n> \n> Yup. The parser is behaving as Bruce describes. The new type conversion\n> stuff isn't the fundamental problem. It's the original features in the\n> planner when trying to use indices.\n> \n> > The problem is how do we use indexes for this? I am still researching\n> > this.\n> \n> OK, let me know if I can help look into anything. In the meantime, I'll\n> keep poking at it a bit...\n\nThe optimizer does a loop for each index on every relation:\n\nIn match_clause_to_indexkey(), there is code that takes the\noperator, in the case of \"oid = 3\", value 1137, oideqint4:\n\n if ((rightop && IsA(rightop, Const)) ||\n (rightop && IsA(rightop, Param)))\n {\n restrict_op = ((Oper *) ((Expr *) clause)->oper)->opno;\n isIndexable = (op_class(restrict_op, xclass, index->relam) &&\n IndexScanableOperand(leftop,\n indexkey,\n rel,\n index));\n }\n\n \nand calls opclass(), which does a lookup in the pg_amop cache, passing\nthe operator oid (1137), the access method class oid, and the index\naccess method:\n\n\t#0 op_class (opno=1137, opclass=427, amopid=403) at lsyscache.c:58\n oideqint4 oid_ops btree_am_oid\n\n\nand it returns false because there is no access operator for oid_ops and\nbtree_am_oid that matches oideqint4.\n\nThe fundamental problem is that index scans are made to compare columns\nall of the same type. That is how indexes are built and traversed. \nNow, we want to bring in a constant of another type, and have it use an\nindex.\n\nSounds like if we add the proper pg_am functions for binary\ncompatability, the optimizer should then use the proper indexes.\n\nThomas?\n\n[I am going to bed now.]\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 10 Aug 1998 00:50:27 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> > > I claim the parser is doing the wrong thing by representing this as\n> > > \"where int4(i2) = 400::int4\" rather than \"where i2 = 400::int2\".\n> > > It is not really reasonable to expect the optimizer to clean up\n> > > after that initial mistake.\n> > I don't see that.\n> \n> Yup. The parser is behaving as Bruce describes. The new type conversion\n> stuff isn't the fundamental problem. It's the original features in the\n> planner when trying to use indices.\n> \n> > The problem is how do we use indexes for this? I am still researching\n> > this.\n> \n> OK, let me know if I can help look into anything. In the meantime, I'll\n> keep poking at it a bit...\n\nI have also looked at x = oid(3) to see why functions are not being\nused. That same function I mentioned match_clause_to_indexkey clearly\nshows it does not support this:\n\n /*\n * If this is not a join clause, check for clauses of the form:\n * (operator var/func constant) and (operator constant var/func)\n */\n if (!join)\n {\n /*\n * Check for standard s-argable clause\n */\n if ((rightop && IsA(rightop, Const)) ||\n (rightop && IsA(rightop, Param)))\n {\n restrict_op = ((Oper *) ((Expr *) clause)->oper)->opno;\n isIndexable = (op_class(restrict_op, xclass, index->relam) &&\n \n\nThey want to use a functional index for oid(), but we are computing it\non a constant. Some code will have to be added somewhere to handle\nthis. If we want it done in the executor, perhaps we can look inside\nthe function to see if they are all consts, and handle it somehow.\n\nOf course, if a function index does match, we should use that first.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 10 Aug 1998 01:01:06 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> The fundamental problem is that index scans are made to compare columns\n> all of the same type. That is how indexes are built and traversed. \n> Now, we want to bring in a constant of another type, and have it use an\n> index.\n> \n> Sounds like if we add the proper pg_am functions for binary\n> compatability, the optimizer should then use the proper indexes.\n\nFOLLOWUP:\n\nThis may fix our int4/oid problem, but I don't think it addresses the\nmore common problems like int2/int4. I can't see how that would work\nwith just additions to pg_amop.\n\nYes, we have the int2eqint4 function, but how does that work in an\nindex. Actually, it was my understanding that the new conversion code\nwas going to get rid of the int2eqint4 style functions, and replace them\nwith conversions. \n\nThomas, perhaps a quick summary of the logic behind your parser\nconversion changes would help.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 10 Aug 1998 01:09:10 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> Sounds like if we add the proper pg_am functions for binary\n> compatability, the optimizer should then use the proper indexes.\n> \n\nI just tried this and it failed. Not sure why yet:\n\t\n\ttest=> explain select * from test where oid = 3;\n\tNOTICE: QUERY PLAN:\n\t\n\tSeq Scan on test (cost=1936.05 size=1 width=8)\n\t\n\tEXPLAIN\n\ttest=> create index i_test3 on test(oid oidint4ops);\n\tERROR: DefineIndex: oidint4ops class not found\n\ttest=> create index i_test3 on test(oid oidint4_ops);\n\tvacuum ;\n\tCREATE\n\ttest=> vacuum ;\n\tVACUUM\n\ttest=> explain select * from test where oid = 3;\n\tNOTICE: QUERY PLAN:\n\t\n\tSeq Scan on test (cost=1936.05 size=1 width=8)\n\t\n\tEXPLAIN\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 10 Aug 1998 09:55:08 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> \t#0 op_class (opno=1137, opclass=427, amopid=403) at lsyscache.c:58\n> oideqint4 oid_ops btree_am_oid\n> \n> \n> and it returns false because there is no access operator for oid_ops and\n> btree_am_oid that matches oideqint4.\n> \n> The fundamental problem is that index scans are made to compare columns\n> all of the same type. That is how indexes are built and traversed. \n> Now, we want to bring in a constant of another type, and have it use an\n> index.\n> \n> Sounds like if we add the proper pg_am functions for binary\n> compatability, the optimizer should then use the proper indexes.\n\nI think I have found part of the cause. We have duplicate type\nconversion functions, and the parser is choosing the one that is not in\nthe access method tables.\n\n\n---------------------------------------------------------------------------\n\n\ntest=> select * from pg_operator where oid = 1137;\noprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode\n |oprrest|oprjoin\n-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+---------+-------+---------\n= | 139| 0|b |t |t | 26| 23| \n 16| 1136| 0| 0| 0|oideqint4|eqsel \n|eqjoinsel (1 row)\n\n\ntest=> select * from pg_operator where oid = 932;\noprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode\n |oprrest |oprjoin\n-------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+---------+--------+------------\n= | 139| 0|b |t |f | 910| 910| \n 16| 932| 935| 0| 0|oidint4eq|intltsel|intltjoinsel (1 row)\n\nt\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 00:45:42 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> test=> select * from pg_operator where oid = 1137;\n> oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode\n> |oprrest|oprjoin\n> -------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+---------+-------+---------\n> = | 139| 0|b |t |t | 26| 23| \n> 16| 1136| 0| 0| 0|oideqint4|eqsel \n> |eqjoinsel (1 row)\n> \n> \n> test=> select * from pg_operator where oid = 932;\n> oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode\n> |oprrest |oprjoin\n> -------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+---------+--------+------------\n> = | 139| 0|b |t |f | 910| 910| \n> 16| 932| 935| 0| 0|oidint4eq|intltsel|intltjoinsel (1 row)\n\nI was wrong about the above entries. oidint4eq is for a custom type\nthat is made up of and oid and an int4. Strange but true. Probably\nshould be removed. Can't imagine why someone would use this. Probably\nused when we didn't have multi-key indexes or something.\n\nAnyway, here is a query that shows the operators defined for access\nmethods.\n\t\n\tSELECT proname\n\tFROM pg_operator, pg_amop,pg_proc\n\tWHERE amopopr = pg_operator.oid AND \n\t RegprocToOid(pg_operator.oprcode) = pg_proc.oid;\n\n\nPerhaps if i add oid am functions to use the int4 functions, it would\nwork. int4int2eq assumes promotion of int2 to int4. Should work.\n\nproname \n----------------\nchareq \nchareq \nnameeq \nnameeq \nint2eq \nint2eq \nint2lt \nint4eq \nint4eq \nint4lt \ntexteq \ntexteq \npoly_left \npoly_overleft \npoly_overright \npoly_right \npoly_contained \npoly_contain \npoly_same \npoly_overlap \nbox_left \nbox_left \nbox_overleft \nbox_overleft \nbox_overright \nbox_overright \nbox_right \nbox_right \nbox_contained \nbox_contained \nbox_contain \nbox_contain \nbox_same \nbox_same \nbox_overlap \nbox_overlap \nint2gt \nint4gt \nint2le \nint4le \nint2ge \nint4ge \nint24eq \nint42eq \nint24lt \nint42lt \nint24gt \nint42gt \nint24le \nint42le \nint24ge \nint42ge \nabstimeeq \nabstimelt \nabstimegt \nabstimele \nabstimege \noideq \noideq \nint4lt \nint4gt \nint4le \nint4ge \nfloat4eq \nfloat4eq \nfloat4lt \nfloat4gt \nfloat4le \nfloat4ge \ncharlt \ncharle \nchargt \ncharge \nnamelt \nnamele \nnamegt \nnamege \ntext_lt \ntext_le \ntext_gt \ntext_ge \nfloat8eq \nfloat8eq \nfloat8lt \nfloat8le \nfloat8gt \nfloat8ge \noidnamelt \noidnamele \noidnameeq \noidnamege \noidnamegt \noidint2lt \noidint2le \noidint2eq \noidint2ge \noidint2gt \noidint4lt \noidint4le \noidint4eq \noidint4ge \noidint4gt \nbpchareq \nbpchareq \nbpcharlt \nbpcharle \nbpchargt \nbpcharge \nvarchareq \nvarchareq \nvarcharlt \nvarcharle \nvarchargt \nvarcharge \ndate_eq \ndate_eq \ndate_lt \ndate_le \ndate_gt \ndate_ge \ntime_eq \ntime_eq \ntime_lt \ntime_le \ntime_gt \ntime_ge \ndatetime_eq \ndatetime_eq \ndatetime_lt \ndatetime_le \ndatetime_gt \ndatetime_ge \ntimespan_eq \ntimespan_eq \ntimespan_lt \ntimespan_le \ntimespan_gt \ntimespan_ge \ncircle_left \ncircle_overleft \ncircle_overright\ncircle_right \ncircle_contained\ncircle_contain \ncircle_same \ncircle_overlap \n(146 rows)\n\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 01:08:29 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> I think I have found part of the cause. We have duplicate type\n> conversion functions, and the parser is choosing the one that is not \n> in the access method tables.\n\nI don't think so for this case; I got stuck on this for awhile too. It\nseems that \"oidint4\" is an actual data type, so has an \"oidint4eq\"\ncomparison function. The parser/planner/optimizer is finding the correct\nfunctions, which are \"oideqint4\" and \"int4eqoid\". \n\nDon't know what \"oidint4\" actually does or how it's used. Confusing...\n\n - Tom\n\n---------------------------------------------------------------------------\n> \n> test=> select * from pg_operator where oid = 1137;\n> oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode\n> |oprrest|oprjoin\n> -------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+---------+-------+---------\n> = | 139| 0|b |t |t | 26| 23|\n> 16| 1136| 0| 0| 0|oideqint4|eqsel\n> |eqjoinsel (1 row)\n> \n> test=> select * from pg_operator where oid = 932;\n> oprname|oprowner|oprprec|oprkind|oprisleft|oprcanhash|oprleft|oprright|oprresult|oprcom|oprnegate|oprlsortop|oprrsortop|oprcode\n> |oprrest |oprjoin\n> -------+--------+-------+-------+---------+----------+-------+--------+---------+------+---------+----------+----------+---------+--------+------------\n> = | 139| 0|b |t |f | 910| 910|\n> 16| 932| 935| 0| 0|oidint4eq|intltsel|intltjoinsel (1 row)\n", "msg_date": "Tue, 11 Aug 1998 05:36:21 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> > I think I have found part of the cause. We have duplicate type\n> > conversion functions, and the parser is choosing the one that is not \n> > in the access method tables.\n> \n> I don't think so for this case; I got stuck on this for awhile too. It\n> seems that \"oidint4\" is an actual data type, so has an \"oidint4eq\"\n> comparison function. The parser/planner/optimizer is finding the correct\n> functions, which are \"oideqint4\" and \"int4eqoid\". \n> \n> Don't know what \"oidint4\" actually does or how it's used. Confusing...\n\nOK, new information. The following query shows the pg_proc names for\noid.*int4:\n\nselect pg_operator.oid as pg_operator_oid, pg_proc.proname from pg_proc,\npg_operator where proname ~ 'oid.*int4' and pg_proc.oid =\nRegprocToOid(pg_operator.oprcode)\n\npg_operator_oid|proname\n---------------+---------\n 1137|oideqint4\n 930|oidint4lt\n 931|oidint4le\n 932|oidint4eq\n 933|oidint4ge\n 934|oidint4gt\n 935|oidint4ne\n(7 rows)\n\nThe pg_operator_oid is the value stored in pg_amop.amopopr field. The\noptimizer is finding a function that works for the query, in our case\noideqint4, with a pg_operator oid of 1137.\n\nThe problem is that there is no pg_am.amopopr for 1137. What is defined\nfor oid is this:\n\n/*\n * nbtree oid_ops\n */\n\nDATA(insert OID = 0 ( 403 427 609 1 btreesel btreenpage ));\nDATA(insert OID = 0 ( 403 427 611 2 btreesel btreenpage ));\nDATA(insert OID = 0 ( 403 427 607 3 btreesel btreenpage ));\nDATA(insert OID = 0 ( 403 427 612 4 btreesel btreenpage ));\nDATA(insert OID = 0 ( 403 427 610 5 btreesel btreenpage ));\n\nFor example, the third number in the third line is 607, which is the\namopopr, and is oideq. We know we can use this for the query because\nint4 and oid are identical, but the parser has already chosen the more\nappopriate 1137/oideqint4. If we could add an extra line to this file,\nperhaps:\n\nDATA(insert OID = 0 ( 403 427 607 3 btreesel btreenpage ));\n\nHowever, I don't think the access methods allow more than one line in\nthis way.\n\nThe other problem is that there is not a <, >, etc for int4/oid, so a\nseparate op type can not be created. In fact, I am not sure it would\nwork anyway. I think the operator oid chosen by the backend must\nEXACTLY match the oid stored in pg_amop.amopopr for the index to be\nused.\n\nThat is what match_clause_to_indexkey is doing by calling op_class().\n\n[Update you source trees. The op_class parameter names were wrong,\ncalled opid instead of opno, so it was very confusing. Fixed now.]\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 02:03:46 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> For example, the third number in the third line is 607, which is the\n> amopopr, and is oideq. We know we can use this for the query because\n> int4 and oid are identical, but the parser has already chosen the more\n> appopriate 1137/oideqint4. If we could add an extra line to this file,\n> perhaps:\n> \n> DATA(insert OID = 0 ( 403 427 607 3 btreesel btreenpage ));\n> \n> However, I don't think the access methods allow more than one line in\n> this way.\n\nI just tried adding the extra line, and initdb failed. I wonder if we\nremove the oideqint4, if the parser will go for oideq?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 02:30:13 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> I just tried adding the extra line, and initdb failed. I wonder if we\n> remove the oideqint4, if the parser will go for oideq?\n\nIf you want to try this as an experiment, so we can tell if this is a\npossible solution, then great. I still have hopes that we can substitute\nother parse trees and strategies within the index utilization routines,\nso how about not committing things until we've tried a few options.\n\nmatch_clause_to_indexkey() seems to be a starting point for what I want\nto do. Will let you know how it goes...\n\n - Tom\n", "msg_date": "Wed, 12 Aug 1998 02:44:24 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> > I just tried adding the extra line, and initdb failed. I wonder if we\n> > remove the oideqint4, if the parser will go for oideq?\n> \n> If you want to try this as an experiment, so we can tell if this is a\n> possible solution, then great. I still have hopes that we can substitute\n> other parse trees and strategies within the index utilization routines,\n> so how about not committing things until we've tried a few options.\n> \n> match_clause_to_indexkey() seems to be a starting point for what I want\n> to do. Will let you know how it goes...\n\nOK. Check out my other posts on how op_class/pg_amop.amopopr is used to\nlook up if the current expression operator is a member of the\nclass(btree), and index opclass(oid_ops). I could probably code\nsomething so you could put multiple entries in pg_amop. My issue is\nthat there are not that many interchangable operators to make that\nuseful.\n\nNow, if you are thinking of doing some type of constant conversion\nthere, that may be a bigger win. The issue is at this point in the\ncode, there is no guarentee the index will be used. It is just checking\nthe index usability.\n\nI think I see where you are going with this. For queries not involving\nindexes(many joins don't), it may be better to leave things for the\nexecutor.\n\nAlso, if you can, do a fresh cvs update if you can, because the code is\na little cleaner now in that area. Particularly, the op_class()\nparameters were badly named, causing me confusion.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 23:23:20 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> > However, I don't think the access methods allow more than one line in\n> > this way.\n> \n> I just tried adding the extra line, and initdb failed. I wonder if we\n> remove the oideqint4, if the parser will go for oideq?\n> \n\nOne other item. oid indexes use int4lt(), etc. for their internal\nindexing, not oidlt() because they do not exist.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 12 Aug 1998 12:41:39 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> > match_clause_to_indexkey() seems to be a starting point for what I \n> > want to do. Will let you know how it goes...\n> Check out my other posts on how op_class/pg_amop.amopopr is used to\n> look up if the current expression operator is a member of the\n> class(btree), and index opclass(oid_ops). I could probably code\n> something so you could put multiple entries in pg_amop. My issue is\n> that there are not that many interchangable operators to make that\n> useful.\n> Now, if you are thinking of doing some type of constant conversion\n> there, that may be a bigger win. The issue is at this point in the\n> code, there is no guarentee the index will be used. It is just \n> checking the index usability.\n> I think I see where you are going with this. For queries not \n> involving indexes(many joins don't), it may be better to leave things \n> for the executor.\n\nThe first thing I want to try is to substitute the operator for types\nwhich are known to be binary-compatible and do not have their own index\ndefined. The next step would be to substitute an operator _and_ insert\nan explicit type conversion using a function call (which may not work\nyet for other reasons). Don't know where Vadim's PARAM_EXEC node comes\nin, but if it does it might be around here.\n\n> ... if you can, do a fresh cvs update if you can, because the code is\n> a little cleaner now in that area. Particularly, the op_class()\n> parameters were badly named, causing me confusion.\n\nOK. Does the current source tree compile now? Haven't had much time to\nlook at it the last few days, but will start poking at it this evening a\nbit.\n\n - Tom\n", "msg_date": "Thu, 13 Aug 1998 02:58:03 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> The first thing I want to try is to substitute the operator for types\n> which are known to be binary-compatible and do not have their own index\n> defined. The next step would be to substitute an operator _and_ insert\n> an explicit type conversion using a function call (which may not work\n> yet for other reasons). Don't know where Vadim's PARAM_EXEC node comes\n> in, but if it does it might be around here.\n> \n> > ... if you can, do a fresh cvs update if you can, because the code is\n> > a little cleaner now in that area. Particularly, the op_class()\n> > parameters were badly named, causing me confusion.\n> \n> OK. Does the current source tree compile now? Haven't had much time to\n> look at it the last few days, but will start poking at it this evening a\n> bit.\n\nYep. Only been down for a few hours in the past month, at least for me.\nI am working on another huge patch, but it will be tested before\ninstall, of course.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 13 Aug 1998 00:59:54 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> > The first thing I want to try is to substitute the operator for \n> > types which are known to be binary-compatible and do not have their \n> > own index defined.\n\nGot a start on it :)\n\nregression=> explain select * from tenk1 where oid = 3000;\nNOTICE: QUERY PLAN:\n\nIndex Scan using tenk1_oid on tenk1 (cost=2.05 size=1 width=148)\n\nEXPLAIN\n\nSo far, I've just done the right-hand form (the one with the constant on\nthe rhs of the expression). The left-hand form should be easy now.\n\nSo, just curious: if we stop here, and only match up binary-compatible\nbuilt-in types with available indices, then what v6.3.2 features/good\nbehaviors are still missing?\n\n - Tom\n\nThe example is from the regression test database with an extra btree\nindex built on the tenk1 table...\n\nregression=> \\d tenk1\n\nTable = tenk1\n+----------------------------------+----------------------------------+-------+\n| Field | Type |\nLength|\n+----------------------------------+----------------------------------+-------+\n| unique1 | int4 \n| 4 |\n| unique2 | int4 \n| 4 |\n| two | int4 \n| 4 |\n| four | int4 \n| 4 |\n| ten | int4 \n| 4 |\n| twenty | int4 \n| 4 |\n| hundred | int4 \n| 4 |\n| thousand | int4 \n| 4 |\n| twothousand | int4 \n| 4 |\n| fivethous | int4 \n| 4 |\n| tenthous | int4 \n| 4 |\n| odd | int4 \n| 4 |\n| even | int4 \n| 4 |\n| stringu1 | name \n| 32 |\n| stringu2 | name \n| 32 |\n| string4 | name \n| 32 |\n+----------------------------------+----------------------------------+-------+\nIndices: tenk1_hundred\n tenk1_oid\n tenk1_unique1\n tenk1_unique2\nregression=>\n", "msg_date": "Thu, 13 Aug 1998 14:30:18 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> > > The first thing I want to try is to substitute the operator for \n> > > types which are known to be binary-compatible and do not have their \n> > > own index defined.\n> \n> Got a start on it :)\n> \n> regression=> explain select * from tenk1 where oid = 3000;\n> NOTICE: QUERY PLAN:\n> \n> Index Scan using tenk1_oid on tenk1 (cost=2.05 size=1 width=148)\n> \n> EXPLAIN\n> \n> So far, I've just done the right-hand form (the one with the constant on\n> the rhs of the expression). The left-hand form should be easy now.\n> \n> So, just curious: if we stop here, and only match up binary-compatible\n> built-in types with available indices, then what v6.3.2 features/good\n> behaviors are still missing?\n\nDid you put it in the optimizer?\n\nI think binary compatable types converted is going to be the easiest\nthing to do for index use. Not sure how you could try and break it. \nHow about character string comparisons using indexes?\n\n> | 32 |\n> +----------------------------------+----------------------------------+-------+\n> Indices: tenk1_hundred\n> tenk1_oid\n> tenk1_unique1\n> tenk1_unique2\n ^^^^^^^^^^^^^^^^^^^^^^^^^\n\nHow about that new display?\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 13 Aug 1998 11:05:17 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> > > > The first thing I want to try is to substitute the operator for\n> > > > types which are known to be binary-compatible and do not have \n> > > > their own index defined.\n> > Got a start on it :)\n> > regression=> explain select * from tenk1 where oid = 3000;\n> > Index Scan using tenk1_oid on tenk1 (cost=2.05 size=1 width=148)\n> > So, just curious: if we stop here, and only match up \n> > binary-compatible built-in types with available indices, then what \n> > v6.3.2 features/good behaviors are still missing?\n> Did you put it in the optimizer?\n\nIt is inside backend/optimizer/path/indxpath.c. I'm using a bit of the\nparser support code to help out. It has to be where the backend actually\nis checking to see if an index is usable, which is in the optimization\nstep. Any earlier and we would have to look-ahead at the indices which\nseems inappropriate.\n\n> I think binary compatable types converted is going to be the easiest\n> thing to do for index use. Not sure how you could try and break it.\n> How about character string comparisons using indexes?\n\nWill try some more tests, but it seems like it will be hard to break\nsince it only comes into effect with built-in datatypes which are\nsupposed to be binary compatible.\n\nIt would be interesting to try to do constant expressions and function\ncalls on constants next, though I'm thinking that it isn't required for\nv6.4.\n\nVadim, will the executor know how to use a PARAM_EXEC node in any\ncontext, or will we have to do some coding to get it recognized outside\nof subselects? I'll need to figure out how to build one too, I\nsuppose...\n\n - Tom\n", "msg_date": "Fri, 14 Aug 1998 04:24:49 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "Thomas G. Lockhart wrote:\n> \n> > > > > The first thing I want to try is to substitute the operator for\n> > > > > types which are known to be binary-compatible and do not have\n> > > > > their own index defined.\n> > > Got a start on it :)\n> > > regression=> explain select * from tenk1 where oid = 3000;\n> > > Index Scan using tenk1_oid on tenk1 (cost=2.05 size=1 width=148)\n> > > So, just curious: if we stop here, and only match up\n> > > binary-compatible built-in types with available indices, then what\n> > > v6.3.2 features/good behaviors are still missing?\n> > Did you put it in the optimizer?\n> \n> It is inside backend/optimizer/path/indxpath.c. I'm using a bit of the\n> parser support code to help out. It has to be where the backend actually\n> is checking to see if an index is usable, which is in the optimization\n> step. Any earlier and we would have to look-ahead at the indices which\n> seems inappropriate.\n> \n> > I think binary compatable types converted is going to be the easiest\n> > thing to do for index use. Not sure how you could try and break it.\n> > How about character string comparisons using indexes?\n> \n> Will try some more tests, but it seems like it will be hard to break\n> since it only comes into effect with built-in datatypes which are\n> supposed to be binary compatible.\n\nOK, I've just committed to the source tree changes for looking for\nbinary-compatible indices when either the left- or right-hand side of\nthe restriction clause is a constant.\n\nI've #ifndef'd them so we can disable it if necessary. But, all of the\nregression tests pass, except for the select_view test, which has been\ncore dumping for weeks. Anyone else seeing that, or is it just me? :(\n\n - Tom\n", "msg_date": "Sat, 15 Aug 1998 01:32:44 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "\"Thomas G. Lockhart\" <[email protected]> writes:\n> ... all of the\n> regression tests pass, except for the select_view test, which has been\n> core dumping for weeks. Anyone else seeing that, or is it just me? :(\n\nI rebuilt the system from current sources today, and ran the regression\ntests for the first time in a long time. select_views works fine for\nme, but there are several other tests that look badly broken:\nSELECT ... ORDER BY upper(c) is misordering the results in select_implicit,\nGROUP BY on a datetime is not working right in select_having, and the\nrandom test is failing because it \"can't look up operator 713\".\n\nI'm on HP-UX 9.03, PA-RISC 1.1, gcc 2.7.2.2 if that helps.\n\n\t\t\tregards, tom lane\n\n\n*** expected/select_implicit.out\tSat Aug 15 11:56:03 1998\n--- results/select_implicit.out\tSat Aug 15 13:44:16 1998\n***************\n*** 213,226 ****\n QUERY: SELECT a FROM test_missing_target ORDER BY upper(c);\n a\n -\n- 1\n 2\n 3\n 4\n 5\n 6\n- 7\n 8\n 9\n 0\n (10 rows)\n--- 213,226 ----\n QUERY: SELECT a FROM test_missing_target ORDER BY upper(c);\n a\n -\n 2\n+ 1\n 3\n 4\n 5\n 6\n 8\n+ 7\n 9\n 0\n (10 rows)\n\n----------------------\n\n*** expected/select_having.out\tWed Jul 8 10:29:09 1998\n--- results/select_having.out\tSat Aug 15 13:44:16 1998\n***************\n*** 2,12 ****\n GROUP BY d1 HAVING count(*) > 1;\n d1 |count\n ----------------------------+-----\n! Thu Jun 13 00:00:00 1957 PDT| 2\n! Mon Feb 10 09:32:01 1997 PST| 3\n! Mon Feb 10 17:32:01 1997 PST| 13\n Sun Feb 16 17:32:01 1997 PST| 2\n Sat Mar 01 17:32:01 1997 PST| 2\n! invalid | 2\n! (6 rows)\n \n--- 2,13 ----\n GROUP BY d1 HAVING count(*) > 1;\n d1 |count\n ----------------------------+-----\n! Thu Jun 13 00:00:00 1957 PST| 2\n! Mon Feb 10 17:32:01 1997 PST| 4\n! Mon Feb 10 09:32:01 1997 PST| 2\n! Mon Feb 10 17:32:01 1997 PST| 2\n! Mon Feb 10 17:32:01 1997 PST| 7\n Sun Feb 16 17:32:01 1997 PST| 2\n Sat Mar 01 17:32:01 1997 PST| 2\n! (7 rows)\n \n\n----------------------\n\n*** expected/random.out\tTue Apr 29 10:23:40 1997\n--- results/random.out\tSat Aug 15 13:44:19 1998\n***************\n*** 5,18 ****\n (1 row)\n \n QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n! count\n! -----\n! 92\n! (1 row)\n \n QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n! count\n! -----\n! 98\n! (1 row)\n \n--- 5,12 ----\n (1 row)\n \n QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n! ERROR: can't look up operator 713\n \n QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n! ERROR: can't look up operator 713\n \n\n----------------------\n", "msg_date": "Sat, 15 Aug 1998 14:18:30 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Regression test status (was type coersion)" }, { "msg_contents": "> > ... all of the\n> > regression tests pass, except for the select_view test, which has \n> > been core dumping for weeks. Anyone else seeing that?\n> I ... ran the regression\n> tests for the first time in a long time. select_views works fine for\n> me, but there are several other tests that look badly broken:\n> I'm on HP-UX 9.03, PA-RISC 1.1, gcc 2.7.2.2 if that helps.\n\nHmm. I'm on Linux-libc5, i686, gcc 2.7.2.1, and select_views is still\ncore dumping:\n\nQUERY: SELECT * FROM toyemp WHERE name = 'sharon';\npqReadData() -- backend closed the channel unexpectedly.\n\n> --- results/select_implicit.out Sat Aug 15 13:44:16 1998\n> --- results/select_having.out Sat Aug 15 13:44:16 1998\n\nThese two pass on my machine. Your select_having result looks similar to\nthe sorting results back when the in-memory/on-disk sorting routines\nwere broken; some identical values are not getting grouped together\nwhile others are.\n\n> --- results/random.out Sat Aug 15 13:44:19 1998\n> QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> ! ERROR: can't look up operator 713\n\nAh. I am getting failures on this too but didn't actually look at why,\njust assuming that the randomizer was doing better nowadays. This is\nprobably related to something I, or possibly Bruce or David, had done.\nIf you change the query to\n\n SELECT count(*) FROM onek where oidrand(onek.oid, 10) = TRUE;\n\nthen it works. I'll look at it. Darn, I had just stripped out the\ndebugging stuff in the code before submitting it, since leaving it\nhanging around was annoying Bruce (with good reason btw).\n\n - Tom\n", "msg_date": "Sun, 16 Aug 1998 04:36:55 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Regression test status (was type coersion)" }, { "msg_contents": "> > --- results/random.out Sat Aug 15 13:44:19 1998\n> > QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> > ! ERROR: can't look up operator 713\n> Ah. I am getting failures on this too but didn't actually look at why,\n> just assuming that the randomizer was doing better nowadays. This is\n> probably related to something I, or possibly Bruce or David, had done.\n\nOK, I just committed patches which fixes this problem. The index\nstrategy code used to just check for an available operator, but I had\nchanged it to try an alternate strategy by looking for the same operator\nwith different types. But the same code gets executed even if the\nrestriction clause is just a function returning a boolean, with no\noperator involved at all.\n\nI now allow the operator name lookup to return a null pointer if an\nalternate does not exist, and then the code stops looking for\nalternatives.\n\nSo now the \"random\" test still fails, but in a good way with the\nexpected results...\n\n - Tom\n", "msg_date": "Sun, 16 Aug 1998 05:53:16 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Regression test status (was type coersion)" }, { "msg_contents": "\n\nTom Lane wrote:\n\n> I rebuilt the system from current sources today, and ran the regression\n> tests for the first time in a long time. select_views works fine for\n> me, but there are several other tests that look badly broken:\n> SELECT ... ORDER BY upper(c) is misordering the results in select_implicit,\n> GROUP BY\n> regards, tom lane\n>\n> *** expected/select_implicit.out Sat Aug 15 11:56:03 1998\n> --- results/select_implicit.out Sat Aug 15 13:44:16 1998\n> ***************\n> *** 213,226 ****\n> QUERY: SELECT a FROM test_missing_target ORDER BY upper(c);\n> a\n> -\n> - 1\n> 2\n> 3\n> 4\n> 5\n> 6\n> - 7\n> 8\n> 9\n> 0\n> (10 rows)\n> --- 213,226 ----\n> QUERY: SELECT a FROM test_missing_target ORDER BY upper(c);\n> a\n> -\n> 2\n> + 1\n> 3\n> 4\n> 5\n> 6\n> 8\n> + 7\n> 9\n> 0\n> (10 rows)\n>\n\n\nInteresting. I do not recall my exact data set in the regression, but I\nbelieve both results are correct. In some sense, on your machine\nupper('CCCC') and upper('cccc') are sorting in a different order then my\nmachine. I realize that internally they are actually ordinally tied. But I\nthought they should still produce a predictable, uniform, result set. Either,\nthere is a bug or I need more reliable test data. I will verify this when I\nget home.\n\n", "msg_date": "Mon, 17 Aug 1998 09:46:29 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Regression test status (was type coersion)" }, { "msg_contents": "Thomas G. Lockhart wrote:\n> \n> It is inside backend/optimizer/path/indxpath.c. I'm using a bit of the\n> parser support code to help out. It has to be where the backend actually\n> is checking to see if an index is usable, which is in the optimization\n> step. Any earlier and we would have to look-ahead at the indices which\n> seems inappropriate.\n\nJust let me note that function calls on constants is problem not \nonly for indices using. Call lower() for each tuple in\nWHERE a = lower('bbb') is always bad - lower() eats memory...\n\n> > I think binary compatable types converted is going to be the easiest\n> > thing to do for index use. Not sure how you could try and break it.\n> > How about character string comparisons using indexes?\n\nParser could use type_in()/type_out() funcs to do type\ncoersion...\n\n> \n> Will try some more tests, but it seems like it will be hard to break\n> since it only comes into effect with built-in datatypes which are\n> supposed to be binary compatible.\n> \n> It would be interesting to try to do constant expressions and function\n> calls on constants next, though I'm thinking that it isn't required for\n> v6.4.\n> \n> Vadim, will the executor know how to use a PARAM_EXEC node in any\n> context, or will we have to do some coding to get it recognized outside\n> of subselects? I'll need to figure out how to build one too, I\n> suppose...\n\nI'm not sure... But imho, PARAM_EXEC could be usefull for \nnow() etc funcs - for non-variant funcs I would suggest\njust evaluate them in parser...\n\nVadim\n", "msg_date": "Tue, 18 Aug 1998 12:13:06 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> Just let me note that function calls on constants is problem not\n> only for indices using. Call lower() for each tuple in\n> WHERE a = lower('bbb') is always bad - lower() eats memory...\n\nSure, so we want to evaluate as a constant. I've found a place in the\ncode where a function gets evaluated immediately; don't remember where\nbut it looked like an interesting possibility.\n\n> > > How about character string comparisons using indexes?\n> Parser could use type_in()/type_out() funcs to do type\n> coersion...\n\nThat is what it used to try to do. But I don't think that generalizes\nvery well. For example, at the moment floating point numbers without\nfractional parts are printed without a decimal point or trailing digits,\nbut we could decide to format them with a \".0\" at the end. Then they\ncouldn't be converted to an integer...\n\n> > Vadim, will the executor know how to use a PARAM_EXEC node in any\n> > context, or will we have to do some coding to get it recognized \n> > outside of subselects? I'll need to figure out how to build one too, \n> > I suppose...\n> I'm not sure... But imho, PARAM_EXEC could be usefull for\n> now() etc funcs - for non-variant funcs I would suggest\n> just evaluate them in parser...\n\nBut it could be used for every function called with constants, right? If\nit works for everything, why bother with other special cases?\n\n - Tom\n", "msg_date": "Tue, 18 Aug 1998 05:22:17 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "> OK, I've just committed to the source tree changes for looking for\n> binary-compatible indices when either the left- or right-hand side of\n> the restriction clause is a constant.\n> \n> I've #ifndef'd them so we can disable it if necessary. But, all of the\n> regression tests pass, except for the select_view test, which has been\n> core dumping for weeks. Anyone else seeing that, or is it just me? :(\n\nIs this fixed? Are there any open problems with the regress tests?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 23 Aug 1998 18:12:09 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: type coersion (was OR clause status)" }, { "msg_contents": "Do any of these problems still exist?\n\n> \"Thomas G. Lockhart\" <[email protected]> writes:\n> > ... all of the\n> > regression tests pass, except for the select_view test, which has been\n> > core dumping for weeks. Anyone else seeing that, or is it just me? :(\n> \n> I rebuilt the system from current sources today, and ran the regression\n> tests for the first time in a long time. select_views works fine for\n> me, but there are several other tests that look badly broken:\n> SELECT ... ORDER BY upper(c) is misordering the results in select_implicit,\n> GROUP BY on a datetime is not working right in select_having, and the\n> random test is failing because it \"can't look up operator 713\".\n> \n> I'm on HP-UX 9.03, PA-RISC 1.1, gcc 2.7.2.2 if that helps.\n> \n> \t\t\tregards, tom lane\n> \n> \n> *** expected/select_implicit.out\tSat Aug 15 11:56:03 1998\n> --- results/select_implicit.out\tSat Aug 15 13:44:16 1998\n> ***************\n> *** 213,226 ****\n> QUERY: SELECT a FROM test_missing_target ORDER BY upper(c);\n> a\n> -\n> - 1\n> 2\n> 3\n> 4\n> 5\n> 6\n> - 7\n> 8\n> 9\n> 0\n> (10 rows)\n> --- 213,226 ----\n> QUERY: SELECT a FROM test_missing_target ORDER BY upper(c);\n> a\n> -\n> 2\n> + 1\n> 3\n> 4\n> 5\n> 6\n> 8\n> + 7\n> 9\n> 0\n> (10 rows)\n> \n> ----------------------\n> \n> *** expected/select_having.out\tWed Jul 8 10:29:09 1998\n> --- results/select_having.out\tSat Aug 15 13:44:16 1998\n> ***************\n> *** 2,12 ****\n> GROUP BY d1 HAVING count(*) > 1;\n> d1 |count\n> ----------------------------+-----\n> ! Thu Jun 13 00:00:00 1957 PDT| 2\n> ! Mon Feb 10 09:32:01 1997 PST| 3\n> ! Mon Feb 10 17:32:01 1997 PST| 13\n> Sun Feb 16 17:32:01 1997 PST| 2\n> Sat Mar 01 17:32:01 1997 PST| 2\n> ! invalid | 2\n> ! (6 rows)\n> \n> --- 2,13 ----\n> GROUP BY d1 HAVING count(*) > 1;\n> d1 |count\n> ----------------------------+-----\n> ! Thu Jun 13 00:00:00 1957 PST| 2\n> ! Mon Feb 10 17:32:01 1997 PST| 4\n> ! Mon Feb 10 09:32:01 1997 PST| 2\n> ! Mon Feb 10 17:32:01 1997 PST| 2\n> ! Mon Feb 10 17:32:01 1997 PST| 7\n> Sun Feb 16 17:32:01 1997 PST| 2\n> Sat Mar 01 17:32:01 1997 PST| 2\n> ! (7 rows)\n> \n> \n> ----------------------\n> \n> *** expected/random.out\tTue Apr 29 10:23:40 1997\n> --- results/random.out\tSat Aug 15 13:44:19 1998\n> ***************\n> *** 5,18 ****\n> (1 row)\n> \n> QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> ! count\n> ! -----\n> ! 92\n> ! (1 row)\n> \n> QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> ! count\n> ! -----\n> ! 98\n> ! (1 row)\n> \n> --- 5,12 ----\n> (1 row)\n> \n> QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> ! ERROR: can't look up operator 713\n> \n> QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> ! ERROR: can't look up operator 713\n> \n> \n> ----------------------\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 23 Aug 1998 18:16:12 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Regression test status (was type coersion)" }, { "msg_contents": "> then it works. I'll look at it. Darn, I had just stripped out the\n> debugging stuff in the code before submitting it, since leaving it\n> hanging around was annoying Bruce (with good reason btw).\n\nI have an idea on this. If we change #ifdef PARSEDEBUG to something\nelse, I think we can keep it. If in an include file we say:\n\n#ifdef PARSEDEBUG\n#define ParseDebug(x)\tx\n#else\t\n#define ParseDebug(x)\n#endif\n\nwe can then do\n\n\tx=3;\n\ty=4;\n\tParseDebug(printf(\"test));\n\nand it will look good, and we can always enable it. What do you think? \nI can do it if you want?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 23 Aug 1998 18:20:15 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Regression test status (was type coersion)" }, { "msg_contents": "Tom,\n\nI was never able to reproduce the ORDER BY anomaly on my Linux box. I will try\nto reproduce it on my AIX box. I have some porting issues I need to get through\nfirst.\n\nIn the mean time, if you still see a problem, could you run the query as:\n SELECT a, upper(c) FROM test_missing_target ORDER BY upper;\nto eliminate the junkfilter as a culprit.\n\nBruce Momjian wrote:\n\n> Do any of these problems still exist?\n>\n> > \"Thomas G. Lockhart\" <[email protected]> writes:\n> > > ... all of the\n> > > regression tests pass, except for the select_view test, which has been\n> > > core dumping for weeks. Anyone else seeing that, or is it just me? :(\n> >\n> > I rebuilt the system from current sources today, and ran the regression\n> > tests for the first time in a long time. select_views works fine for\n> > me, but there are several other tests that look badly broken:\n> > SELECT ... ORDER BY upper(c) is misordering the results in select_implicit,\n> > GROUP BY on a datetime is not working right in select_having, and the\n> > random test is failing because it \"can't look up operator 713\".\n> >\n> > I'm on HP-UX 9.03, PA-RISC 1.1, gcc 2.7.2.2 if that helps.\n> >\n> > regards, tom lane\n> >\n> >\n> > *** expected/select_implicit.out Sat Aug 15 11:56:03 1998\n> > --- results/select_implicit.out Sat Aug 15 13:44:16 1998\n> > ***************\n> > *** 213,226 ****\n> > QUERY: SELECT a FROM test_missing_target ORDER BY upper(c);\n> > a\n> > -\n> > - 1\n> > 2\n> > 3\n> > 4\n> > 5\n> > 6\n> > - 7\n> > 8\n> > 9\n> > 0\n> > (10 rows)\n> > --- 213,226 ----\n> > QUERY: SELECT a FROM test_missing_target ORDER BY upper(c);\n> > a\n> > -\n> > 2\n> > + 1\n> > 3\n> > 4\n> > 5\n> > 6\n> > 8\n> > + 7\n> > 9\n> > 0\n> > (10 rows)\n> >\n> > ----------------------\n> >\n> > *** expected/select_having.out Wed Jul 8 10:29:09 1998\n> > --- results/select_having.out Sat Aug 15 13:44:16 1998\n> > ***************\n> > *** 2,12 ****\n> > GROUP BY d1 HAVING count(*) > 1;\n> > d1 |count\n> > ----------------------------+-----\n> > ! Thu Jun 13 00:00:00 1957 PDT| 2\n> > ! Mon Feb 10 09:32:01 1997 PST| 3\n> > ! Mon Feb 10 17:32:01 1997 PST| 13\n> > Sun Feb 16 17:32:01 1997 PST| 2\n> > Sat Mar 01 17:32:01 1997 PST| 2\n> > ! invalid | 2\n> > ! (6 rows)\n> >\n> > --- 2,13 ----\n> > GROUP BY d1 HAVING count(*) > 1;\n> > d1 |count\n> > ----------------------------+-----\n> > ! Thu Jun 13 00:00:00 1957 PST| 2\n> > ! Mon Feb 10 17:32:01 1997 PST| 4\n> > ! Mon Feb 10 09:32:01 1997 PST| 2\n> > ! Mon Feb 10 17:32:01 1997 PST| 2\n> > ! Mon Feb 10 17:32:01 1997 PST| 7\n> > Sun Feb 16 17:32:01 1997 PST| 2\n> > Sat Mar 01 17:32:01 1997 PST| 2\n> > ! (7 rows)\n> >\n> >\n> > ----------------------\n> >\n> > *** expected/random.out Tue Apr 29 10:23:40 1997\n> > --- results/random.out Sat Aug 15 13:44:19 1998\n> > ***************\n> > *** 5,18 ****\n> > (1 row)\n> >\n> > QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> > ! count\n> > ! -----\n> > ! 92\n> > ! (1 row)\n> >\n> > QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> > ! count\n> > ! -----\n> > ! 98\n> > ! (1 row)\n> >\n> > --- 5,12 ----\n> > (1 row)\n> >\n> > QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> > ! ERROR: can't look up operator 713\n> >\n> > QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> > ! ERROR: can't look up operator 713\n> >\n> >\n> > ----------------------\n> >\n> >\n>\n> --\n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n\n\n\n", "msg_date": "Mon, 24 Aug 1998 08:38:51 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Regression test status (was type coersion)" }, { "msg_contents": "I check two these of these problems. Read ahead --->\n\nBruce Momjian wrote:\n\n> Do any of these problems still exist?\n>\n> > \"Thomas G. Lockhart\" <[email protected]> writes:\n> > > ... all of the\n> > > regression tests pass, except for the select_view test, which has been\n> > > core dumping for weeks. Anyone else seeing that, or is it just me? :(\n> >\n> > I rebuilt the system from current sources today, and ran the regression\n> > tests for the first time in a long time. select_views works fine for\n> > me, but there are several other tests that look badly broken:\n> > SELECT ... ORDER BY upper(c) is misordering the results in select_implicit,\n> > GROUP BY on a datetime is not working right in select_having, and the\n> > random test is failing because it \"can't look up operator 713\".\n> >\n> > I'm on HP-UX 9.03, PA-RISC 1.1, gcc 2.7.2.2 if that helps.\n> >\n> > regards, tom lane\n> >\n> >\n> > *** expected/select_implicit.out Sat Aug 15 11:56:03 1998\n> > --- results/select_implicit.out Sat Aug 15 13:44:16 1998\n> > ***************\n> > *** 213,226 ****\n> > QUERY: SELECT a FROM test_missing_target ORDER BY upper(c);\n> > a\n> > -\n> > - 1\n> > 2\n> > 3\n> > 4\n> > 5\n> > 6\n> > - 7\n> > 8\n> > 9\n> > 0\n> > (10 rows)\n> > --- 213,226 ----\n> > QUERY: SELECT a FROM test_missing_target ORDER BY upper(c);\n> > a\n> > -\n> > 2\n> > + 1\n> > 3\n> > 4\n> > 5\n> > 6\n> > 8\n> > + 7\n> > 9\n> > 0\n> > (10 rows)\n> >\n> > ----------------------\n> >\n\nBoth sort orders are correct. I seems that different machines are resolving\nequivalent strings differently. I got the same result as Tom on an RS/6000\nbox. I could be an big vs little endian, signed vs unsigned chars issue. In\nany case, the actual sort order is indeterminate. Therefore I will submit a new\nregression test with reliable test data.\n\n> > *** expected/select_having.out Wed Jul 8 10:29:09 1998\n> > --- results/select_having.out Sat Aug 15 13:44:16 1998\n> > ***************\n> > *** 2,12 ****\n> > GROUP BY d1 HAVING count(*) > 1;\n> > d1 |count\n> > ----------------------------+-----\n> > ! Thu Jun 13 00:00:00 1957 PDT| 2\n> > ! Mon Feb 10 09:32:01 1997 PST| 3\n> > ! Mon Feb 10 17:32:01 1997 PST| 13\n> > Sun Feb 16 17:32:01 1997 PST| 2\n> > Sat Mar 01 17:32:01 1997 PST| 2\n> > ! invalid | 2\n> > ! (6 rows)\n> >\n> > --- 2,13 ----\n> > GROUP BY d1 HAVING count(*) > 1;\n> > d1 |count\n> > ----------------------------+-----\n> > ! Thu Jun 13 00:00:00 1957 PST| 2\n> > ! Mon Feb 10 17:32:01 1997 PST| 4\n> > ! Mon Feb 10 09:32:01 1997 PST| 2\n> > ! Mon Feb 10 17:32:01 1997 PST| 2\n> > ! Mon Feb 10 17:32:01 1997 PST| 7\n> > Sun Feb 16 17:32:01 1997 PST| 2\n> > Sat Mar 01 17:32:01 1997 PST| 2\n> > ! (7 rows)\n> >\n> >\n> > ----------------------\n> >\n\nThese results are also correct. Somewhat. I do not know much about datatime\nporting issues, but if I do a:\n SELECT d1 FROM DATETIME_TBL\nI get time reported to the 1/100 of a second. If GROUP BY d1 the hundredths\nare not shown. Thus, the counts and groupings are correct. Its just not\nshowing the hundredths portion.\n\n> > *** expected/random.out Tue Apr 29 10:23:40 1997\n> > --- results/random.out Sat Aug 15 13:44:19 1998\n> > ***************\n> > *** 5,18 ****\n> > (1 row)\n> >\n> > QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> > ! count\n> > ! -----\n> > ! 92\n> > ! (1 row)\n> >\n> > QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> > ! count\n> > ! -----\n> > ! 98\n> > ! (1 row)\n> >\n> > --- 5,12 ----\n> > (1 row)\n> >\n> > QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> > ! ERROR: can't look up operator 713\n> >\n> > QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n> > ! ERROR: can't look up operator 713\n> >\n> >\n\nDon't know about this one.\n\n", "msg_date": "Wed, 26 Aug 1998 13:45:02 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Regression test status (was type coersion)" }, { "msg_contents": "David Hartwig <[email protected]> writes:\n> Both sort orders are correct. I seems that different machines are\n> resolving equivalent strings differently. I got the same result as\n> Tom on an RS/6000 box. I could be an big vs little endian, signed vs\n> unsigned chars issue. In any case, the actual sort order is\n> indeterminate. Therefore I will submit a new regression test with\n> reliable test data.\n\nOK.\n\n> These results are also correct. Somewhat. I do not know much about\n> datatime porting issues, but if I do a:\n> SELECT d1 FROM DATETIME_TBL\n> I get time reported to the 1/100 of a second. If GROUP BY d1 the\n> hundredths are not shown. Thus, the counts and groupings are correct.\n> Its just not showing the hundredths portion.\n\nThe issue here is why you (or whoever it was prepared the regression\ntest) got different results from me...\n\n>>>> QUERY: SELECT count(*) FROM onek where oidrand(onek.oid, 10);\n>>>> ! ERROR: can't look up operator 713\n>\n> Don't know about this one.\n\nThat bug should be fixed in the current sources, I believe.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 26 Aug 1998 14:25:18 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Regression test status (was type coersion) " }, { "msg_contents": "\n\nTom Lane wrote:\n\n> > These results are also correct. Somewhat. I do not know much about\n> > datatime porting issues, but if I do a:\n> > SELECT d1 FROM DATETIME_TBL\n> > I get time reported to the 1/100 of a second. If GROUP BY d1 the\n> > hundredths are not shown. Thus, the counts and groupings are correct.\n> > Its just not showing the hundredths portion.\n>\n> The issue here is why you (or whoever it was prepared the regression\n> test) got different results from me...\n>\n\nI do get the same results - on my RS/6000. And I did not prepare the\ntest. But, to be more precise:\n\n1. The failure does not indicate any problems w/ the HAVING clause.\n\n2. This test will never work if there is a machine dependence on the\nability to resolve datatime down to the 1/100 second.\n\n3. There appears to be something strange going on in the way GROUPed BY\ndatetime columns do not display the 1/100 portion of seconds. Is this a\nknown problem?\n\nUnless someone objects, I will submit a test suit to, at least remove the\nfalse reading on select_having.\n\n", "msg_date": "Wed, 26 Aug 1998 15:04:09 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Regression test status (was type coersion)" } ]
[ { "msg_contents": "\n> > > David Gould wrote:\n> > > > \n> > > > I would like to point out that Informix SE for Linux is available TODAY\n> > > > from our website. Oracle for Linux is planned for the end of the year.\n> > > > \n> > > > I think our shipping SE version beats their latest and greatest vapor. ;-)\n> > > \n> > > Yes, but it is a shame Informix is coming as a \"me too\" to Linux, rather\n> > > than leading the pack. Now that they have decided to release the port,\n> > > it is a shame they did not release it six months ago, so they looked\n> > > more like a leader.\n...\nHey, I agree, we should have done it a year ago. And we should be doing UDO\nnow along with SE. And we should GPL the Illustra source (it really does\naddress a _lot_ of the problems in postgres). But I am not in charge, so\nwhat I think is just my opinion.\n\nBut, fact is, we are the first to ship. And I think that shipping counts\nmore than press releases. I mean, heck, we could have made an \"announcement\"\nsix months ago (with a six month lead time like Oracle), but that wouldn't\nhave put CDs in anyones hands any sooner.\n\nI am well aware that \"no good deed ever goes unpunished\", but even so it\nis annoying to see the attitude \"well, Informix didn't do UDO only SE, and\nthey didn't do it six months ago\" when in fact Informix is shipping a\nperfectly fine product that thousands of VARS use to build all kinds of\nreal apps for real businesses, and we are giving developer licenses for free.\n\nThis is key enabling stuff to let real businesses deliver and use real apps\non Linux. And we are the first to actually do the work to deliver the\nproduct (or the others would be shipping CDs instead of vapor). I think\nthis is a good thing and should be recognized as such.\n\nExcuse me if this is inappropriately commercial, but I have been arguing\ninside the company for a Linux port for over two years and it kinda pops\nmy balloon when it is not appreciated (not that I had anything to do with it).\n\n-dg\n\n\nDavid Gould [email protected] 510.628.3783 or 510.305.9468 \nInformix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n - If simplicity worked, the world would be overrun with insects. -\n\n", "msg_date": "Sat, 8 Aug 1998 00:50:15 -0700 (PDT)", "msg_from": "[email protected] (David Gould)", "msg_from_op": true, "msg_subject": "re: Informix on Linux" }, { "msg_contents": "> > > > Yes, but it is a shame Informix is coming as a \"me too\" to \n> > > > Linux, rather than leading the pack. Now that they have decided \n> > > > to release the port, it is a shame they did not release it six \n> > > > months ago, so they looked more like a leader.\n> But, fact is, we are the first to ship. And I think that shipping \n> counts more than press releases. I mean, heck, we could have made an \n> \"announcement\" six months ago (with a six month lead time like \n> Oracle), but that wouldn't have put CDs in anyones hands any sooner.\n\n*grin* That reminds me of a \"demo\" Oracle did at JPL a few years ago.\nVery impressive -- 3 machines at the front of the room: a Sun, a PC, and\na Mac, each running a different piece of an Oracle app or backend,\ninteroperating wonderfully. *Except that NONE of the pieces of software\nin the demo was available for ANY of the other platforms*!!?? They sort\nof forgot to mention that until I asked :/\n\nUntil it ships, Oracle is just contributing to global warming...\n\n> I am well aware that \"no good deed ever goes unpunished\", but even so \n> it is annoying to see the attitude \"well, Informix didn't do UDO only \n> SE, and they didn't do it six months ago\" when in fact Informix is \n> shipping a perfectly fine product that thousands of VARS use to build \n> all kinds of real apps for real businesses, and we are giving \n> developer licenses for free.\n\nYup, Informix seems to have made the big commitment, and we shouldn't\nhold it against any company for not \"getting it\" sooner. At least until\nInformix starts slamming Postgres in their advertisements :))\n\nKeep working on them to GPL Illustra David...\n\n - Tom\n", "msg_date": "Sat, 08 Aug 1998 13:26:49 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] re: Informix on Linux" }, { "msg_contents": "On Sat, 8 Aug 1998, Thomas G. Lockhart wrote:\n\n> Keep working on them to GPL Illustra David...\n\n\tDoesn't the fact that Netscape refused to GPL their sources say\n*anything* to anyone? If they are going to release the source, fine...but\nnot under GPL..at least go the direction that Netscape did and make your\nown copyright...\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sat, 8 Aug 1998 15:17:45 -0300 (ADT)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] re: Informix on Linux" }, { "msg_contents": "> > > > Yes, but it is a shame Informix is coming as a \"me too\" to Linux, rather\n> > > > than leading the pack. Now that they have decided to release the port,\n> > > > it is a shame they did not release it six months ago, so they looked\n> > > > more like a leader.\n> ...\n> Hey, I agree, we should have done it a year ago. And we should be doing UDO\n> now along with SE. And we should GPL the Illustra source (it really does\n> address a _lot_ of the problems in postgres). But I am not in charge, so\n> what I think is just my opinion.\n\nWow, GPL the Illustra source. That would be radical.\n\n\n> But, fact is, we are the first to ship. And I think that shipping counts\n> more than press releases. I mean, heck, we could have made an \"announcement\"\n> six months ago (with a six month lead time like Oracle), but that wouldn't\n> have put CDs in anyones hands any sooner.\n> \n> I am well aware that \"no good deed ever goes unpunished\", but even so it\n> is annoying to see the attitude \"well, Informix didn't do UDO only SE, and\n> they didn't do it six months ago\" when in fact Informix is shipping a\n> perfectly fine product that thousands of VARS use to build all kinds of\n> real apps for real businesses, and we are giving developer licenses for free.\n> \n> This is key enabling stuff to let real businesses deliver and use real apps\n> on Linux. And we are the first to actually do the work to deliver the\n> product (or the others would be shipping CDs instead of vapor). I think\n> this is a good thing and should be recognized as such.\n> \n> Excuse me if this is inappropriately commercial, but I have been arguing\n> inside the company for a Linux port for over two years and it kinda pops\n> my balloon when it is not appreciated (not that I had anything to do with it).\n\nThis is a good point. We just want only the best for Informix.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 8 Aug 1998 15:23:20 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] re: Informix on Linux" } ]
[ { "msg_contents": "BSD indent, and hence pgindent, has a problem identifying the difference\nbetween function prototypes and functions when the prototype spans more\nthan line line, i.e.:\n\n\tstatic \n\tfunc(int x,\n\t int y)\n\nand\n\t\n\tstatic\n\tfunc(int x,\n\t int y);\n\nformat the same, while the second should format as:\n\t\n\tstatic func(int x,\n\t int y);\n\nI have talked to BSDI about the bug [BSDI-Support-Request #51998], and\nthough they have cheerfully fixed many of the other indent bugs, this\none it going to be much more difficult. I have looked at the code\nmyself, and it looks very complicated to fix.\n\nI have decided to work around the bug by adding some awk code to\npgindent to fix the problem by finding potential function prototypes,\nand changing the formatting into prototypes where appropriate.\n\nWhy is this important? Ctags, which is almost necessary with the 250k\nlines of code in PostgreSQL, looks for the function name starting in\ncolumn 1. If a static function has a prototype, when you ctags into the\nfile, it ctags finds the prototype, and not the actual function.\n\nI will run the new pgindent as part of the normal pre-beta release\nprocess at the end of this month.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 9 Aug 1998 00:49:48 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "pgindent and prototypes" } ]
[ { "msg_contents": "I have added this to the contrib/ directory:\n\n---------------------------------------------------------------------------\n\n\n \t\t\t findoidjoins\n\nThis program scans the a database, and prints oid fields, and the tables\nthey join to. PostgreSQL version 6.3.2 crashes with aggregates on\nviews, so I have removed the view pg_user from the list of relations to\nexamine.\n\nIt requires /pgsql/contrib/pginterface to be compiled first.\n\nRun on am empty database, it returns the system join relationships:\n\n---------------------------------------------------------------------------\n\nJoin pg_aggregate.aggfinaltype => pg_proc.oid\nJoin pg_aggregate.aggfinaltype => pg_type.oid\nJoin pg_aggregate.aggowner => pg_proc.oid\nJoin pg_aggregate.aggbasetype => pg_proc.oid\nJoin pg_aggregate.aggbasetype => pg_type.oid\nJoin pg_aggregate.aggtranstype1 => pg_proc.oid\nJoin pg_aggregate.aggtranstype1 => pg_type.oid\nJoin pg_aggregate.aggtranstype2 => pg_type.oid\nJoin pg_am.amowner => pg_proc.oid\nJoin pg_amop.amopid => pg_am.oid\nJoin pg_amop.amopopr => pg_operator.oid\nJoin pg_amop.amopclaid => pg_opclass.oid\nJoin pg_amproc.amproc => pg_operator.oid\nJoin pg_amproc.amproc => pg_proc.oid\nJoin pg_amproc.amopclaid => pg_opclass.oid\nJoin pg_amproc.amopclaid => pg_operator.oid\nJoin pg_amproc.amopclaid => pg_proc.oid\nJoin pg_amproc.amid => pg_am.oid\nJoin pg_attribute.attrelid => pg_class.oid\nJoin pg_attribute.atttypid => pg_type.oid\nJoin pg_class.relam => pg_am.oid\nJoin pg_class.reltype => pg_type.oid\nJoin pg_class.relowner => pg_proc.oid\nJoin pg_description.objoid => pg_proc.oid\nJoin pg_description.objoid => pg_type.oid\nJoin pg_index.indexrelid => pg_class.oid\nJoin pg_index.indrelid => pg_class.oid\nJoin pg_index.indproc => pg_proc.oid\nJoin pg_opclass.opcdeftype => pg_type.oid\nJoin pg_operator.oprcom => pg_operator.oid\nJoin pg_operator.oprrsortop => pg_operator.oid\nJoin pg_operator.oprlsortop => pg_operator.oid\nJoin pg_operator.oprnegate => pg_operator.oid\nJoin pg_operator.oprresult => pg_type.oid\nJoin pg_operator.oprright => pg_type.oid\nJoin pg_operator.oprleft => pg_type.oid\nJoin pg_operator.oprowner => pg_proc.oid\nJoin pg_parg.partype => pg_type.oid\nJoin pg_parg.parproid => pg_operator.oid\nJoin pg_parg.parproid => pg_proc.oid\nJoin pg_proc.prolang => pg_language.oid\nJoin pg_proc.prorettype => pg_type.oid\nJoin pg_proc.proowner => pg_proc.oid\nJoin pg_rewrite.ev_class => pg_class.oid\nJoin pg_statistic.starelid => pg_class.oid\nJoin pg_type.typrelid => pg_class.oid\nJoin pg_type.typowner => pg_proc.oid\nJoin pg_type.typelem => pg_operator.oid\nJoin pg_type.typelem => pg_proc.oid\nJoin pg_type.typelem => pg_type.oid\n\n\n---------------------------------------------------------------------------\n\nBruce Momjian ([email protected])\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 10 Aug 1998 22:32:49 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "new findoidjoins" } ]
[ { "msg_contents": "Hi\n\nI found some bug on next example:\n----------------------------\n/* step 1 -------------- */\ntest=> select pubid,bn into table l1 from l;\nSELECT\ntest=> select pubid,bn into table n1 from n;\nSELECT\n/* pubid & bn - int4 */\ntest=> select count(*) from l1;\ncount\n-----\n 6776\n (1 row)\ntest=> select count(*) from n1;\ncount\n-----\n4478\n(1 row)\n/* Step 2 -------------- */\ntest=> explain select l1.pubid from l1,n1 where l1.pubid=n1.pubid and\nl1.bn=n1.bn;\nNOTICE: QUERY PLAN:\n\nMerge Join (cost=0.00 size=1 width=16)\n -> Seq Scan (cost=0.00 size=0 width=0)\n -> Sort (cost=0.00 size=0 width=0)\n -> Seq Scan on l1 (cost=0.00 size=0 width=8)\n -> Seq Scan (cost=0.00 size=0 width=0)\n -> Sort (cost=0.00 size=0 width=0)\n -> Seq Scan on n1 (cost=0.00 size=0 width=8)\n\n/* it's work */ \n/* Step 3 -------------- */\n\ntest=> create index l1_i on l1 (pubid,bn);\nCREATE\ntest=> explain select l1.pubid from l1,n1 where l1.pubid=n1.pubid and\nl1.bn=n1.bn;\nNOTICE: QUERY PLAN:\n\nNested Loop (cost=0.00 size=1 width=16)\n -> Seq Scan on n1 (cost=0.00 size=0 width=8)\n -> Index Scan using l1_i on l1 (cost=2.00 size=6776 width=8)\n\n/* it's work */ \n/* Step 4 -------------- */\n\ntest=> create index n1_i on n1 (pubid,bn);\nCREATE\ntest=> explain select l1.pubid from l1,n1 where l1.pubid=n1.pubid and\nl1.bn=n1.bn;\nNOTICE: QUERY PLAN:\n\nHash Join (cost=817.76 size=2 width=16)\n -> Seq Scan on l1 (cost=267.61 size=6776 width=8)\n -> Hash (cost=0.00 size=0 width=0)\n -> Seq Scan on n1 (cost=176.77 size=4478 width=8)\n\n/* it's not work fine :((( */ \n/* Step 5-------------- */\n \ntest=> drop index n1_i;\nDROP\n/* \n\ntest=> explain select l1.pubid from l1,n1 where l1.pubid=n1.pubid and\nl1.bn=n1.bn;\nNOTICE: QUERY PLAN:\n\nHash Join (cost=817.76 size=2 width=16)\n -> Seq Scan on l1 (cost=267.61 size=6776 width=8)\n -> Hash (cost=0.00 size=0 width=0)\n -> Seq Scan on n1 (cost=176.77 size=4478 width=8)\n \n/* Is it right ? I meen query plan must be like in \"Step 3\" ? */\n\n---------------------------- \n\nThnk's\n\nSY, Serj\n", "msg_date": "Tue, 11 Aug 1998 14:30:11 +0400", "msg_from": "Serj <[email protected]>", "msg_from_op": true, "msg_subject": "Indexes bug" }, { "msg_contents": "Serj <[email protected]> writes:\n> [ system not using an index when it should ]\n\nTwo questions:\n\n1. Did you do a \"vacuum analyze\" after making the indexes?\n Without that, the optimizer may be choosing a sequential scan\n because it doesn't know how big the tables are.\n\n2. What postgres version are you using?\n\nThere are some bugs in the current cvs sources that affect whether\nindexes get used --- look at the ongoing threads in the hackers list.\nMaybe you've found another manifestation of that problem. But if\nyou're using 6.3.2 then it's something different...\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 11 Aug 1998 11:18:07 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Indexes bug " }, { "msg_contents": "> Serj <[email protected]> writes:\n> > [ system not using an index when it should ]\n> \n> Two questions:\n> \n> 1. Did you do a \"vacuum analyze\" after making the indexes?\n> Without that, the optimizer may be choosing a sequential scan\n> because it doesn't know how big the tables are.\n> \n> 2. What postgres version are you using?\n> \n> There are some bugs in the current cvs sources that affect whether\n> indexes get used --- look at the ongoing threads in the hackers list.\n> Maybe you've found another manifestation of that problem. But if\n> you're using 6.3.2 then it's something different...\n\nI think we now know what is happening in the current cvs tree. The\noptimizer calls op_class to find if there is an pg_opam entry for the\nexpression (int4eq), the current index access type(btree), and the\ncurrent index op class(int4_ops).\n\nIn the case of oideqint4, there is no pg_amop to match it, and we can't\nadd extra rows to pg_amop to make it work. I suppose we could try\nadding a amopopr_compat column to pg_amop, and somehow do a lookup on\nthat if the first one does not match. Because of the way the system\ncaches are structured, we would need a new cache for that extra column,\nI think. There must be a better way.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 13:11:56 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Indexes bug" }, { "msg_contents": "> > 2. What postgres version are you using?\n> >\n> > There are some bugs in the current cvs sources that affect whether\n> > indexes get used --- look at the ongoing threads in the hackers list.\n> > Maybe you've found another manifestation of that problem. But if\n> > you're using 6.3.2 then it's something different...\n> \nI try it on 6.3.2 (with all patches from /pub/patches) and on current\nCVS\n\n-- \nSY, Serj\n", "msg_date": "Wed, 12 Aug 1998 12:01:25 +0400", "msg_from": "Serj <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Indexes bug" } ]
[ { "msg_contents": "Hi,\n\nI tried to apply the patch that Vadim posted about a week ago to make use \nof functional indices, however, it didn't apply (dunno why, I have a \nvanilla 6.3.2 source-tree here).\n\nCan anybody please send me a patched indxpath.c?\n\nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Tue, 11 Aug 1998 13:08:01 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": true, "msg_subject": "6.3.2. patch for functional indices" }, { "msg_contents": "On Tue, 11 Aug 1998, Maarten Boekhold wrote:\n\n> Hi,\n> \n> I tried to apply the patch that Vadim posted about a week ago to make use \n> of functional indices, however, it didn't apply (dunno why, I have a \n> vanilla 6.3.2 source-tree here).\n\n\tUnless I'm wrong (which is always a possibility), the fact that\nyou have a vanilla 6.3.2 tree is the problem. Most, if not all, of the\nv6.3.2 patches that have been produced have been cumulative...you need to\napply all the previous ones released before...\n\n\n", "msg_date": "Tue, 11 Aug 1998 08:39:59 -0400 (EDT)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 6.3.2. patch for functional indices" }, { "msg_contents": "On Tue, 11 Aug 1998, The Hermit Hacker wrote:\n\n> On Tue, 11 Aug 1998, Maarten Boekhold wrote:\n> \n> > Hi,\n> > \n> > I tried to apply the patch that Vadim posted about a week ago to make use \n> > of functional indices, however, it didn't apply (dunno why, I have a \n> > vanilla 6.3.2 source-tree here).\n> \n> \tUnless I'm wrong (which is always a possibility), the fact that\n> you have a vanilla 6.3.2 tree is the problem. Most, if not all, of the\n> v6.3.2 patches that have been produced have been cumulative...you need to\n> apply all the previous ones released before...\n\nI grabbed all patches from ftr.postgresql.org/pub/patches and applied them\n(it's kinda confusing, some have to be applied *in* the src/ directory, \nothers *outside* the src dir). After this, I wasstill unable to\napply that patch from vadim.\n\nI applied these patches:\n\n-rw-r--r-- 1 postgres wheel 5820 Aug 12 07:02 btree_adj-980730\n-rw-r--r-- 1 postgres wheel 43208 Aug 12 07:02 configure-980430\n-rw-r--r-- 1 postgres wheel 39675 Aug 12 07:02 linux_elf.patch-980421\n\nThe linux one isn't important for me, but I thought what the heck I'll do \nit anyways.\n\nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Wed, 12 Aug 1998 13:01:28 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] 6.3.2. patch for functional indices" }, { "msg_contents": ">> > I tried to apply the patch that Vadim posted about a week ago to make use \n>> > of functional indices, however, it didn't apply (dunno why, I have a \n>> > vanilla 6.3.2 source-tree here).\n\nI don't know why the patch won't apply (maybe you are using broken\nSolaris's patch command?)\n\nanyway, I will send you the file the patch applied in another mail.\n--\nTatsuo Ishii\[email protected]\n", "msg_date": "Wed, 12 Aug 1998 23:46:22 +0900", "msg_from": "[email protected]", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 6.3.2. patch for functional indices " } ]
[ { "msg_contents": "Hi,\n\n the following patch fixes a bug in the oracle compatibility\n functions btrim() ltrim() and rtrim().\n\n The error was that the character after the set was included\n in the tests (ptr2 pointed to the character after the vardata\n part of set if no match found, so comparing *ptr or *end\n against *ptr2 MAY match -> strip).\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#======================================== [email protected] (Jan Wieck) #\n\n\n*** oracle_compat.c.orig\tTue Aug 11 16:07:48 1998\n--- oracle_compat.c\tTue Aug 11 16:08:37 1998\n***************\n*** 297,303 ****\n \t\t\t\tbreak;\n \t\t\t++ptr2;\n \t\t}\n! \t\tif (*ptr != *ptr2)\n \t\t\tbreak;\n \t\tptr++;\n \t\tptr2 = VARDATA(set);\n--- 297,303 ----\n \t\t\t\tbreak;\n \t\t\t++ptr2;\n \t\t}\n! \t\tif (ptr2 > end2)\n \t\t\tbreak;\n \t\tptr++;\n \t\tptr2 = VARDATA(set);\n***************\n*** 316,322 ****\n \t\t\t\tbreak;\n \t\t\t++ptr2;\n \t\t}\n! \t\tif (*end != *ptr2)\n \t\t\tbreak;\n \t\t--end;\n \t\tptr2 = VARDATA(set);\n--- 316,322 ----\n \t\t\t\tbreak;\n \t\t\t++ptr2;\n \t\t}\n! \t\tif (ptr2 > end2)\n \t\t\tbreak;\n \t\t--end;\n \t\tptr2 = VARDATA(set);\n***************\n*** 374,380 ****\n \t\t\t\tbreak;\n \t\t\t++ptr2;\n \t\t}\n! \t\tif (*ptr != *ptr2)\n \t\t\tbreak;\n \t\tptr++;\n \t\tptr2 = VARDATA(set);\n--- 374,380 ----\n \t\t\t\tbreak;\n \t\t\t++ptr2;\n \t\t}\n! \t\tif (ptr2 > end2)\n \t\t\tbreak;\n \t\tptr++;\n \t\tptr2 = VARDATA(set);\n***************\n*** 434,440 ****\n \t\t\t\tbreak;\n \t\t\t++ptr2;\n \t\t}\n! \t\tif (*ptr != *ptr2)\n \t\t\tbreak;\n \t\t--ptr;\n \t\tptr2 = VARDATA(set);\n--- 434,440 ----\n \t\t\t\tbreak;\n \t\t\t++ptr2;\n \t\t}\n! \t\tif (ptr2 > end2)\n \t\t\tbreak;\n \t\t--ptr;\n \t\tptr2 = VARDATA(set);\n", "msg_date": "Tue, 11 Aug 1998 16:15:31 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Fix in oracle_compat.c" }, { "msg_contents": "> Hi,\n> \n> the following patch fixes a bug in the oracle compatibility\n> functions btrim() ltrim() and rtrim().\n> \n> The error was that the character after the set was included\n> in the tests (ptr2 pointed to the character after the vardata\n> part of set if no match found, so comparing *ptr or *end\n> against *ptr2 MAY match -> strip).\n\nJan, now that you have surfaced, can you let us know if the rewrite\nsystem rewrite will be done for 6.4?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 10:37:56 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Fix in oracle_compat.c" }, { "msg_contents": "> \n> > Hi,\n> > \n> > the following patch fixes a bug in the oracle compatibility\n> > functions btrim() ltrim() and rtrim().\n> > \n> > The error was that the character after the set was included\n> > in the tests (ptr2 pointed to the character after the vardata\n> > part of set if no match found, so comparing *ptr or *end\n> > against *ptr2 MAY match -> strip).\n> \n> Jan, now that you have surfaced, can you let us know if the rewrite\n> system rewrite will be done for 6.4?\n\n What's the deadline for 6.4?\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#======================================== [email protected] (Jan Wieck) #\n\n", "msg_date": "Tue, 11 Aug 1998 17:06:34 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Fix in oracle_compat.c" }, { "msg_contents": "> > \n> > > Hi,\n> > > \n> > > the following patch fixes a bug in the oracle compatibility\n> > > functions btrim() ltrim() and rtrim().\n> > > \n> > > The error was that the character after the set was included\n> > > in the tests (ptr2 pointed to the character after the vardata\n> > > part of set if no match found, so comparing *ptr or *end\n> > > against *ptr2 MAY match -> strip).\n> > \n> > Jan, now that you have surfaced, can you let us know if the rewrite\n> > system rewrite will be done for 6.4?\n> \n> What's the deadline for 6.4?\n\nEnd of this month. No one has asked for an extension yet.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 11:13:25 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Fix in oracle_compat.c" }, { "msg_contents": "> \n> > > \n> > > > Hi,\n> > > > \n> > > > the following patch fixes a bug in the oracle compatibility\n> > > > functions btrim() ltrim() and rtrim().\n> > > > \n> > > > The error was that the character after the set was included\n> > > > in the tests (ptr2 pointed to the character after the vardata\n> > > > part of set if no match found, so comparing *ptr or *end\n> > > > against *ptr2 MAY match -> strip).\n> > > \n> > > Jan, now that you have surfaced, can you let us know if the rewrite\n> > > system rewrite will be done for 6.4?\n> > \n> > What's the deadline for 6.4?\n> \n> End of this month. No one has asked for an extension yet.\n> \n\n Hmmm - got a new PC at home (333MHz PII, 64MB) - that guarantees\n short turn arounds in development.\n\n But home is now my own house - that works against time at all :-)\n\n Since you asked me that often now, I think it's really time\n to take a look at it.\n\n\nJan\n\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#======================================== [email protected] (Jan Wieck) #\n\n", "msg_date": "Tue, 11 Aug 1998 17:23:19 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Fix in oracle_compat.c" }, { "msg_contents": "> > End of this month. No one has asked for an extension yet.\n> > \n> \n> Hmmm - got a new PC at home (333MHz PII, 64MB) - that guarantees\n> short turn arounds in development.\n> \n> But home is now my own house - that works against time at all :-)\n> \n> Since you asked me that often now, I think it's really time\n> to take a look at it.\n\nGreat. We just have so many TODO/bug items that are wrapped up in that\nrewrite system, I would really like to get that stuff fixed.\n\nEven if you break it in the process, we need to overhaul the code, and\nno one really understands it like you.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 11:25:20 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Fix in oracle_compat.c" }, { "msg_contents": "Patch applied.\n\n> Hi,\n> \n> the following patch fixes a bug in the oracle compatibility\n> functions btrim() ltrim() and rtrim().\n> \n> The error was that the character after the set was included\n> in the tests (ptr2 pointed to the character after the vardata\n> part of set if no match found, so comparing *ptr or *end\n> against *ptr2 MAY match -> strip).\n> \n> \n> Jan\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> #======================================== [email protected] (Jan Wieck) #\n> \n> \n> *** oracle_compat.c.orig\tTue Aug 11 16:07:48 1998\n> --- oracle_compat.c\tTue Aug 11 16:08:37 1998\n> ***************\n> *** 297,303 ****\n> \t\t\t\tbreak;\n> \t\t\t++ptr2;\n> \t\t}\n> ! \t\tif (*ptr != *ptr2)\n> \t\t\tbreak;\n> \t\tptr++;\n> \t\tptr2 = VARDATA(set);\n> --- 297,303 ----\n> \t\t\t\tbreak;\n> \t\t\t++ptr2;\n> \t\t}\n> ! \t\tif (ptr2 > end2)\n> \t\t\tbreak;\n> \t\tptr++;\n> \t\tptr2 = VARDATA(set);\n> ***************\n> *** 316,322 ****\n> \t\t\t\tbreak;\n> \t\t\t++ptr2;\n> \t\t}\n> ! \t\tif (*end != *ptr2)\n> \t\t\tbreak;\n> \t\t--end;\n> \t\tptr2 = VARDATA(set);\n> --- 316,322 ----\n> \t\t\t\tbreak;\n> \t\t\t++ptr2;\n> \t\t}\n> ! \t\tif (ptr2 > end2)\n> \t\t\tbreak;\n> \t\t--end;\n> \t\tptr2 = VARDATA(set);\n> ***************\n> *** 374,380 ****\n> \t\t\t\tbreak;\n> \t\t\t++ptr2;\n> \t\t}\n> ! \t\tif (*ptr != *ptr2)\n> \t\t\tbreak;\n> \t\tptr++;\n> \t\tptr2 = VARDATA(set);\n> --- 374,380 ----\n> \t\t\t\tbreak;\n> \t\t\t++ptr2;\n> \t\t}\n> ! \t\tif (ptr2 > end2)\n> \t\t\tbreak;\n> \t\tptr++;\n> \t\tptr2 = VARDATA(set);\n> ***************\n> *** 434,440 ****\n> \t\t\t\tbreak;\n> \t\t\t++ptr2;\n> \t\t}\n> ! \t\tif (*ptr != *ptr2)\n> \t\t\tbreak;\n> \t\t--ptr;\n> \t\tptr2 = VARDATA(set);\n> --- 434,440 ----\n> \t\t\t\tbreak;\n> \t\t\t++ptr2;\n> \t\t}\n> ! \t\tif (ptr2 > end2)\n> \t\t\tbreak;\n> \t\t--ptr;\n> \t\tptr2 = VARDATA(set);\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 14:38:02 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Fix in oracle_compat.c" } ]
[ { "msg_contents": "vacuum causes it because the system does not use indexes until the\nvacuum is performed.\n\nGood news and bad news. The good news is that it works perfectly on the\ncurrent source tree because we have made some improvements since 6.3. \nBad news is that the 6.4 release is not in beta until the end of the\nmonth.\n\nHope you can wait until then. If you want to try the developement tree\njust for curiosity, it is on our ftp site at ftp.postgresql.org.\n\n\n> Hi,\n> \n> > What PostgreSQL version are you running?\n> Sorry. It's 6.3.2 and running on IRIX6.4\n> \n> It seems, that this error has something to do with vacuum. I've created a new\n> database and did the following:\n> \n> ------------------------------------------------------------------\n> try_db=> CREATE TABLE dom_prot (\n> try_db-> domain text not null,\n> try_db-> protein text not null,\n> try_db-> start int4 not null,\n> try_db-> ende int4 not null,\n> try_db-> score int4,\n> try_db-> e_value float8,\n> try_db-> p_value char16,\n> try_db-> primary key (domain, protein, start, ende));\n> NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index dom_prot_pkey for\n> table dom_prot\n> CREATE\n> try_db=> copy dom_prot from '/tmp/load_it';\n> COPY\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 11:02:31 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [GENERAL] ExecInitIndexScan ERROR?" } ]
[ { "msg_contents": "Did I forget to send it out? Or was it lost? It seems it never made it into\ncvs.\n\nI don't like the idea of submitting the next one and it won't fit in. :-)\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Tue, 11 Aug 1998 20:22:53 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Latest ecpg patch?" }, { "msg_contents": "On Tue, 11 Aug 1998, Dr. Michael Meskes wrote:\n\n> Did I forget to send it out? Or was it lost? It seems it never made it into\n> cvs.\n\n\tIn my mailbox last night...it was one of those nights last\nnight...will apply and commit as soon as I get home tonight...\n\n", "msg_date": "Tue, 11 Aug 1998 14:31:14 -0400 (EDT)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Latest ecpg patch?" }, { "msg_contents": "Apllied.\n\n\n> Did I forget to send it out? Or was it lost? It seems it never made it into\n> cvs.\n> \n> I don't like the idea of submitting the next one and it won't fit in. :-)\n> \n> Michael\n> -- \n> Dr. Michael Meskes\t\[email protected], [email protected]\n> Go SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 14:33:12 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Latest ecpg patch?" } ]
[ { "msg_contents": "> I think we now know what is happening in the current cvs tree. The\n> optimizer calls op_class to find if there is an pg_opam entry for the\n> expression (int4eq), the current index access type(btree), and the\n> current index op class(int4_ops).\n> \n> In the case of oideqint4, there is no pg_amop to match it, and we\n> can't\n> add extra rows to pg_amop to make it work. I suppose we could try\n> adding a amopopr_compat column to pg_amop, and somehow do a lookup on\n> that if the first one does not match. Because of the way the system\n> caches are structured, we would need a new cache for that extra\n> column,\n> I think. There must be a better way.\n> \nMaybe I missed it but why can't we add the extra row to pg_amop.\n\t\t-DEJ\n\n", "msg_date": "Tue, 11 Aug 1998 13:34:28 -0500", "msg_from": "\"Jackson, DeJuan\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] Indexes bug" }, { "msg_contents": "> > I think we now know what is happening in the current cvs tree. The\n> > optimizer calls op_class to find if there is an pg_opam entry for the\n> > expression (int4eq), the current index access type(btree), and the\n> > current index op class(int4_ops).\n> > \n> > In the case of oideqint4, there is no pg_amop to match it, and we\n> > can't\n> > add extra rows to pg_amop to make it work. I suppose we could try\n> > adding a amopopr_compat column to pg_amop, and somehow do a lookup on\n> > that if the first one does not match. Because of the way the system\n> > caches are structured, we would need a new cache for that extra\n> > column,\n> > I think. There must be a better way.\n> > \n> Maybe I missed it but why can't we add the extra row to pg_amop.\n\nNot sure. Each access method has a predefined number of rows for that\naccess type. I will check on why it fails. For example, btree has five\nrows. hash has fewer.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 14:35:57 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Indexes bug" }, { "msg_contents": "> > I think we now know what is happening in the current cvs tree. The\n> > optimizer calls op_class to find if there is an pg_opam entry for the\n> > expression (int4eq), the current index access type(btree), and the\n> > current index op class(int4_ops).\n> > \n> > In the case of oideqint4, there is no pg_amop to match it, and we\n> > can't\n> > add extra rows to pg_amop to make it work. I suppose we could try\n> > adding a amopopr_compat column to pg_amop, and somehow do a lookup on\n> > that if the first one does not match. Because of the way the system\n> > caches are structured, we would need a new cache for that extra\n> > column,\n> > I think. There must be a better way.\n> > \n> Maybe I missed it but why can't we add the extra row to pg_amop.\n\nI have checked on this, and am not sure about how to deal with it. \nHowever, am now doubting the value of it. In the case of oid/int4, it\nis clear you can call int4 for it. However, for any more complex\nconversion, I don't see many multiple entries in pg_operator pointing to\nthe same pg_proc entry. There are some, but how much value is it going\nto be to get the access method code working for these.\n\n---------------------------------------------------------------------------\n\n 1 \n 1 (486 rows)\n 1 -------------------\n 1 abstimeeq \n 1 abstimege \n 1 abstimegt \n 1 abstimele \n 1 abstimelt \n 1 abstimene \n 1 aclcontains \n 1 aclinsert \n 1 aclremove \n 29 array_eq \n 1 booleq \n 1 boolgt \n 1 boollt \n 1 boolne \n 1 box_above \n 1 box_add \n 1 box_below \n 1 box_center \n 1 box_contain \n 1 box_contained \n 1 box_distance \n 1 box_div \n 1 box_eq \n 1 box_ge \n 1 box_gt \n 1 box_intersect \n 1 box_le \n 1 box_left \n 1 box_lt \n 1 box_mul \n 2 box_overlap \n 1 box_overleft \n 1 box_overright \n 1 box_right \n 1 box_same \n 1 box_sub \n 1 bpchareq \n 1 bpcharge \n 1 bpchargt \n 1 bpcharle \n 1 bpcharlt \n 1 bpcharne \n 1 cash_div_flt4 \n 1 cash_div_flt8 \n 1 cash_div_int2 \n 1 cash_div_int4 \n 1 cash_eq \n 1 cash_ge \n 1 cash_gt \n 1 cash_le \n 1 cash_lt \n 1 cash_mi \n 1 cash_mul_flt4 \n 1 cash_mul_flt8 \n 1 cash_mul_int2 \n 1 cash_mul_int4 \n 1 cash_ne \n 1 cash_pl \n 1 chardiv \n 1 chareq \n 1 charge \n 1 chargt \n 1 charle \n 1 charlt \n 1 charmi \n 1 charmul \n 1 charne \n 1 charpl \n 1 circle_above \n 1 circle_add_pt \n 1 circle_below \n 1 circle_center \n 1 circle_contain \n 1 circle_contain_pt \n 1 circle_contained \n 1 circle_distance \n 1 circle_div_pt \n 1 circle_eq \n 1 circle_ge \n 1 circle_gt \n 1 circle_le \n 1 circle_left \n 1 circle_lt \n 1 circle_mul_pt \n 1 circle_ne \n 1 circle_overlap \n 1 circle_overleft \n 1 circle_overright \n 1 circle_right \n 1 circle_same \n 1 circle_sub_pt \n 1 close_lb \n 1 close_ls \n 1 close_lseg \n 1 close_pb \n 1 close_pl \n 1 close_ps \n 1 close_sb \n 1 close_sl \n 1 date_eq \n 1 date_ge \n 1 date_gt \n 1 date_le \n 1 date_lt \n 1 date_mi \n 1 date_mii \n 1 date_ne \n 1 date_pli \n 1 datetime_eq \n 1 datetime_ge \n 1 datetime_gt \n 1 datetime_le \n 1 datetime_lt \n 1 datetime_mi \n 1 datetime_mi_span \n 1 datetime_ne \n 1 datetime_pl_span \n 1 dcbrt \n 1 dexp \n 1 dist_cpoly \n 1 dist_lb \n 1 dist_pb \n 1 dist_pc \n 1 dist_pl \n 1 dist_ppath \n 1 dist_ps \n 1 dist_sb \n 1 dist_sl \n 1 dlog1 \n 1 dpow \n 1 dround \n 1 dsqrt \n 1 dtrunc \n 1 float48div \n 1 float48eq \n 1 float48ge \n 1 float48gt \n 1 float48le \n 1 float48lt \n 1 float48mi \n 1 float48mul \n 1 float48ne \n 1 float48pl \n 1 float4abs \n 1 float4div \n 1 float4eq \n 1 float4ge \n 1 float4gt \n 1 float4le \n 1 float4lt \n 1 float4mi \n 1 float4mul \n 1 float4ne \n 1 float4pl \n 1 float4um \n 1 float84div \n 1 float84eq \n 1 float84ge \n 1 float84gt \n 1 float84le \n 1 float84lt \n 1 float84mi \n 1 float84mul \n 1 float84ne \n 1 float84pl \n 1 float8abs \n 1 float8div \n 1 float8eq \n 1 float8ge \n 1 float8gt \n 1 float8le \n 1 float8lt \n 1 float8mi \n 1 float8mul \n 1 float8ne \n 1 float8pl \n 1 float8um \n 1 flt4_mul_cash \n 1 flt8_mul_cash \n 1 ininterval \n 1 int24div \n 1 int24eq \n 1 int24ge \n 1 int24gt \n 1 int24le \n 1 int24lt \n 1 int24mi \n 1 int24mod \n 1 int24mul \n 1 int24ne \n 1 int24pl \n 1 int2_mul_cash \n 1 int2div \n 1 int2eq \n 1 int2ge \n 1 int2gt \n 1 int2le \n 1 int2lt \n 1 int2mi \n 1 int2mod \n 1 int2mul \n 1 int2ne \n 1 int2pl \n 1 int2um \n 1 int42div \n 1 int42eq \n 1 int42ge \n 1 int42gt \n 1 int42le \n 1 int42lt \n 1 int42mi \n 1 int42mod \n 1 int42mul \n 1 int42ne \n 1 int42pl \n 1 int48div \n 1 int48eq \n 1 int48ge \n 1 int48gt \n 1 int48le \n 1 int48lt \n 1 int48mi \n 1 int48mul \n 1 int48ne \n 1 int48pl \n 1 int4_mul_cash \n 1 int4div \n 1 int4eq \n 1 int4eqoid \n 2 int4fac \n 2 int4ge \n 2 int4gt \n 2 int4le \n 2 int4lt \n 1 int4mi \n 1 int4mod \n 1 int4mul \n 1 int4ne \n 1 int4notin \n 1 int4pl \n 1 int4um \n 1 int84div \n 1 int84eq \n 1 int84ge \n 1 int84gt \n 1 int84le \n 1 int84lt \n 1 int84mi \n 1 int84mul \n 1 int84ne \n 1 int84pl \n 1 int8div \n 1 int8eq \n 1 int8ge \n 1 int8gt \n 1 int8le \n 1 int8lt \n 1 int8mi \n 1 int8mul \n 1 int8ne \n 1 int8pl \n 1 int8um \n 1 inter_lb \n 1 inter_sb \n 1 inter_sl \n 2 intervalct \n 1 intervaleq \n 1 intervalge \n 1 intervalgt \n 1 intervalle \n 1 intervalleneq \n 1 intervallenge \n 1 intervallengt \n 1 intervallenle \n 1 intervallenlt \n 1 intervallenne \n 1 intervallt \n 1 intervalne \n 1 intervalov \n 1 intervalsame \n 1 intervalstart \n 1 line_distance \n 1 line_eq \n 1 line_horizontal \n 1 line_interpt \n 1 line_intersect \n 1 line_parallel \n 1 line_perp \n 1 line_vertical \n 1 lseg_center \n 1 lseg_distance \n 2 lseg_eq \n 1 lseg_ge \n 1 lseg_gt \n 1 lseg_horizontal \n 1 lseg_interpt \n 1 lseg_intersect \n 1 lseg_le \n 1 lseg_length \n 1 lseg_lt \n 1 lseg_parallel \n 1 lseg_perp \n 1 lseg_vertical \n 1 mktinterval \n 1 nameeq \n 1 namege \n 1 namegt \n 1 nameicregexeq \n 1 nameicregexne \n 1 namele \n 1 namelike \n 1 namelt \n 1 namene \n 1 namenlike \n 1 nameregexeq \n 1 nameregexne \n 1 oideq \n 1 oideqint4 \n 1 oidint2eq \n 1 oidint2ge \n 1 oidint2gt \n 1 oidint2le \n 1 oidint2lt \n 1 oidint2ne \n 1 oidint4eq \n 1 oidint4ge \n 1 oidint4gt \n 1 oidint4le \n 1 oidint4lt \n 1 oidint4ne \n 1 oidnameeq \n 1 oidnamege \n 1 oidnamegt \n 1 oidnamele \n 1 oidnamelt \n 1 oidnamene \n 1 oidne \n 1 oidnotin \n 1 on_pb \n 1 on_pl \n 1 on_ppath \n 1 on_ps \n 1 on_sb \n 1 on_sl \n 1 oprcode \n 1 path_add \n 1 path_add_pt \n 1 path_center \n 1 path_contain_pt \n 1 path_distance \n 1 path_div_pt \n 1 path_inter \n 1 path_length \n 1 path_mul_pt \n 1 path_n_eq \n 1 path_n_ge \n 1 path_n_gt \n 1 path_n_le \n 1 path_n_lt \n 1 path_npoints \n 1 path_sub_pt \n 1 point_above \n 1 point_add \n 1 point_below \n 1 point_distance \n 1 point_div \n 1 point_eq \n 1 point_horiz \n 1 point_left \n 1 point_mul \n 1 point_right \n 1 point_sub \n 1 point_vert \n 1 poly_center \n 1 poly_contain \n 1 poly_contain_pt \n 1 poly_contained \n 1 poly_distance \n 1 poly_left \n 1 poly_npoints \n 1 poly_overlap \n 1 poly_overleft \n 1 poly_overright \n 1 poly_right \n 1 poly_same \n 1 pt_contained_circle\n 1 pt_contained_path \n 1 pt_contained_poly \n 1 reltimeeq \n 1 reltimege \n 1 reltimegt \n 1 reltimele \n 1 reltimelt \n 1 reltimene \n 1 text_ge \n 1 text_gt \n 1 text_le \n 1 text_lt \n 3 textcat \n 1 texteq \n 3 texticregexeq \n 3 texticregexne \n 3 textlike \n 1 textne \n 3 textnlike \n 3 textregexeq \n 3 textregexne \n 1 time_eq \n 1 time_ge \n 1 time_gt \n 1 time_le \n 1 time_lt \n 1 time_ne \n 1 timemi \n 1 timepl \n 1 timespan_div \n 1 timespan_eq \n 1 timespan_ge \n 1 timespan_gt \n 1 timespan_le \n 1 timespan_lt \n 1 timespan_mi \n 1 timespan_ne \n 1 timespan_pl \n 1 timespan_um \n 1 timestampeq \n 1 timestampge \n 1 timestampgt \n 1 timestample \n 1 timestamplt \n 1 timestampne \n 1 varchareq \n 1 varcharge \n 1 varchargt \n 1 varcharle \n 1 varcharlt \n 1 varcharne \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 16:33:09 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Indexes bug" } ]
[ { "msg_contents": "What is a partial index? I have never known.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 15:12:18 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "partial index" } ]
[ { "msg_contents": "On Friday I asked.\n\n> Has something changed recently? I created a new database and it won't\n> let me insert unless I specifically grant myself privledges. It\n> shows as being owned by me. Also, I can't create a view. It says\n> \"pg_rewrite: Permission denied.\" and doesn't create the view.\n\nSince then I have downloaded the most current sources and I still\nget this problem. Am I the only one seeing this?\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 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n", "msg_date": "Tue, 11 Aug 1998 17:13:15 -0400 (EDT)", "msg_from": "[email protected] (D'Arcy J.M. Cain)", "msg_from_op": true, "msg_subject": "Table permissions problem" } ]
[ { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> What is a partial index? I have never known.\n\nit's an index built over a subset of a table; the subset is defined by\na predicate. postgres supported partial indices with arbitrary\npredicates. i believe ibm's db2 for as/400 supports partial indices\nusing single-clause predicates.\n\nthe main motivation is: if all of the queries you ask that can\nprofitably use an index fall into a certain range, why build an index\nover the whole table and suffer the associated space/time costs?\n(there are other reasons; see the first paper referenced below.)\n\nthe machinery to build, update and query partial indices isn't too\nbad. the hairy parts are index selection (which indices do i build)\nand query optimization (which indices do i use) -- i.e., the parts\nthat involve deciding what predicate(s) match the workload/query in\nsome useful way. for those who are into database theory, the problems\nare basically analogous to the corresponding materialized view\nproblems, albeit with different cost parameters and formulae. these\nare, in the general case, hard problems for the standard ordinal sql\ntypes; they're super-hard problems with black-box extension types,\nbecause the selectivity estimation technology is so crude.\n\n1. Stonebraker, M.\n The case for partial indexes (DBMS).\n SIGMOD Record, Dec. 1989, vol.18, (no.4):4-11.\nhttp://s2k-ftp.CS.Berkeley.EDU:8000/postgres/papers/ERL-M89-17.pdf\n\n2. Olson, Nels Edward.\n Partial indexing in POSTGRES : research project / by Nels Edward Olson. \n 1993.\n UCB Engin T7.49.1993 O676\n\n1. CONFERENCE PAPER\n Seshadri, P.; Swami, A.\n Generalized partial indexes.\n IN: Proceedings of the Eleventh International Conference on Data\n Engineering (Cat. No.95CH35724). (Proceedings of the Eleventh International\n Conference on Data Engineering (Cat. No.95CH35724)Proceedings of the\n Eleventh International Conference on Data Engineering, Taipei, Taiwan, 6-10\n March 1995). Edited by: Yu, P.S.; Chen, A.L.P. Los Alamitos, CA, USA: IEEE\n Comput. Soc. Press, 1995. p. 420-7.\nhttp://simon.cs.cornell.edu/home/praveen/papers/partindex.de95.ps.Z\n--\n Paul M. Aoki | University of California at Berkeley\n [email protected] | Dept. of EECS, Computer Science Division #1776\n | Berkeley, CA 94720-1776\n", "msg_date": "Tue, 11 Aug 1998 14:17:48 -0700", "msg_from": "[email protected] (Paul M. Aoki)", "msg_from_op": true, "msg_subject": "Re: partial index" }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> > What is a partial index? I have never known.\n> \n> it's an index built over a subset of a table; the subset is defined by\n> a predicate. postgres supported partial indices with arbitrary\n> predicates. i believe ibm's db2 for as/400 supports partial indices\n> using single-clause predicates.\n> \n> the main motivation is: if all of the queries you ask that can\n> profitably use an index fall into a certain range, why build an index\n> over the whole table and suffer the associated space/time costs?\n> (there are other reasons; see the first paper referenced below.)\n\nI had suspected that's what they were, but never really was sure. Now\nthe next question, \"Should we rip them out?\" No one uses them, and\nthey seem to be of very limited usefulness.\n\nI am inclinded to keep them, but I am not sure.\n\n\n> \n> the machinery to build, update and query partial indices isn't too\n> bad. the hairy parts are index selection (which indices do i build)\n> and query optimization (which indices do i use) -- i.e., the parts\n> that involve deciding what predicate(s) match the workload/query in\n> some useful way. for those who are into database theory, the problems\n> are basically analogous to the corresponding materialized view\n> problems, albeit with different cost parameters and formulae. these\n> are, in the general case, hard problems for the standard ordinal sql\n> types; they're super-hard problems with black-box extension types,\n> because the selectivity estimation technology is so crude.\n> \n> 1. Stonebraker, M.\n> The case for partial indexes (DBMS).\n> SIGMOD Record, Dec. 1989, vol.18, (no.4):4-11.\n> http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/papers/ERL-M89-17.pdf\n> \n> 2. Olson, Nels Edward.\n> Partial indexing in POSTGRES : research project / by Nels Edward Olson. \n> 1993.\n> UCB Engin T7.49.1993 O676\n> \n> 1. CONFERENCE PAPER\n> Seshadri, P.; Swami, A.\n> Generalized partial indexes.\n> IN: Proceedings of the Eleventh International Conference on Data\n> Engineering (Cat. No.95CH35724). (Proceedings of the Eleventh International\n> Conference on Data Engineering (Cat. No.95CH35724)Proceedings of the\n> Eleventh International Conference on Data Engineering, Taipei, Taiwan, 6-10\n> March 1995). Edited by: Yu, P.S.; Chen, A.L.P. Los Alamitos, CA, USA: IEEE\n> Comput. Soc. Press, 1995. p. 420-7.\n> http://simon.cs.cornell.edu/home/praveen/papers/partindex.de95.ps.Z\n> --\n> Paul M. Aoki | University of California at Berkeley\n> [email protected] | Dept. of EECS, Computer Science Division #1776\n> | Berkeley, CA 94720-1776\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 11 Aug 1998 17:39:41 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: partial index" } ]
[ { "msg_contents": "It seems there is a typo in istrat.c (from latest cvs) :\nattributeNumer must be attributeNumber\n\n\tOleg\n\n_____________________________________________________________\nOleg Bartunov, sci.researcher, hostmaster of AstroNet,\nSternberg Astronomical Institute, Moscow University (Russia)\nInternet: [email protected], http://www.sai.msu.su/~megera/\nphone: +007(095)939-16-83, +007(095)939-23-83\n\n", "msg_date": "Wed, 12 Aug 1998 01:37:56 +0400 (MSK DST)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": true, "msg_subject": "typo in src/backend/access/index/istrat.c :attributeNumber" } ]
[ { "msg_contents": "It's time,\n\n there are a few small things and one big left in PL/pgSQL.\n The small things are two new statements (easy) and the big\n one is to be able to return tuples and sets.\n\n I decided to implement the statements now and leave the\n tuples for later (cause they require changes in the main\n executor).\n\n So next on my TODO will be the rule system.\n\n But before starting on it I want to have a clear view onto\n the target. What is the minimum of capabilities, the rule\n system must have at least?\n\n Here's a start of the list:\n\n Retrieve-instead-retrieve rules on the relation level.\n This is what builds a view (and works already - but order\n by and distinct would be nice).\n\n All other instead rules (insert, update, delete) on the\n relation level, so views can behave like real tables\n (yeah - these can be tricky).\n\n What else must be there? I think everything on the instance\n level is better done by triggers. And if we add\n row-/statement-level triggers on SELECT, there would be no\n reason left to have non-instead rules. Or am I missing\n something?\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Wed, 12 Aug 1998 10:55:11 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Rule system" } ]
[ { "msg_contents": "Bruce wrote:\n>What is a partial index? I have never known.\n\nA partial index is one that only indexes a subset of a table (e.g. restricted by a where clause).\n\nThis can be useful in many cases, one typical case is where all rows that are not null\nin the index fields are to be indexed:\ncreate index people_idx on people (childname) where childname is not null;\n\nNote that I just made up the syntax (or is it postgresql syntax?). Some code for it lurks around.\n\nInformix uses another syntax with a complete select statement, so you can also index a join:\n\nCREATE GK INDEX gki\n(SELECT A.col1, A.col2 FROM A, B, C\nWHERE A.col1 = B.col1 AND B.col1 = C.col1)\n\n\nAndreas\n\n\n", "msg_date": "Wed, 12 Aug 1998 10:57:32 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] partial index" } ]
[ { "msg_contents": "Jan Wieck wrote:\n> What else must be there? I think everything on the instance\n> level is better done by triggers. And if we add\n> row-/statement-level triggers on SELECT, there would be no\n> reason left to have non-instead rules. Or am I missing\n> something?\nWhile this is in my opinion true, it would be nice to extend the trigger syntax to\nallow the triggered action to be expressed in sql like:\n\ncreate trigger blabla after delete on people\nreferencing old as o\n(insert into graves values (o.*));\t-- disregard the syntax\n\nAndreas\n\n", "msg_date": "Wed, 12 Aug 1998 11:13:50 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Rule system" }, { "msg_contents": ">\n> Jan Wieck wrote:\n> > What else must be there? I think everything on the instance\n> > level is better done by triggers. And if we add\n> > row-/statement-level triggers on SELECT, there would be no\n> > reason left to have non-instead rules. Or am I missing\n> > something?\n> While this is in my opinion true, it would be nice to extend the trigger syntax to\n> allow the triggered action to be expressed in sql like:\n>\n> create trigger blabla after delete on people\n> referencing old as o\n> (insert into graves values (o.*)); -- disregard the syntax\n>\n> Andreas\n\n With PL/pgSQL I can actually do the following:\n\n create function on_death() returns opaque as '\n begin\n insert into graves (name, born, died)\n values (old.name, old.born, ''now'');\n return old;\n end;\n ' language 'plpgsql';\n\n create trigger on_death after delete on people\n for each row execute procedure on_death();\n\n I think we could extend the parser that it accepts the above\n syntax and internally creates the required trigger procedure\n and the trigger itself in the way we treat triggers now. This\n is the same way we actually deal with views (accept create\n view but do create table and create rule internally).\n\n It would require two extensions to PL/pgSQL:\n\n A 'RENAME oldname newname' in the declarations part so\n the internal trigger procedures record 'old' can be\n renamed to 'o'.\n\n Implementation of referencing record/rowtype.* extends to\n a comma separated list of parameters when manipulating\n the insert statement. My current implementation of\n PL/pgSQL can only substitute a single\n variable/recordfiled/rowfield into one parameter.\n\n These two wouldn't be that complicated. And it would have a\n real advantage. As you see above, I must double any ' because\n the function body is written inside of ''s. It's a pain - and\n here's a solution to get out of it.\n\n If anyone is happy with this, I would release PL/pgSQL after\n 6.4 and make the required changes in the parser.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Wed, 12 Aug 1998 13:51:09 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] Rule system" } ]
[ { "msg_contents": ">> Jan Wieck wrote:\n>> > What else must be there? I think everything on the instance\n>> > level is better done by triggers. And if we add\n>> > row-/statement-level triggers on SELECT, there would be no\n>> > reason left to have non-instead rules. Or am I missing\n>> > something?\n>> While this is in my opinion true, it would be nice to extend the trigger syntax to\n>> allow the triggered action to be expressed in sql like:\n>>\n>> create trigger blabla after delete on people\n>> referencing old as o\n>> (insert into graves values (o.*)); -- disregard the syntax\n>>\n>> Andreas\n>\n> With PL/pgSQL I can actually do the following:\n\n> create function on_death() returns opaque as '\n> begin\n> insert into graves (name, born, died)\n> values (old.name, old.born, ''now'');\n> return old;\n> end;\n> ' language 'plpgsql';\n>\n> create trigger on_death after delete on people\n> for each row execute procedure on_death();\n>\n> I think we could extend the parser that it accepts the above\n> syntax and internally creates the required trigger procedure\n> and the trigger itself in the way we treat triggers now. This\n> is the same way we actually deal with views (accept create\n> view but do create table and create rule internally).\nyup, that would be nice\n>\n> It would require two extensions to PL/pgSQL:\n>\n> A 'RENAME oldname newname' in the declarations part so\n> the internal trigger procedures record 'old' can be\n> renamed to 'o'.\n\nActually, since this does not give added functionality, I guess always using the\nkeywords old and new would be ok (get rid of \"current\" though, it is unclear and has \nanother SQL92 meaning).\n \n>\n> Implementation of referencing record/rowtype.* extends to\n> a comma separated list of parameters when manipulating\n> the insert statement. My current implementation of\n> PL/pgSQL can only substitute a single\n> variable/recordfiled/rowfield into one parameter.\n\nThis is a feature, that would make life easier ;-) (low priority)\n \nThe real problem I have would be procedures that return more than one column (or an opaque row/or rows),\nor nothing at all.\nLike:\n\ncreate function onename returns char(16), char(16) -- or would it have to be returns opaque ?\nas 'select \"Hans\", \"Moser\"' language 'sql';\n\ninsert into employee (fname, lname) values (onename()); -- or\ninsert into employee (fname, lname) select onename();\n>\n> These two wouldn't be that complicated. And it would have a\n> real advantage. As you see above, I must double any ' because\n> the function body is written inside of ''s. It's a pain - and\n> here's a solution to get out of it.\n\nThat is why I suggested a while ago to keyword begin and end for plpgsql,\nthen everything between begin and end would be plsql automatically without the quotes.\nThis would then be much like Oracle PL/SQL.\n\nSomething like:\ncreate function delrow (int highestsalary) as begin\ndelete from employee where sal > highestsalary; -- or :highestsalary or $highestsalary\nend;\n\n>\n> If anyone is happy with this, I would release PL/pgSQL after\n> 6.4 and make the required changes in the parser.\n>\n\nActually for me the possibility to return an opaque row from a function\nwould currently be the most important enhancement of all.\nSomewhere the code that handles the \"returns opaque\" case is missing code to\nhandle the case where a whole tuple is returned.\n\nAndreas\n\n", "msg_date": "Wed, 12 Aug 1998 14:52:20 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "Re: AW: [HACKERS] Rule system" }, { "msg_contents": "> > It would require two extensions to PL/pgSQL:\n> >\n> > A 'RENAME oldname newname' in the declarations part so\n> > the internal trigger procedures record 'old' can be\n> > renamed to 'o'.\n>\n> Actually, since this does not give added functionality, I guess always using the\n> keywords old and new would be ok (get rid of \"current\" though, it is unclear and has\n> another SQL92 meaning).\n\n But since it was soooo easy I did it already :-)\n\n And yesss - I don't have current at all. Only new and old.\n\n>\n> >\n> > Implementation of referencing record/rowtype.* extends to\n> > a comma separated list of parameters when manipulating\n> > the insert statement. My current implementation of\n> > PL/pgSQL can only substitute a single\n> > variable/recordfiled/rowfield into one parameter.\n>\n> This is a feature, that would make life easier ;-) (low priority)\n\n Agree - low priority. So I leave this feature for later.\n\n>\n> The real problem I have would be procedures that return more than one column (or an opaque row/or rows),\n> or nothing at all.\n> Like:\n>\n> create function onename returns char(16), char(16) -- or would it have to be returns opaque ?\n> as 'select \"Hans\", \"Moser\"' language 'sql';\n>\n> insert into employee (fname, lname) values (onename()); -- or\n> insert into employee (fname, lname) select onename();\n> >\n> > These two wouldn't be that complicated. And it would have a\n> > real advantage. As you see above, I must double any ' because\n> > the function body is written inside of ''s. It's a pain - and\n> > here's a solution to get out of it.\n>\n> That is why I suggested a while ago to keyword begin and end for plpgsql,\n> then everything between begin and end would be plsql automatically without the quotes.\n> This would then be much like Oracle PL/SQL.\n>\n> Something like:\n> create function delrow (int highestsalary) as begin\n> delete from employee where sal > highestsalary; -- or :highestsalary or $highestsalary\n> end;\n>\n> >\n> > If anyone is happy with this, I would release PL/pgSQL after\n> > 6.4 and make the required changes in the parser.\n> >\n>\n> Actually for me the possibility to return an opaque row from a function\n> would currently be the most important enhancement of all.\n> Somewhere the code that handles the \"returns opaque\" case is missing code to\n> handle the case where a whole tuple is returned.\n>\n> Andreas\n\n I think I should clearify some details.\n\n PL/pgSQL sticks right into the current implementation of\n loadable procedural languages. It has it's own, completely\n independent scanner and parser. PostgreSQL's CREATE FUNCTION\n simply creates a pg_proc entry with prosrc attribute set to\n the functions text.\n\n When the function (or trigger procedure which are functions\n too) is invoked, the PL/pgSQL shared object is loaded and\n called. This now reads the pg_proc tuple and compiles the\n prosrc (only done on the first call of the function).\n\n Then the PL/pgSQL executor (totally different beast from the\n PostgreSQL main executor) runs over the precompiled\n statements. Many of the statements will invoke calls to the\n SPI manager (any expression evaluation and DB access).\n\n Inside of PL/pgSQL BEGIN..END; can be nested like in Oracle's\n PL/SQL to build blocks of statements and different targets to\n where EXIT will jump out. So if we change CREATE FUNCTION to\n accept DECLARE/BEGIN..END; instead of '..' too, then it must\n count the nesting level until it reached 0 again. All that\n including the initial DECLARE/BEGIN and the final END; is the\n string for the prosrc attribute of pg_proc. Needless to say\n that comments and literal strings can contain any of these\n keywords that don't have to be counted then.\n\n Now we all know enough. So back to discussion.\n\n All restrictions that C functions have are also restrictions\n to loadable procedural language functions. And beeing unable\n to return multiple results, tuples or tuplesets is such a\n restriction to C functions. Thus, we have to extend the\n function call interface of PostgreSQL at all. But not before\n 6.4!\n\n I would really like any kind of function (C, PL/Tcl,\n PL/pgSQL, more?) to be able to return tuples or tuplesets.\n And I took a look at the executor some time ago to see how\n this might be done. But boy, this is far more to do than it\n looks like first. Function calls that return tuples have\n target lists and they don't return only a tuple, they return\n a tuple table slot containing a projection tuple (if I\n remember correctly). And functions returning tuple sets are\n one of the most ugly thing I've ever seen. In the case of a\n set return the executors func node is manipulated so the scan\n node from the last sql statement in the function can be used\n in subsequent calls to get the next row instead of invoking\n the function again. No procedural language that requires back\n control after a\n\n RETURN value AND RESUME;\n\n can procude a scan node that could fit into this model,\n except that it creates a temp table, inserting all the tuples\n to return there, and finally returning something like a\n seqscan over the temp table so they get pulled back. Hmmm -\n thinking about this is nice - might be a solution :-)\n\n I don't know if it will be possible to give all functions the\n ability to return tuples or sets. So let's assume for now\n that it doesn't work (I'll really try hard after 6.4).\n\n But then again, even if functions stay that restricted, what\n do we need as rule functionality? Up to now I only have all\n kinds of INSEAD rules on the statement level on my list.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Wed, 12 Aug 1998 16:36:07 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] Rule system" } ]
[ { "msg_contents": "\n> But then again, even if functions stay that restricted, what\n> do we need as rule functionality? Up to now I only have all\n> kinds of INSTEAD rules on the statement level on my list.\n\nThe [select] trigger can't return sets/tuples or multiple rows the select rule system can.\nThis is because of the currently restricted \"create function\" return values.\n\nI'll try to look over my diploma paper tonight, to look for rules that (at least currently)\ncannot be written as triggers (other than instead rules).\n\nWhat I like about the rewrite sytem is, that it passes through the optimizer.\nNo way the trigger stuff is going to be optimizable, is it ? It will always do something like \na nested loop.\n\nPlease let's not get rid of rules until we have the full trigger functionality discussed earlier,\neven if it does behave strangely in some cases, it is still very usable.\nI think the select rule stuff is mostly working since your last changes ;-)\nMaybe we could add syntax to the trigger statement to simply use the current\nselect rule stuff ?\n\nAndreas\n\n", "msg_date": "Wed, 12 Aug 1998 17:38:41 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "Re: AW: [HACKERS] Rule system" } ]
[ { "msg_contents": "> I had suspected that's what they were, but never really was sure. Now\n> the next question, \"Should we rip them out?\" No one uses them, and\n> they seem to be of very limited usefulness.\n> \n> I am inclinded to keep them, but I am not sure.\n> \nDo we have syntax for their creation and is it in the docs?\nIf not I say just take them out, unless someone can think of a use that\nwouldn't be served by normal indexes.\n\t\t-DEJ\n", "msg_date": "Wed, 12 Aug 1998 13:11:53 -0500", "msg_from": "\"Jackson, DeJuan\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] Re: partial index" }, { "msg_contents": ">\n> > I had suspected that's what they were, but never really was sure. Now\n> > the next question, \"Should we rip them out?\" No one uses them, and\n> > they seem to be of very limited usefulness.\n> >\n> > I am inclinded to keep them, but I am not sure.\n> >\n> Do we have syntax for their creation and is it in the docs?\n> If not I say just take them out, unless someone can think of a use that\n> wouldn't be served by normal indexes.\n> -DEJ\n>\n>\n\n I can think of a situation where this is useful (even if very\n seldom).\n\n Have a table with many rows, indexed by a char(80) field. In\n 99% of the selects the same 50 rows are searched (all having\n an 'A' as first character of the key).\n\n If you could only have these 50 in the index for fast access,\n the complete index would fit into a few blocks and can be\n searched faster. All other rows will be searched by a\n seqscan.\n\n Well, there are limits where this all gets useless. The\n speedup by having a small index (=faster index) is eaten up\n by the longer time needed by seqscans very quickly. And it's\n a hard job to keep the predicates for the partial indices\n appropriate, so some overall speedup is gained.\n\n The possible speedup from this compared against the danger of\n having a dramatic slowdown on the other side is a clear\n drawback from my point of view.\n\n So the only argument for having a partial index can be saved\n disk space. A bad argument when looking at the actual pricing\n of disks.\n\n Don't force it - use a bigger hammer!\n\n Result: Kick the partial indices out.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Wed, 12 Aug 1998 21:39:46 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: partial index" }, { "msg_contents": "> > > I had suspected that's what they were, but never really was sure. > > > Now the next question, \"Should we rip them out?\" No one uses \n> > > them, and they seem to be of very limited usefulness.\n> > > I am inclined to keep them, but I am not sure.\n> > Do we have syntax for their creation and is it in the docs?\n> > If not I say just take them out, unless someone can think of a use \n> > that wouldn't be served by normal indexes.\n> So the only argument for having a partial index can be saved\n> disk space. A bad argument when looking at the actual pricing\n> of disks.\n> Don't force it - use a bigger hammer!\n> Result: Kick the partial indices out.\n\n??? \n\nWhy remove another feature from Postgres when there isn't a clear\nbenefit to removing it? It's yet another discriminator separating\nPostgres from ordinary database systems.\n\nNow that we know what they are, we should figure out how to use them,\nand document it as DeJuan suggests.\n\n - Tom\n", "msg_date": "Thu, 13 Aug 1998 01:43:40 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: partial index" } ]
[ { "msg_contents": "On Tue, Aug 11, 1998 at 02:31:14PM -0400, The Hermit Hacker wrote:\n> \tIn my mailbox last night...it was one of those nights last\n> night...will apply and commit as soon as I get home tonight...\n\nNo problem. I just wanted to make sure we don't try to apply it twice.\n\nMarc, how's your ADSL line doing? And what are the costs of it on your side\nof the ocean?\n\nMichael\n\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Wed, 12 Aug 1998 20:40:05 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Latest ecpg patch?" }, { "msg_contents": "On Wed, 12 Aug 1998, Dr. Michael Meskes wrote:\n\n> On Tue, Aug 11, 1998 at 02:31:14PM -0400, The Hermit Hacker wrote:\n> > \tIn my mailbox last night...it was one of those nights last\n> > night...will apply and commit as soon as I get home tonight...\n> \n> No problem. I just wanted to make sure we don't try to apply it twice.\n> \n> Marc, how's your ADSL line doing? And what are the costs of it on your side\n> of the ocean?\n\n\tADSL is fantastic, they've even got it right now so that I\nactually have a \"true\" IP for the external net, so that I can actually log\nin from work into my home machine. Not sure how long that one is going to\nlast, but it was a pleasant surprise :)\n\n\tIt works out to be ~$45CDN per month, and it includes the NIC for\nmy computer...fair price considering how much less the lag is ;)\n\n\n", "msg_date": "Thu, 13 Aug 1998 08:53:15 -0400 (EDT)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Latest ecpg patch?" }, { "msg_contents": "On Thu, Aug 13, 1998 at 08:53:15AM -0400, The Hermit Hacker wrote:\n> \tADSL is fantastic, they've even got it right now so that I\n> actually have a \"true\" IP for the external net, so that I can actually log\n> in from work into my home machine. Not sure how long that one is going to\n> last, but it was a pleasant surprise :)\n\nSounds great.\n\n> \tIt works out to be ~$45CDN per month, and it includes the NIC for\n> my computer...fair price considering how much less the lag is ;)\n\nDoes this include phone fees? Or do you have to pay a line too? In Germany\nthe phone connection is so very expensive. Actually I pay DM 0.12 for every\n90 seconds.\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Thu, 13 Aug 1998 17:42:05 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Latest ecpg patch?" } ]
[ { "msg_contents": "On Friday I asked.\n\n> Has something changed recently? I created a new database and it won't\n> let me insert unless I specifically grant myself privledges. It\n> shows as being owned by me. Also, I can't create a view. It says\n> \"pg_rewrite: Permission denied.\" and doesn't create the view.\n\nI have since found out that it was changed so that no one, not even the\nowner, had full privs on the tables. I went in and changed my code\nto grant ALL on each database to the db owner. Everything is fine \nexcept that I still can't create a view. I still get that \"pg_rewrite:\nPermission denied.\" error. Any ideas?\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 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n", "msg_date": "Wed, 12 Aug 1998 15:44:53 -0400 (EDT)", "msg_from": "[email protected] (D'Arcy J.M. Cain)", "msg_from_op": true, "msg_subject": "Table permissions problem" }, { "msg_contents": "> On Friday I asked.\n> \n> > Has something changed recently? I created a new database and it won't\n> > let me insert unless I specifically grant myself privledges. It\n> > shows as being owned by me. Also, I can't create a view. It says\n> > \"pg_rewrite: Permission denied.\" and doesn't create the view.\n> \n> I have since found out that it was changed so that no one, not even the\n> owner, had full privs on the tables. I went in and changed my code\n> to grant ALL on each database to the db owner. Everything is fine \n> except that I still can't create a view. I still get that \"pg_rewrite:\n> Permission denied.\" error. Any ideas?\n> \n\nOnly superuser. From TODO:\n\n\tCREATE VIEW requires super-user priviledge\n\nThis is because someone who can modify pg_rewrite can create their own\nview to modify any table.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 12 Aug 1998 16:07:54 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Table permissions problem" }, { "msg_contents": "Thus spake Bruce Momjian\n> > I have since found out that it was changed so that no one, not even the\n> > owner, had full privs on the tables. I went in and changed my code\n> > to grant ALL on each database to the db owner. Everything is fine \n> > except that I still can't create a view. I still get that \"pg_rewrite:\n> > Permission denied.\" error. Any ideas?\n> > \n> \n> Only superuser. From TODO:\n> \n> \tCREATE VIEW requires super-user priviledge\n> \n> This is because someone who can modify pg_rewrite can create their own\n> view to modify any table.\n\nHmm. That makes it difficult. I would like to build databases from\nscripts. I guess I can build them as the super user.\n\nShouldn't the database owner have more privs then someone using the\ndatabase? Is that what that TODO item is actually suggesting?\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 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n", "msg_date": "Wed, 12 Aug 1998 23:00:19 -0400 (EDT)", "msg_from": "[email protected] (D'Arcy J.M. Cain)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Table permissions problem" }, { "msg_contents": "> Thus spake Bruce Momjian\n> > > I have since found out that it was changed so that no one, not even the\n> > > owner, had full privs on the tables. I went in and changed my code\n> > > to grant ALL on each database to the db owner. Everything is fine \n> > > except that I still can't create a view. I still get that \"pg_rewrite:\n> > > Permission denied.\" error. Any ideas?\n> > > \n> > \n> > Only superuser. From TODO:\n> > \n> > \tCREATE VIEW requires super-user priviledge\n> > \n> > This is because someone who can modify pg_rewrite can create their own\n> > view to modify any table.\n> \n> Hmm. That makes it difficult. I would like to build databases from\n> scripts. I guess I can build them as the super user.\n> \n> Shouldn't the database owner have more privs then someone using the\n> database? Is that what that TODO item is actually suggesting?\n\nRemember some tables are shared with all databases. Makes things more\ndifficult.\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 13 Aug 1998 01:00:40 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Table permissions problem" }, { "msg_contents": ">\n> > Thus spake Bruce Momjian\n> > > > I have since found out that it was changed so that no one, not even the\n> > > > owner, had full privs on the tables. I went in and changed my code\n> > > > to grant ALL on each database to the db owner. Everything is fine\n> > > > except that I still can't create a view. I still get that \"pg_rewrite:\n> > > > Permission denied.\" error. Any ideas?\n> > > >\n> > >\n> > > Only superuser. From TODO:\n> > >\n> > > CREATE VIEW requires super-user priviledge\n> > >\n> > > This is because someone who can modify pg_rewrite can create their own\n> > > view to modify any table.\n> >\n> > Hmm. That makes it difficult. I would like to build databases from\n> > scripts. I guess I can build them as the super user.\n> >\n> > Shouldn't the database owner have more privs then someone using the\n> > database? Is that what that TODO item is actually suggesting?\n>\n> Remember some tables are shared with all databases. Makes things more\n> difficult.\n\n And that's why I suggested a uid/euid model over functions,\n triggers and views, where the permission checks are done\n against the function/view owner instead of the current user.\n If nobody reverted things, this is already done for views\n (pg_user vs pg_shadow). The ACL checks are done during the\n rewrite.\n\n So CREATE VIEW or CREATE RULE could eventually use some trick\n to get around the restrictions on pg_rewrite but ensure that\n the rule owner is the one creating it. Pg_rewrite itself must\n be protected, otherwise a user could change the ownership of\n a view and get around access restrictions.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Thu, 13 Aug 1998 11:19:14 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Table permissions problem" }, { "msg_contents": "> > Remember some tables are shared with all databases. Makes things more\n> > difficult.\n> \n> And that's why I suggested a uid/euid model over functions,\n> triggers and views, where the permission checks are done\n> against the function/view owner instead of the current user.\n> If nobody reverted things, this is already done for views\n> (pg_user vs pg_shadow). The ACL checks are done during the\n> rewrite.\n> \n> So CREATE VIEW or CREATE RULE could eventually use some trick\n> to get around the restrictions on pg_rewrite but ensure that\n> the rule owner is the one creating it. Pg_rewrite itself must\n> be protected, otherwise a user could change the ownership of\n> a view and get around access restrictions.\n\nCouldn't we do some permission checks on tables at runtime from the\nrewrite system ONLY when a table is being added or UPDATE is added to\nSELECT, etc?\n\nWould that solve the problem? Maybe not because you would have to rip\napart the plan, wouldn't you?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 13 Aug 1998 07:36:13 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Table permissions problem" }, { "msg_contents": "Thus spake Bruce Momjian\n> > Hmm. That makes it difficult. I would like to build databases from\n> > scripts. I guess I can build them as the super user.\n> > \n> > Shouldn't the database owner have more privs then someone using the\n> > database? Is that what that TODO item is actually suggesting?\n> \n> Remember some tables are shared with all databases. Makes things more\n> difficult.\n\nI didn't realize that. I assume that you don't mean some system tables\nas they could, I am sure, be special cased. Can you expand? I once\nhad a situation where a table in one database was trashed by being filled\nwith data from another table of the same name in another database. Was\nI bitten by this feature somehow? At the same time I like the idea of\nsharing tables. It would be perfect for things like time zone and\nprovince/state tables.\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 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n", "msg_date": "Thu, 13 Aug 1998 08:35:35 -0400 (EDT)", "msg_from": "[email protected] (D'Arcy J.M. Cain)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Table permissions problem" }, { "msg_contents": ">\n> Thus spake Bruce Momjian\n> > > Hmm. That makes it difficult. I would like to build databases from\n> > > scripts. I guess I can build them as the super user.\n> > >\n> > > Shouldn't the database owner have more privs then someone using the\n> > > database? Is that what that TODO item is actually suggesting?\n> >\n> > Remember some tables are shared with all databases. Makes things more\n> > difficult.\n>\n> I didn't realize that. I assume that you don't mean some system tables\n> as they could, I am sure, be special cased. Can you expand? I once\n> had a situation where a table in one database was trashed by being filled\n> with data from another table of the same name in another database. Was\n> I bitten by this feature somehow? At the same time I like the idea of\n> sharing tables. It would be perfect for things like time zone and\n> province/state tables.\n\n Especially system tables (pg_database, pg_shadow!, ...).\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Thu, 13 Aug 1998 15:42:49 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Table permissions problem" }, { "msg_contents": ">\n> > > Remember some tables are shared with all databases. Makes things more\n> > > difficult.\n> >\n> > And that's why I suggested a uid/euid model over functions,\n> > triggers and views, where the permission checks are done\n> > against the function/view owner instead of the current user.\n> > If nobody reverted things, this is already done for views\n> > (pg_user vs pg_shadow). The ACL checks are done during the\n> > rewrite.\n> >\n> > So CREATE VIEW or CREATE RULE could eventually use some trick\n> > to get around the restrictions on pg_rewrite but ensure that\n> > the rule owner is the one creating it. Pg_rewrite itself must\n> > be protected, otherwise a user could change the ownership of\n> > a view and get around access restrictions.\n>\n> Couldn't we do some permission checks on tables at runtime from the\n> rewrite system ONLY when a table is being added or UPDATE is added to\n> SELECT, etc?\n>\n> Would that solve the problem? Maybe not because you would have to rip\n> apart the plan, wouldn't you?\n>\n> --\n> Bruce Momjian | 830 Blythe Avenue\n\n I checked it. It's all already there. The rewrite handler\n checks for all the range table entries he adds to the query,\n if the rule owner has the appropriate permissions\n (read/write). And it sets the skipAcl field for these rte's\n so the executor later will ignore them.\n\n The only thing missing is that CREATE VIEW and CREATE RULE\n require write access to pg_rewrite (create view does a create\n table and create rule internally). But we cannot grant write\n access on pg_rewrite to looser users. So I think a global\n variable, turning off the whole ACL system temporary, would\n do.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Thu, 13 Aug 1998 15:54:32 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Table permissions problem" }, { "msg_contents": "> Thus spake Bruce Momjian\n> > > Hmm. That makes it difficult. I would like to build databases from\n> > > scripts. I guess I can build them as the super user.\n> > > \n> > > Shouldn't the database owner have more privs then someone using the\n> > > database? Is that what that TODO item is actually suggesting?\n> > \n> > Remember some tables are shared with all databases. Makes things more\n> > difficult.\n> \n> I didn't realize that. I assume that you don't mean some system tables\n> as they could, I am sure, be special cased. Can you expand? I once\n> had a situation where a table in one database was trashed by being filled\n> with data from another table of the same name in another database. Was\n> I bitten by this feature somehow? At the same time I like the idea of\n> sharing tables. It would be perfect for things like time zone and\n> province/state tables.\n\nSee pgsql/data/ and you will see the tables that are shared:\n\n\tpg_database\n\tpg_group\n\tpg_shadow\n\tpg_variable\n\nMakes sense they have to be shared.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 13 Aug 1998 10:32:50 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Table permissions problem" }, { "msg_contents": "> > Would that solve the problem? Maybe not because you would have to rip\n> > apart the plan, wouldn't you?\n> >\n> > --\n> > Bruce Momjian | 830 Blythe Avenue\n> \n> I checked it. It's all already there. The rewrite handler\n> checks for all the range table entries he adds to the query,\n> if the rule owner has the appropriate permissions\n> (read/write). And it sets the skipAcl field for these rte's\n> so the executor later will ignore them.\n> \n> The only thing missing is that CREATE VIEW and CREATE RULE\n> require write access to pg_rewrite (create view does a create\n> table and create rule internally). But we cannot grant write\n> access on pg_rewrite to looser users. So I think a global\n> variable, turning off the whole ACL system temporary, would\n> do.\n\nI understand. We don't have APPEND rights separate from MODIFY rights.\nActually, I think they are defined in the system, but not used. We have\na similar problem with pg_database. People who can create databases can\nremove other database entries from pg_database.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 13 Aug 1998 11:26:06 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Table permissions problem" }, { "msg_contents": "Thus spake Bruce Momjian\n> > > Remember some tables are shared with all databases. Makes things more\n> > > difficult.\n> > \n> > I didn't realize that. I assume that you don't mean some system tables\n> > as they could, I am sure, be special cased. Can you expand? I once\n> > had a situation where a table in one database was trashed by being filled\n> > with data from another table of the same name in another database. Was\n> > I bitten by this feature somehow? At the same time I like the idea of\n> > sharing tables. It would be perfect for things like time zone and\n> > province/state tables.\n> \n> See pgsql/data/ and you will see the tables that are shared:\n> \n> \tpg_database\n> \tpg_group\n> \tpg_shadow\n> \tpg_variable\n> \n> Makes sense they have to be shared.\n\nSure. I guess that had nothing to do with my problem then. I guess it\nalso means that I can't share tables myself like I mentioned. Oh well.\n\nSo could we special case these tables then and let the database owner\ncreate views on the rest?\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 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n", "msg_date": "Thu, 13 Aug 1998 12:13:15 -0400 (EDT)", "msg_from": "[email protected] (D'Arcy J.M. Cain)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Table permissions problem" } ]
[ { "msg_contents": "Hi,\n\n I really wonder if anybody ever used functions returning\n tuples or sets of tuples. If so, be careful!\n\n Let's have a look at the following test:\n\ncreate table emp (name text, salary money);\ncreate table sal_log (empname text, salchg money, who text, when datetime);\n\ncreate function change_sal(text, money) returns emp as '\n update emp set salary = salary + $2 where name = $1;\n insert into sal_log values ($1, $2, getpgusername(), ''now'');\n select * from emp where name = $1;' language 'sql';\n -- **** ^^^\n -- **** |||\n\ninsert into emp values ('Jan', '0.00');\nselect change_sal('Jan', '1000.00');\nCREATE\nCREATE\nCREATE\nINSERT 18423 1\nchange_sal\n----------\n 136044880\n(1 row)\n -- **** 136044880 is the memory address of the tuple table slot\n -- **** returned by the function change_sal() - very useful :-)\n\nselect * from emp;\nname|salary\n----+---------\nJan |$1,000.00\n(1 row)\n\nselect * from sal_log;\nempname|salchg |who |when\n-------+---------+-----+--------------------------------\nJan |$1,000.00|pgsql|Thu Aug 13 12:46:28 1998 MET DST\n(1 row)\n -- **** But the result is OK so far\n\n -- **** Now we use the so called nested dot notation to get\n -- **** the name from the returned tuple\nselect name(change_sal('Jan', '1000.00'));\nname\n----\nJan\n(1 row)\n -- **** That's right\n\nselect * from emp;\nname|salary\n----+------\nJan |\n(1 row)\n\nselect * from sal_log;\nempname|salchg |who |when\n-------+---------+-----+--------------------------------\nJan |$1,000.00|pgsql|Thu Aug 13 12:46:28 1998 MET DST\nJan |$1,000.00|pgsql|Thu Aug 13 12:46:28 1998 MET DST\nJan | |pgsql|Thu Aug 13 12:46:28 1998 MET DST\n(3 rows)\nEOF\n -- **** But this isn't what anyone would expect\n\n Background:\n\n I'm not really sure if I used the correct syntax to access a\n field from the returned tuple. If not, please correct me.\n\n The reason for the behaviour is the generated querytree. It\n is a nested function call of two times change_sal(). There\n is a func node for change_sal() with one argument that is\n change_sal('Jan', '1000.0') func node. Both func nodes have\n the same targetlist about 'name'.\n\n At the beginning of ExecMakeFunctionResult() the argument\n from the outer is evaluated and causes the call of the inner\n one. When the inner one finishes, it returns the name (due to\n the target list). This single return value then replaces the\n argument vector for the outer func node. Now\n postquel_function() is called but with only one argument, the\n second expected argument now is a NULL value. That explains\n the behaviour above.\n\n But don't expect\n\n select salary(change_sal('Jan', '1000.00'))\n\n to work. It causes an\n\n ERROR: Tuple is too big: size 200064\n\n Even if you have a function not updating or inserting\n something, the generated querytree causes the function to be\n called twice. So a simple function just doing one select and\n returning a tuple type causes two scans.\n\n What I absolutely don't know is, what is it good for? How is\n the correct syntax to access more than one field from the\n returned tuple?\n\n Shouldn't the call of a function returning a tuple without\n the surrounding attrname(...) have a targetlist too? If so,\n the complete targetlist must be used when building the\n projection tuple, not only the first TLE as it is implemented\n now.\n\n And I think the parser/planner must not generate nested func\n nodes.\n\n I'm really willing to dive into, but should I do it before or\n after 6.4? Doing it before would mean 6.4 NOT AT THE END OF\n THIS MONTH!\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Thu, 13 Aug 1998 13:35:51 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "tuple return from function" }, { "msg_contents": "> \n> But don't expect\n> \n> select salary(change_sal('Jan', '1000.00'))\n> \n> to work. It causes an\n> \n> ERROR: Tuple is too big: size 200064\n> \n> Even if you have a function not updating or inserting\n> something, the generated querytree causes the function to be\n> called twice. So a simple function just doing one select and\n> returning a tuple type causes two scans.\n> \n> What I absolutely don't know is, what is it good for? How is\n> the correct syntax to access more than one field from the\n> returned tuple?\n> \n> Shouldn't the call of a function returning a tuple without\n> the surrounding attrname(...) have a targetlist too? If so,\n> the complete targetlist must be used when building the\n> projection tuple, not only the first TLE as it is implemented\n> now.\n> \n> And I think the parser/planner must not generate nested func\n> nodes.\n> \n> I'm really willing to dive into, but should I do it before or\n> after 6.4? Doing it before would mean 6.4 NOT AT THE END OF\n> THIS MONTH!\n\nI have felt that the 'return set' has only worked in limited cases. \nVadim seems to know there are problems, particularly with free'ing\nmemory.\n\nMy question is whether this relates to the rules system rewrite or the\nPL/SQL language module?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 13 Aug 1998 08:22:57 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] tuple return from function" }, { "msg_contents": "> I have felt that the 'return set' has only worked in limited cases.\n> Vadim seems to know there are problems, particularly with free'ing\n> memory.\n>\n> My question is whether this relates to the rules system rewrite or the\n> PL/SQL language module?\n>\n> --\n> Bruce Momjian | 830 Blythe Avenue\n\n It does not relate to the rule system.\n\n But it relates to the procedural language functions. It would\n be nice to enable tuples and setof tuples as return type for\n PL/pgSQL and other languages. Currently this is restricted to\n 'sql' functions and the return type of tuple (not setof) is\n broken.\n\n In the case of a function returning SETOF tupletype, it\n works. The function\n\n create function f1(int4) returns setof t1 as '\n insert into t2 values (''now'');\n select * from t1 where a < $1;\n ' language 'sql';\n\n when called as\n\n select a(f1(5));\n\n produces a RESULT plan with one entry in the qptargetlist\n that contains an ITER->EXPR->FUNC where the FUNC node has a\n targetlist with one entry for attribute a. The function is\n only executed once.\n\n But when called as\n\n select a(f1(5)), b(f1(5));\n\n produces a RESULT plan with two entries in the qptargetlist\n where each contains an ITER->EXPR->FUNC where the FUNC node\n has again a targetlist with one entry. The result looks\n right, but the function is executed two times (this time two\n new entries in t2). This might be right, because the\n arguments to f1() could differ. What I haven't found is the\n ability to evaluate the function once and use multiple\n attributes from the return set.\n\n So you cannot do something like\n\n insert into t3 select f1(5);\n\n What this demonstrates clearly to me is that return types of\n tuple or sets don't really do what they should.\n\n First I think the call to a function returning one tuple with\n attribute specification must be fixed. It must not generate\n the same function call twice (one time inside the argument\n list of the outer one).\n\n Second the plain tuple return value must be useful in any\n way. Currently you cannot have functions f1(int4) returns t1\n and f2(t1) and then do something like f2(f1(5)). It tells 'f2\n has bad return type ...'.\n\n Third there should be an enhancement to specify some or all\n of the attributes like\n\n select F.a, F.c, F.e from f1(5) F;\n\n or\n\n select * from f1(5);\n\n If this is done, ExecMakeFunctionResult() can be extended. If\n there is a targetlist in the func node of a C function (for\n ExecMake... there is no difference between C, PL/TCL or\n PL/pgSQL), it knows that the return value is a tuple or\n tupletable or temp relation or whatever and it can manage for\n the requested projection and for the iteration (if function\n isset).\n\n But should we do that all (and the rule stuff) before 6.4?\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Thu, 13 Aug 1998 17:21:26 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] tuple return from function" }, { "msg_contents": "> there is a targetlist in the func node of a C function (for\n> ExecMake... there is no difference between C, PL/TCL or\n> PL/pgSQL), it knows that the return value is a tuple or\n> tupletable or temp relation or whatever and it can manage for\n> the requested projection and for the iteration (if function\n> isset).\n> \n> But should we do that all (and the rule stuff) before 6.4?\n\nSorry to say this, but I think we need the rewrite stuff done for 6.4. \nToo many bugs and limited features.\n\nThe PL/pgSQL perhaps can be started now, but not ready until 6.5? I\ndon't think we should delay 6.4 for PL/pgSQL, do you?\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 13 Aug 1998 11:29:36 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] tuple return from function" }, { "msg_contents": "Bruce Momjian wrote:\n\n> Sorry to say this, but I think we need the rewrite stuff done for 6.4.\n> Too many bugs and limited features.\n\n Thats right. Do you also agree in that only the instead rules\n should be left?\n\n>\n> The PL/pgSQL perhaps can be started now, but not ready until 6.5? I\n> don't think we should delay 6.4 for PL/pgSQL, do you?\n\n It is in a good, stable state now. I would like to have it\n shipped with 6.4, because removing the non-instead rules is a\n loss of functionality and at least we must provide another\n way. Someone might currently use rules for some extra\n actions. But this is subject to trigger procedures. Up to now\n there's only C and Tcl available for it. Not anyone likes Tcl\n - and writing the triggers in C isn't fun for SQL\n programmers.\n\n I'll pack it and send it to you after a last check of the\n code.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Thu, 13 Aug 1998 18:11:48 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] tuple return from function" }, { "msg_contents": "> Bruce Momjian wrote:\n> \n> > Sorry to say this, but I think we need the rewrite stuff done for 6.4.\n> > Too many bugs and limited features.\n> \n> Thats right. Do you also agree in that only the instead rules\n> should be left?\n\nBeats me. Whatever the other developers think.\n\n> \n> >\n> > The PL/pgSQL perhaps can be started now, but not ready until 6.5? I\n> > don't think we should delay 6.4 for PL/pgSQL, do you?\n> \n> It is in a good, stable state now. I would like to have it\n> shipped with 6.4, because removing the non-instead rules is a\n> loss of functionality and at least we must provide another\n> way. Someone might currently use rules for some extra\n> actions. But this is subject to trigger procedures. Up to now\n> there's only C and Tcl available for it. Not anyone likes Tcl\n> - and writing the triggers in C isn't fun for SQL\n> programmers.\n> \n> I'll pack it and send it to you after a last check of the\n> code.\n\nSure, we will ship whatever you have, even if it is not perfect.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Thu, 13 Aug 1998 13:31:54 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] tuple return from function" } ]
[ { "msg_contents": ">> But then again, even if functions stay that restricted, what\n>> do we need as rule functionality? Up to now I only have all\n>> kinds of INSTEAD rules on the statement level on my list.\n>\n>The [select] trigger can't return sets/tuples or multiple rows the select rule system can.\n>This is because of the currently restricted \"create function\" return values.\n>\n>I'll try to look over my diploma paper tonight, to look for rules that (at least currently)\n>cannot be written as triggers (other than instead rules).\n\nOk, I did not find anything (I tried hard) :-). Especially nothing that would currently work.\n(I know more of it did work in postgres 4.2 though :-( )\nSo I really think the insert/update/delete rules, other than the instead stuff of course, are oblivious,\nand don't work properly anyways, so we could probably really nuke them.\nNot the select rules of course !\n\nI still think the trigger syntax should be extended to allow a block of sql, like in Informix. \nThen you could: execute one or more procedures, or as in most cases \ndo a simple statement like cascade a delete. Also a syntax would be nice\nthat would allow to change the \"new\" tuple.\n\nIn Informix the block begins with a ( and ends with ), the statements are separated by commas:\n\n(insert into log values ('insert', new.name),\nexecute procedure current_datetime() into new.lastupdate)\n\nWhile I dont particularly like the syntax it does provide excellent functionality.\n\nAndreas\n\n", "msg_date": "Thu, 13 Aug 1998 16:22:40 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "AW: AW: [HACKERS] Rule system" } ]
[ { "msg_contents": "Didn't we configure the mail lists to reject submissions from\nnonmembers?\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 13 Aug 1998 11:26:47 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] HELP all women were raped during the May riots in\n\tJakarta" }, { "msg_contents": "On Thu, 13 Aug 1998, Tom Lane wrote:\n\n> Didn't we configure the mail lists to reject submissions from\n> nonmembers?\n\n\tFixed...\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Fri, 14 Aug 1998 02:32:26 -0300 (ADT)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] HELP all women were raped during the May riots in\n\tJakarta" } ]
[ { "msg_contents": "Hi,\n\nI managed to recreate a simple example that's crashing postgres. I am\nrunning on a DEC Alpha with Digital Unix Version 4.0d and Postgres\n3.2. I tried this example several times, on several databases and it\ncrashes every time. We also re-built Postgres and still did not work.\nHere's the example. Can anybody please help?\n\nThank you...\nGeorge K.\n/***** INPUT FILE: hist.sql *******/\n\ndrop table tasks;\nCREATE TABLE tasks (\ntask INT4 NOT NULL,\njob INT4 NOT NULL,\nVersion1 CHAR(6) DEFAULT '',\nVersion2 CHAR(6) DEFAULT '',\nVersion3 CHAR(6) DEFAULT '',\nVersion4 CHAR(6) DEFAULT '',\nVersion5 CHAR(6) DEFAULT ''\n);\n\nINSERT INTO tasks (task, job) VALUES (1, 1);\nselect * from tasks;\nupdate tasks set version1='1',version2='2', version3='3', version4='4',\nversion5='5' where task=1;\nselect * from tasks;\n\n\n/****** OUTPUT FROM pgsql **********/\ntest=> \\i hist.sql\ndrop table tasks;\nDROP\nCREATE TABLE tasks (\ntask INT4 NOT NULL,\njob INT4 NOT NULL,\nVersion1 CHAR(6) DEFAULT '',\nVersion2 CHAR(6) DEFAULT '',\nVersion3 CHAR(6) DEFAULT '',\nVersion4 CHAR(6) DEFAULT '',\nVersion5 CHAR(6) DEFAULT ''\n);\nCREATE\n\nINSERT INTO tasks (task, job) VALUES (1, 1);\nINSERT 4410388 1\nselect * from tasks;\ntask|job|version1|version2|version3|version4|version5\n----+---+--------+--------+--------+--------+--------\n 1| 1| | | | |\n(1 row)\n\nupdate tasks set version1='1',version2='2', version3='3', version4='4',\nversion5='5' where task=1;\nUPDATE 1\nselect * from tasks;\nFATAL: unrecognized data from the backend. It probably dumped core.\nFATAL: unrecognized data from the backend. It probably dumped core.\n\nEOF\ntest=>\n\n\n\n\n", "msg_date": "Thu, 13 Aug 1998 18:54:16 +0300", "msg_from": "George Kousi <[email protected]>", "msg_from_op": true, "msg_subject": "More details on Database corruption" }, { "msg_contents": "It seems to be the same for me...\nBut I can see \"tasks\" table after restarting of psql,\nso it doesn't crash the data files.\n\nWhat can be usefull is the messages in the server.log file:\nToo Large Allocation Request ... File: mcxt.c Line: 232\n\nI don't know the code of PG, but we can ask PG \"gurus\" ...\nDimitri\n\nOn Thu, 13 Aug 1998, you wrote:\n>Hi,\r\n>\r\n>I managed to recreate a simple example that's crashing postgres. I am\r\n>running on a DEC Alpha with Digital Unix Version 4.0d and Postgres\r\n>3.2. I tried this example several times, on several databases and it\r\n>crashes every time. We also re-built Postgres and still did not work.\r\n>Here's the example. Can anybody please help?\r\n>\r\n>Thank you...\r\n>George K.\r\n>/***** INPUT FILE: hist.sql *******/\r\n>\r\n>drop table tasks;\r\n>CREATE TABLE tasks (\r\n>task INT4 NOT NULL,\r\n>job INT4 NOT NULL,\r\n>Version1 CHAR(6) DEFAULT '',\r\n>Version2 CHAR(6) DEFAULT '',\r\n>Version3 CHAR(6) DEFAULT '',\r\n>Version4 CHAR(6) DEFAULT '',\r\n>Version5 CHAR(6) DEFAULT ''\r\n>);\r\n>\r\n>INSERT INTO tasks (task, job) VALUES (1, 1);\r\n>select * from tasks;\r\n>update tasks set version1='1',version2='2', version3='3', version4='4',\r\n>version5='5' where task=1;\r\n>select * from tasks;\r\n>\r\n>\r\n>/****** OUTPUT FROM pgsql **********/\r\n>test=> \\i hist.sql\r\n>drop table tasks;\r\n>DROP\r\n>CREATE TABLE tasks (\r\n>task INT4 NOT NULL,\r\n>job INT4 NOT NULL,\r\n>Version1 CHAR(6) DEFAULT '',\r\n>Version2 CHAR(6) DEFAULT '',\r\n>Version3 CHAR(6) DEFAULT '',\r\n>Version4 CHAR(6) DEFAULT '',\r\n>Version5 CHAR(6) DEFAULT ''\r\n>);\r\n>CREATE\r\n>\r\n>INSERT INTO tasks (task, job) VALUES (1, 1);\r\n>INSERT 4410388 1\r\n>select * from tasks;\r\n>task|job|version1|version2|version3|version4|version5\r\n>----+---+--------+--------+--------+--------+--------\r\n> 1| 1| | | | |\r\n>(1 row)\r\n>\r\n>update tasks set version1='1',version2='2', version3='3', version4='4',\r\n>version5='5' where task=1;\r\n>UPDATE 1\r\n>select * from tasks;\r\n>FATAL: unrecognized data from the backend. It probably dumped core.\r\n>FATAL: unrecognized data from the backend. It probably dumped core.\r\n>\r\n>EOF\r\n>test=>\n--\n=====================================================\n Dimitri KRAVTCHUK (dim) Sun Microsystems\n Benchmark Engineer France \n [email protected]\n=====================================================\n", "msg_date": "Thu, 13 Aug 1998 18:45:01 +0200", "msg_from": "Dimitri <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] More details on Database corruption" }, { "msg_contents": "On Thu, 13 Aug 1998, George Kousi wrote:\n\n> CREATE TABLE tasks (\n> task INT4 NOT NULL,\n> job INT4 NOT NULL,\n> Version1 CHAR(6) DEFAULT '',\n> Version2 CHAR(6) DEFAULT '',\n> Version3 CHAR(6) DEFAULT '',\n> Version4 CHAR(6) DEFAULT '',\n> Version5 CHAR(6) DEFAULT ''\n> );\n\nA zero-length string ('') is not a valid default value for a CHAR(6).\nI replaced it with ' ' (six blanks) and all runs fine.\n\nI run 6.3.1 on Linux 2.0.27 and your script fails on the first insert\nwithout corruption problems. I don't know why it only fails on update on\nyour system.\n\nRegards - guido\n\n------------------------------------------------------------------------\n// Guido Carlo Piazzi Accompagnatore naturalistico\n// [email protected] Visitate il sito WWW.ParcoDelTicino.Pmn.It\n------------------------------------------------------------------------\n\n", "msg_date": "Fri, 14 Aug 1998 11:36:57 +0200 (MET DST)", "msg_from": "Guido Piazzi <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] More details on Database corruption" }, { "msg_contents": "I am able to reproduce this. The problem is that the DEFAULT string is\nnot the same length as the column. Anyone know how to fix this?\n\n\n\n> Hi,\n> \n> I managed to recreate a simple example that's crashing postgres. I am\n> running on a DEC Alpha with Digital Unix Version 4.0d and Postgres\n> 3.2. I tried this example several times, on several databases and it\n> crashes every time. We also re-built Postgres and still did not work.\n> Here's the example. Can anybody please help?\n> \n> Thank you...\n> George K.\n> /***** INPUT FILE: hist.sql *******/\n> \n> drop table tasks;\n> CREATE TABLE tasks (\n> task INT4 NOT NULL,\n> job INT4 NOT NULL,\n> Version1 CHAR(6) DEFAULT '',\n> Version2 CHAR(6) DEFAULT '',\n> Version3 CHAR(6) DEFAULT '',\n> Version4 CHAR(6) DEFAULT '',\n> Version5 CHAR(6) DEFAULT ''\n> );\n> \n> INSERT INTO tasks (task, job) VALUES (1, 1);\n> select * from tasks;\n> update tasks set version1='1',version2='2', version3='3', version4='4',\n> version5='5' where task=1;\n> select * from tasks;\n> \n> \n> /****** OUTPUT FROM pgsql **********/\n> test=> \\i hist.sql\n> drop table tasks;\n> DROP\n> CREATE TABLE tasks (\n> task INT4 NOT NULL,\n> job INT4 NOT NULL,\n> Version1 CHAR(6) DEFAULT '',\n> Version2 CHAR(6) DEFAULT '',\n> Version3 CHAR(6) DEFAULT '',\n> Version4 CHAR(6) DEFAULT '',\n> Version5 CHAR(6) DEFAULT ''\n> );\n> CREATE\n> \n> INSERT INTO tasks (task, job) VALUES (1, 1);\n> INSERT 4410388 1\n> select * from tasks;\n> task|job|version1|version2|version3|version4|version5\n> ----+---+--------+--------+--------+--------+--------\n> 1| 1| | | | |\n> (1 row)\n> \n> update tasks set version1='1',version2='2', version3='3', version4='4',\n> version5='5' where task=1;\n> UPDATE 1\n> select * from tasks;\n> FATAL: unrecognized data from the backend. It probably dumped core.\n> FATAL: unrecognized data from the backend. It probably dumped core.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 22 Aug 1998 08:29:45 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] More details on Database corruption" }, { "msg_contents": "> The problem is that the DEFAULT string is\n> not the same length as the column. Anyone know how to fix this?\n\nI can put this on my list of things to look at, but I'm not sure why\nthis is causing the backend to crash. Is is a problem with storage\nallocation when updating columns? Or is it a problem with storage which\nis already corrupted by the zero-length default character strings?? I\nwould think that the default string is not looked at during the update,\nso the damage happened during the initial insert, right?\n\n - Tom\n", "msg_date": "Mon, 24 Aug 1998 15:01:39 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] More details on Database corruption" }, { "msg_contents": "> > The problem is that the DEFAULT string is\n> > not the same length as the column. Anyone know how to fix this?\n> \n> I can put this on my list of things to look at, but I'm not sure why\n> this is causing the backend to crash. Is is a problem with storage\n> allocation when updating columns? Or is it a problem with storage which\n> is already corrupted by the zero-length default character strings?? I\n> would think that the default string is not looked at during the update,\n> so the damage happened during the initial insert, right?\n\nIt is an Assert which is saying, 'If it is a fixed-length field, it\nbetter have the same length.'\n\nDo you want the backtrace line?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Mon, 24 Aug 1998 11:38:03 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] More details on Database corruption" }, { "msg_contents": "> Do you want the backtrace line?\n\nJust tell me where the check is happening, and I'll look. Not sure what\nto do about it yet...\n\n - Tom\n", "msg_date": "Tue, 25 Aug 1998 02:57:17 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] More details on Database corruption" }, { "msg_contents": "Here is a bug report from August. The bug still exists.\n\nIf you remove the DEFAULT's, it does not crash. If you exit the session\nafter the UPDATE, and execute SELECT in a new session, it does not crash\nand yields the correct results.\n\nThe crash happens in the executor, and it clearly shows it getting an\ninvalid value for the version2 column:\n\n(gdb) print att[3][0]\n$12 = {attrelid = 0, attname = {data = \"version2\", '\\000' <repeats 23 times>}, \n atttypid = 1042, attdisbursion = 0, attlen = -1, attnum = 4, attnelems = 0, \n attcacheoff = -1, atttypmod = 10, attbyval = 0 '\\000', attisset = 0 '\\000', \n attalign = 105 'i', attnotnull = 0 '\\000', atthasdef = 0 '\\000'}\n(gdb) print *(struct varlena *)value[3]\n$13 = {vl_len = 538976305, vl_dat = \" \"}\n\nCan anyone suggest a cause?\n\n\n> Hi,\n> \n> I managed to recreate a simple example that's crashing postgres. I am\n> running on a DEC Alpha with Digital Unix Version 4.0d and Postgres\n> 3.2. I tried this example several times, on several databases and it\n> crashes every time. We also re-built Postgres and still did not work.\n> Here's the example. Can anybody please help?\n> \n> Thank you...\n> George K.\n> /***** INPUT FILE: hist.sql *******/\n> \n> drop table tasks;\n> CREATE TABLE tasks (\n> task INT4 NOT NULL,\n> job INT4 NOT NULL,\n> Version1 CHAR(6) DEFAULT '',\n> Version2 CHAR(6) DEFAULT '',\n> Version3 CHAR(6) DEFAULT '',\n> Version4 CHAR(6) DEFAULT '',\n> Version5 CHAR(6) DEFAULT ''\n> );\n> \n> INSERT INTO tasks (task, job) VALUES (1, 1);\n> select * from tasks;\n> update tasks set version1='1',version2='2', version3='3', version4='4',\n> version5='5' where task=1;\n> select * from tasks;\n> \n> \n> /****** OUTPUT FROM pgsql **********/\n> test=> \\i hist.sql\n> drop table tasks;\n> DROP\n> CREATE TABLE tasks (\n> task INT4 NOT NULL,\n> job INT4 NOT NULL,\n> Version1 CHAR(6) DEFAULT '',\n> Version2 CHAR(6) DEFAULT '',\n> Version3 CHAR(6) DEFAULT '',\n> Version4 CHAR(6) DEFAULT '',\n> Version5 CHAR(6) DEFAULT ''\n> );\n> CREATE\n> \n> INSERT INTO tasks (task, job) VALUES (1, 1);\n> INSERT 4410388 1\n> select * from tasks;\n> task|job|version1|version2|version3|version4|version5\n> ----+---+--------+--------+--------+--------+--------\n> 1| 1| | | | |\n> (1 row)\n> \n> update tasks set version1='1',version2='2', version3='3', version4='4',\n> version5='5' where task=1;\n> UPDATE 1\n> select * from tasks;\n> FATAL: unrecognized data from the backend. It probably dumped core.\n> FATAL: unrecognized data from the backend. It probably dumped core.\n> \n> EOF\n> test=>\n> \n> \n> \n> \n> \n> \n\n\n-- \n Bruce Momjian | http://www.op.net/~candle\n [email protected] | (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, 14 Mar 1999 16:21:09 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] More details on Database corruption" } ]
[ { "msg_contents": ">\n> >> But then again, even if functions stay that restricted, what\n> >> do we need as rule functionality? Up to now I only have all\n> >> kinds of INSTEAD rules on the statement level on my list.\n> >\n> >The [select] trigger can't return sets/tuples or multiple rows the select rule system can.\n> >This is because of the currently restricted \"create function\" return values.\n> >\n> >I'll try to look over my diploma paper tonight, to look for rules that (at least currently)\n> >cannot be written as triggers (other than instead rules).\n>\n> Ok, I did not find anything (I tried hard) :-). Especially nothing that would currently work.\n> (I know more of it did work in postgres 4.2 though :-( )\n> So I really think the insert/update/delete rules, other than the instead stuff of course, are oblivious,\n> and don't work properly anyways, so we could probably really nuke them.\n> Not the select rules of course !\n\n Now the target is clear. Make sure all instead rules work\n correct and get rid of the others.\n\n For the triggers: the triggers on SELECT should not be able\n to fire in additional tuples. I think it would be enough if\n they can modify the actual tuple before it is used or\n suppress it at all.\n\n>\n> I still think the trigger syntax should be extended to allow a block of sql, like in Informix.\n> Then you could: execute one or more procedures, or as in most cases\n> do a simple statement like cascade a delete. Also a syntax would be nice\n> that would allow to change the \"new\" tuple.\n\n It might look like:\n\n create trigger mytrig before insert or update on mytab\n for each row do (\n begin\n new.lastupdate := 'now';\n return new;\n end;\n ) language 'plpgsql';\n\n This would be easy. Just an enhancement to the parser and to\n the create trigger utility processing so it creates the\n required function on the fly. Modification of new, raising\n errors via elog() and suppressing the operation itself by\n returning NULL is already there in PL/pgSQL. We would need\n something smart for the functions name, because using the\n trigger name only would break the current possibility to\n define the same trigger name on different tables with\n different actions. Something like __trig_<oid> would be good.\n\n You would still be able to create a regular function with no\n arguments and return type opaque and then create triggers\n with ... for each row execute procedure myothertrig(). There\n can be any number of triggers for the same/overlapping events\n on a table (not on a view - they would never be fired). This\n is how I currently create triggers in PL/pgSQL.\n\n>\n> In Informix the block begins with a ( and ends with ), the statements are separated by commas:\n>\n> (insert into log values ('insert', new.name),\n> execute procedure current_datetime() into new.lastupdate)\n>\n> While I dont particularly like the syntax it does provide excellent functionality.\n>\n> Andreas\n>\n\n I like the ()'s around the statement block. It is already\n something psql cares for when typing in queries. Anything\n between can have ;'s and ''s as required. I would like to add\n the () to CREATE FUNCTION too.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Thu, 13 Aug 1998 17:54:16 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: AW: AW: [HACKERS] Rule system" }, { "msg_contents": "Jan Wieck wrote:\n> \n> It might look like:\n> \n> create trigger mytrig before insert or update on mytab\n> for each row do (\n ^^\nWhy not EXECUTE ?\n\n> begin\n> new.lastupdate := 'now';\n> return new;\n> end;\n> ) language 'plpgsql';\n> \n> This would be easy. Just an enhancement to the parser and to\n> the create trigger utility processing so it creates the\n> required function on the fly. Modification of new, raising\n> errors via elog() and suppressing the operation itself by\n> returning NULL is already there in PL/pgSQL. We would need\n> something smart for the functions name, because using the\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> trigger name only would break the current possibility to\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> define the same trigger name on different tables with\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> different actions. Something like __trig_<oid> would be good.\n ^^^^^^^^^^^^^^^^^\nI missed here. What did you mean?\n\nVadim\nP.S. Sorry, I'm very busy currently :((\n", "msg_date": "Fri, 14 Aug 1998 10:01:05 +0800", "msg_from": "Vadim Mikheev <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: [HACKERS] Rule system" }, { "msg_contents": ">\n> Jan Wieck wrote:\n> >\n> > It might look like:\n> >\n> > create trigger mytrig before insert or update on mytab\n> > for each row do (\n> ^^\n> Why not EXECUTE ?\n\n Just to indicate that this time a function body, for which a\n trigger function has to be created on the fly, follows\n instead of the name of an existing function to be called.\n\n But for bison it should be no problem to decide whether\n EXECUTE PROCEDURE proname(args) or EXECUTE PROCEDURE (body)\n is used. I don't really care about the final syntax.\n\n>\n> > begin\n> > new.lastupdate := 'now';\n> > return new;\n> > end;\n> > ) language 'plpgsql';\n> >\n> > This would be easy. Just an enhancement to the parser and to\n> > the create trigger utility processing so it creates the\n> > required function on the fly. Modification of new, raising\n> > errors via elog() and suppressing the operation itself by\n> > returning NULL is already there in PL/pgSQL. We would need\n> > something smart for the functions name, because using the\n> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> > trigger name only would break the current possibility to\n> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> > define the same trigger name on different tables with\n> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n> > different actions. Something like __trig_<oid> would be good.\n> ^^^^^^^^^^^^^^^^^\n> I missed here. What did you mean?\n\n What I have in mind for\n\n CREATE TRIGGER ... EXECUTE PROCEDURE (body)\n\n is, that this time a trigger function is automatically\n created before the usual trigger is defined. For the function\n there is a name required. Currently the following is\n possible:\n\n CREATE TRIGGER on_insert AFTER INSERT on emp\n FOR EACH ROW EXECUTE PROCEDURE on_ins_emp();\n\n CREATE TRIGGER on_insert AFTER INSERT on payroll\n FOR EACH ROW EXECUTE PROCEDURE on_ins_payroll();\n\n The name of the trigger is the same but the table they\n triggered for differs and they call different functions. I\n don't want to loose this so we cannot use the name of the\n trigger (on_insert) to create the trigger function since\n overloading depends on different call arguments. But both\n functions have no call arguments.\n\n Clear now?\n\n>\n> Vadim\n> P.S. Sorry, I'm very busy currently :((\n>\n>\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Fri, 14 Aug 1998 09:33:47 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: AW: AW: [HACKERS] Rule system" } ]
[ { "msg_contents": "> > there is a targetlist in the func node of a C function (for\n> > ExecMake... there is no difference between C, PL/TCL or\n> > PL/pgSQL), it knows that the return value is a tuple or\n> > tupletable or temp relation or whatever and it can manage for\n> > the requested projection and for the iteration (if function\n> > isset).\n> > \n> > But should we do that all (and the rule stuff) before 6.4?\n> \n> Sorry to say this, but I think we need the rewrite stuff done for 6.4.\n> \n> Too many bugs and limited features.\n> \n> The PL/pgSQL perhaps can be started now, but not ready until 6.5? I\n> don't think we should delay 6.4 for PL/pgSQL, do you?\n> \nI personally am willing to wait another month for PL/pgSQL w/returned\ntuples if it means I don't have to wait another 6 months for it. I\nwould also be willing to do work toward that end, if anyone needs the\nhelp (nobody's taken me up on the offer for help yet). \nAnd I agree about the rewrite stuff. If it's a choice between rewrite\nand PL/pgSQL I say rewrite. But, I'd like to have my cake and eat it\ntoo.\n\t\t-DEJ\n\nP.S. And while your at it, Jan, if you could drop in syntax for GROUP\ncreation/removal I'd be ecstatic. But I do understand the need to eat.\n", "msg_date": "Thu, 13 Aug 1998 11:15:05 -0500", "msg_from": "\"Jackson, DeJuan\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] tuple return from function" }, { "msg_contents": "> I personally am willing to wait another month for PL/pgSQL w/returned\n> tuples if it means I don't have to wait another 6 months for it. I\n> would also be willing to do work toward that end, if anyone needs the\n> help (nobody's taken me up on the offer for help yet).\n\n I just sent the initial version to Bruce to be added to the\n source tree. It is without tuple return (except for triggers)\n since this requires changes to PostgreSQL itself, which I\n think would be better for 6.5. Also the changes recently\n discussed about the extended syntax for CREATE TRIGGER and\n the ()'s on CREATE FUNCTION should be delayed for 6.5.\n\n As soon as it's in the CVS, I don't call it my baby any\n longer. It's my child then and children go out to the world\n to learn things I cannot teach them. But I'm still\n responsible for my child.\n\n There is currently a point where your offered help is\n appreciated. It lacks a CASE ... WHEN ... END CASE; which\n would be very useful. I have some ideas already how to\n implement it but it would be nice if others get familiar with\n the code too.\n\n> And I agree about the rewrite stuff. If it's a choice between rewrite\n> and PL/pgSQL I say rewrite. But, I'd like to have my cake and eat it\n> too.\n> -DEJ\n\n I think there is no choice any longer. I'll start now\n removing all the non-instead rule stuff to make the rule\n system as reliable as can.\n\n For 6.5 I want to have the suggested uid/euid model for\n views, functions and triggers and maybe ACL's on functions\n too. And the tuples for functions fixed. When this is done,\n PL/pgSQL is absolutely safe and can be a real trusted\n language. This is IMHO required to incorporate it into the\n backend itself and install it in the template1 database while\n bootstrapping.\n\n>\n> P.S. And while your at it, Jan, if you could drop in syntax for GROUP\n> creation/removal I'd be ecstatic. But I do understand the need to eat.\n>\n\n No priority for me for 6.4. But will get priority for 6.5\n when doing the ACL and uid/euid stuff.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Thu, 13 Aug 1998 21:20:49 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] tuple return from function" }, { "msg_contents": "> > I personally am willing to wait another month for PL/pgSQL w/returned\n> > tuples if it means I don't have to wait another 6 months for it. I\n> > would also be willing to do work toward that end, if anyone needs the\n> > help (nobody's taken me up on the offer for help yet).\n> \n> I just sent the initial version to Bruce to be added to the\n> source tree. It is without tuple return (except for triggers)\n> since this requires changes to PostgreSQL itself, which I\n> think would be better for 6.5. Also the changes recently\n> discussed about the extended syntax for CREATE TRIGGER and\n> the ()'s on CREATE FUNCTION should be delayed for 6.5.\n> \n> As soon as it's in the CVS, I don't call it my baby any\n> longer. It's my child then and children go out to the world\n> to learn things I cannot teach them. But I'm still\n> responsible for my child.\n> \n> There is currently a point where your offered help is\n> appreciated. It lacks a CASE ... WHEN ... END CASE; which\n> would be very useful. I have some ideas already how to\n> implement it but it would be nice if others get familiar with\n> the code too.\n> \n\nAdded to /contrib.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 22 Aug 1998 08:40:21 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] tuple return from function" } ]
[ { "msg_contents": "Dirk Elmendorf <[email protected]> writes:\n> I have a program which opens two connections to two different databases.\n> After issuing a few commands to the second database I this get in the\n> trace log:\n\n> To backend> QSELECT oid FROM order_table WHERE customer_number=936 ;\n>> From backend> N\n>> From backend> \"NOTICE: SIMarkEntryData: cache state reset\n\nThis is the *second* backend sending that notice, right?\n\n> Then I get a SIGPIPE on the first database which courrpts my connection.\n> The funny thing is that PQstatus still says I have a good connection.\n\nSIGPIPE implies that the first backend closed the connection. I take it\nyou are trapping and ignoring the SIGPIPE in your application, because\nlibpq doesn't. (6.3.2 libpq is not very good about dealing with\nunexpected closure of the connection by the backend, which is why\nPQstatus doesn't know anything's wrong. The current sources should be\nmuch better. But that's not what your problem is anyway.)\n\nI assume you don't actually see the SIGPIPE until you next try to send\na command to the first backend, right?\n\nDoes anything appear in your postmaster's log file when this happens?\n\n> The second database continues plugging along. I cannot seem to figure\n> out how to stop this - if I re-issuse all the SQL in psql each command\n> works like a charm - but when I do it through libpq I can not seem to\n> escape the problem - Has anyone else run into this problem? Can anyone\n> explain what this Notice means? I searched through the Mailing lists\n> and found a number of emails asking the same quesiton- but no answer\n> could be found. Any insight would be greatly appreciated. I'm\n> running 6.3.2 on RH 4.2\n\n> I tried opening the first db grabbing some info and then closing the\n> connection- then I open the second databse- I'm still able to\n> generate this error.\n\nThe NOTICE is coming out of some code dealing with invalidating shared\ncaches (src/backend/storage/ipc/sinvaladt.c). I'm cc'ing this to the\nhackers list because I think you are looking at a backend bug. Most\nprobably, the first backend is coredumping when the second one tries to\nreset the shared cache.\n\nI run multiple backends all the time and I've never seen this happen,\nso I suspect it's got some dependency on your system environment.\nAnyone else using RH 4.2?\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 13 Aug 1998 12:41:22 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [INTERFACES] Libpq problems (not)" } ]
[ { "msg_contents": "I just found this one on my TODO list:\n\nThe error message for \"no data\" in an exec sql insert select from statement\nhas to be 100.\n\nIt seems I cannot get that kind of information from libpq other than\nchecking for the result being 0 tuples. But is this correct? Or are there\npossibilities to get 0 tuples? That is I get PQcmdTuples(results) = 0 with\nthe return code being PGRES_COMMAND_OK.\n\nAlso I wonder if PGRES_COMMAND_OK could come from other statements for which\nsetting the not found marker makes no sense. I think it does make sense for\ninsert, delete and update.\n\nOn the other hand returning NOT_FOUND on other commands doesn't do hany harm\nthough since the whenever not found isn't checked for other commands.\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Fri, 14 Aug 1998 10:49:01 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "ecpg problem" }, { "msg_contents": "On Fri, 14 Aug 1998, Dr. Michael Meskes wrote:\n\n> I just found this one on my TODO list:\n> \n> The error message for \"no data\" in an exec sql insert select from statement\n> has to be 100.\n> \n> It seems I cannot get that kind of information from libpq other than\n> checking for the result being 0 tuples. But is this correct? Or are there\n> possibilities to get 0 tuples? That is I get PQcmdTuples(results) = 0 with\n> the return code being PGRES_COMMAND_OK.\n\nShouldn't you check for PGRES_TUPLES_OK ? I always check for this if I \nwant to know if a data select statement has succeeded. And this also \nstill allows PQntuples() == 0\n\nMaarten\n\n_____________________________________________________________________________\n| TU Delft, The Netherlands, Faculty of Information Technology and Systems |\n| Department of Electrical Engineering |\n| Computer Architecture and Digital Technique section |\n| [email protected] |\n-----------------------------------------------------------------------------\n\n", "msg_date": "Sat, 15 Aug 1998 12:27:55 +0200 (MET DST)", "msg_from": "Maarten Boekhold <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] ecpg problem" }, { "msg_contents": "On Sat, Aug 15, 1998 at 12:27:55PM +0200, Maarten Boekhold wrote:\n> > It seems I cannot get that kind of information from libpq other than\n> > checking for the result being 0 tuples. But is this correct? Or are there\n> > possibilities to get 0 tuples? That is I get PQcmdTuples(results) = 0 with\n> > the return code being PGRES_COMMAND_OK.\n> \n> Shouldn't you check for PGRES_TUPLES_OK ? I always check for this if I \n\nNo, the insert command doesn't return any tuples anyway. But then I don't\ncheck for it either. libecpg has to work with every return value and so\nchecks them all. It just happens that the insert commend returns\nPGRES_COMMAND_OK. :-)\n\nMichael\n\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Sun, 16 Aug 1998 13:59:37 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] ecpg problem" } ]
[ { "msg_contents": "> possible:\n>\n> CREATE TRIGGER on_insert AFTER INSERT on emp\n> FOR EACH ROW EXECUTE PROCEDURE on_ins_emp();\n>\n> CREATE TRIGGER on_insert AFTER INSERT on payroll\n> FOR EACH ROW EXECUTE PROCEDURE on_ins_payroll();\n>\n> The name of the trigger is the same but the table they\n> triggered for differs and they call different functions.\n\nI think trigger names shoud be unique. Like in Informix, Oracle, DB/2.\n\nRemember to drop a trigger, the syntax usually is:\n\tdrop trigger on_insert;\n\nso you could safely name the function _trig_<triggername> e.g.\n\nAndreas\n\n", "msg_date": "Fri, 14 Aug 1998 11:06:07 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Rule system (trigger names)" }, { "msg_contents": "> \n> > possible:\n> >\n> > CREATE TRIGGER on_insert AFTER INSERT on emp\n> > FOR EACH ROW EXECUTE PROCEDURE on_ins_emp();\n> >\n> > CREATE TRIGGER on_insert AFTER INSERT on payroll\n> > FOR EACH ROW EXECUTE PROCEDURE on_ins_payroll();\n> >\n> > The name of the trigger is the same but the table they\n> > triggered for differs and they call different functions.\n> \n> I think trigger names shoud be unique. Like in Informix, Oracle, DB/2.\n> \n> Remember to drop a trigger, the syntax usually is:\n> \tdrop trigger on_insert;\n\n Not in PostgreSQL. Here it is\n\n DROP TRIGGER trigname ON relation;\n\n> \n> so you could safely name the function _trig_<triggername> e.g.\n> \n> Andreas\n> \n> \n> \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#======================================== [email protected] (Jan Wieck) #\n\n", "msg_date": "Fri, 14 Aug 1998 11:33:40 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Rule system (trigger names)" } ]
[ { "msg_contents": "Jan wrote:\n I think there is no choice any longer. I'll start now\n removing all the non-instead rule stuff to make the rule\n system as reliable as can.\n\nIs this really necessary to get the instead stuff working ? If not, I think\nit would be good to keep it even if it is currently somewhat broken. Maybe someone\nwants to look it over later. The rule system is one hell of a concept with lots of\ndiploma work at Berkeley behind it.\n\nAndreas\n\n", "msg_date": "Fri, 14 Aug 1998 11:29:44 +0200", "msg_from": "Andreas Zeugswetter <[email protected]>", "msg_from_op": true, "msg_subject": "non instead rule system " }, { "msg_contents": ">\n> Jan wrote:\n> I think there is no choice any longer. I'll start now\n> removing all the non-instead rule stuff to make the rule\n> system as reliable as can.\n>\n> Is this really necessary to get the instead stuff working ? If not, I think\n> it would be good to keep it even if it is currently somewhat broken. Maybe someone\n> wants to look it over later. The rule system is one hell of a concept with lots of\n> diploma work at Berkeley behind it.\n>\n> Andreas\n\n After I started now, I don't think any longer that it is\n really necessary to remove all the non-instead stuff.\n\n The RIR rules work, that's why the views work. What's missing\n for the other rules (as far as I see it in the query\n debugging now) is that RIR rules also have to be applied on\n these queries first.\n\n Having a view, you might want to define an update instead\n rule that updates the real tables behind the view. The\n parsers output for an update on the view references the view\n itself in the rangetable and it's var nodes in targetList and\n qual. Before processing the update rule, these must first be\n substituted to what they really are (RTE's for the real\n tables and the targetList and qual expressions from the RIR\n rule of the view). As it is now, the query after rewriting\n still uses the view itself in the qual expressions. This\n results later in very complicated mergejoin and nestloop\n plans, that in fact do nothing because they scan the view\n somewhere and while thats an empty relation will never find a\n single row.\n\n I know now, that the RIR rules have to be taken to modify the\n queries for insert, update and delete commands. Let's see\n what happens if I got that and decide then how to move on.\n\n\nUntil later, Jan\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Fri, 14 Aug 1998 12:01:53 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: non instead rule system" }, { "msg_contents": "> >\n> > Jan wrote:\n> > I think there is no choice any longer. I'll start now\n> > removing all the non-instead rule stuff to make the rule\n> > system as reliable as can.\n> >\n> > Is this really necessary to get the instead stuff working ? If not, I think\n> > it would be good to keep it even if it is currently somewhat broken. Maybe someone\n> > wants to look it over later. The rule system is one hell of a concept with lots of\n> > diploma work at Berkeley behind it.\n> >\n> > Andreas\n> \n> After I started now, I don't think any longer that it is\n> really necessary to remove all the non-instead stuff.\n> \n> The RIR rules work, that's why the views work. What's missing\n> for the other rules (as far as I see it in the query\n> debugging now) is that RIR rules also have to be applied on\n> these queries first.\n> \n> Having a view, you might want to define an update instead\n> rule that updates the real tables behind the view. The\n> parsers output for an update on the view references the view\n> itself in the rangetable and it's var nodes in targetList and\n> qual. Before processing the update rule, these must first be\n> substituted to what they really are (RTE's for the real\n> tables and the targetList and qual expressions from the RIR\n> rule of the view). As it is now, the query after rewriting\n> still uses the view itself in the qual expressions. This\n> results later in very complicated mergejoin and nestloop\n> plans, that in fact do nothing because they scan the view\n> somewhere and while thats an empty relation will never find a\n> single row.\n> \n> I know now, that the RIR rules have to be taken to modify the\n> queries for insert, update and delete commands. Let's see\n> what happens if I got that and decide then how to move on.\n\nThe only thing I can add to this discussion is that I remember a lot of\ndancing going on about why the rule system did not work, and the idea\nthat it was supposed to do X, Y, and Z, and that it could do X and Y,\nbut not Z. The issue I though was that the was an actual logic problem\nabout doing trying to do all three of them. Not a coding problem, but a\nproblem that it was not logically possible to do all three.\n\nMaybe this makes no sense.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 14 Aug 1998 10:24:56 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: non instead rule system" } ]
[ { "msg_contents": "I found some time today and added the exec sql define command to ecpg.\nHowever, since I do not have the specs with me I am not completely sure the\nsyntax and semantics is correct.\n\nI believe the syntax wax: exec sql define AMOUNT is 5;\n\nAs for the semantics I think this should mean to replace AMOUNT by the value\n5 (of course) in the complete file. That is also replace inside the C part.\nI'm not sure about that, but otherwise it would be impossible to parse the\nvariable declarations.\n\nAlso it cannot do variable expansions, just simple string for string\nreplacements. Since ORACLE doesn't seem to support it at all, could anyone\nwit a system that does support this feature check whether this works:\n\nexec sql define S(X) is X=X+1;\n\nI believe Informix does support defines.\n\nMichael\n-- \nDr. Michael Meskes\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n", "msg_date": "Fri, 14 Aug 1998 13:17:38 +0200", "msg_from": "\"Dr. Michael Meskes\" <[email protected]>", "msg_from_op": true, "msg_subject": "Define command" } ]
[ { "msg_contents": "Dear Postgres developers,\n\nI have some problems but I can't find any answer.\n\nI don't know, what you mean about a transaction block. As far as I know,\nCREATE TABLE, DROP TABLE and INSERT instructions need not to be inside a\ntransaction block, but UPDATE instruction must be inside a transaction\nblock. If UPDATE isn't inside a transaction block, changes won't be\nexecuted in the database but changes made by a CREATE/DROP TABLE or\nINSERT instruction will be executed even if these instructions aren't\ninside a transaction block. It is very strange, and I don't know why.\nCould you explain it to me? (I use libpq)\n\nMy second problem:\nI create and drop lots of tables in a cycle many times (of course I\ninsert many rows into tables). I execute a VACUUM ANALYZE instruction\nin every cycle, but inspite of that fact, the time of creation of\ntables become longer and longer. Why? Could you help me? I don't know\nthe solution.\n\nThank you very much in advance!\n\n\n\n\n", "msg_date": "Fri, 14 Aug 1998 16:01:12 +0200", "msg_from": "Lendvary Gyorgy <[email protected]>", "msg_from_op": true, "msg_subject": "Transactions" } ]
[ { "msg_contents": "Hi. A month or two ago I put an int8 data type into Postgres. Aside from\nbeing useful on its own, it could also form the basis for other types\nneeding extended range, such as money, decimal, and numeric types (the\nlast two are SQL92 types).\n\nAnyway, I implemented it on a gcc/x86/Linux machine, and we will need to\nensure that it works on other platforms. If you are doing any work at\nall with a post-v6.3.2 source tree on another platform/OS combination,\ncan you please look at the results of the int8 regression test, or run\nthat test on your own, and let me know if it worked? If it didn't work,\nthen we should either put it on the list of things to do or make it work\nin time for v6.4. But at the moment I don't know either way.\n\nbtw, there is a chance that the Alpha port will work since I coded for\nit and I used to work on Alpha machines...\n\nTIA\n\n - Tom\n", "msg_date": "Fri, 14 Aug 1998 15:46:53 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": true, "msg_subject": "int8 type -- call for porting results!" }, { "msg_contents": "\"Thomas G. Lockhart\" <[email protected]> writes:\n> Anyway, I implemented it on a gcc/x86/Linux machine, and we will need to\n> ensure that it works on other platforms. If you are doing any work at\n> all with a post-v6.3.2 source tree on another platform/OS combination,\n> can you please look at the results of the int8 regression test, or run\n> that test on your own, and let me know if it worked?\n\nIt looks pretty broken on HPUX 9.03 (PA-RISC 1.1, gcc 2.7.2.2):\n\n*** expected/int8.out\tWed Jul 8 10:29:08 1998\n--- results/int8.out\tSat Aug 15 13:41:00 1998\n***************\n*** 6,115 ****\n QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789');\n QUERY: SELECT * FROM INT8_TBL;\n q1| q2\n! ----------------+-----------------\n 123| 456\n! 123| 4567890123456789\n! 4567890123456789| 123\n! 4567890123456789| 4567890123456789\n! 4567890123456789|-4567890123456789\n (5 rows)\n\n[ much more in the same vein omitted ]\n \n--- 6,117 ----\n QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789');\n QUERY: SELECT * FROM INT8_TBL;\n q1| q2\n! ----------+----------\n 123| 456\n! 123|-869367531\n! -869367531| 123\n! -869367531|-869367531\n! -869367531| 869367531\n (5 rows)\n\n[ much more in the same vein omitted ]\n\nAt a guess, something is getting cast to int32 somewhere along the line,\nor maybe the I/O conversion routines just don't work.\n\nAny thoughts where to look for the problem?\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 15 Aug 1998 13:59:46 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] int8 type -- call for porting results! " }, { "msg_contents": "> > I implemented it on a gcc/x86/Linux machine, and we will need to\n> > ensure that it works on other platforms.\n> It looks pretty broken on HPUX 9.03 (PA-RISC 1.1, gcc 2.7.2.2):\n> QUERY: INSERT INTO INT8_TBL \n> VALUES('4567890123456789','-4567890123456789');\n> QUERY: SELECT * FROM INT8_TBL;\n> q1| q2\n> ! ----------+----------\n> 123| 456\n> ! 123|-869367531\n> ! -869367531| 123\n> ! -869367531|-869367531\n> ! -869367531| 869367531\n> (5 rows)\n> At a guess, something is getting cast to int32 somewhere along the \n> line, or maybe the I/O conversion routines just don't work.\n> Any thoughts where to look for the problem?\n\nSure. It will be easy to track down...\n\nHere is the code in include/utils/int8.h:\n\n#if defined(__alpha) || defined(PPC)\ntypedef long int int64;\n#define INT64_FORMAT \"%ld\"\n\n#elif defined(__GNUC__) && defined(i386)\ntypedef long long int int64;\n#define INT64_FORMAT \"%Ld\"\n\n#else\ntypedef long int int64;\n#define INT64_FORMAT \"%ld\"\n#endif\n\nI didn't want to break everything all at once (I always prefer the slow\nslide into full breakage :), so only enabled Alphas, PowerPCs (a dumb\nmistake; I had thought that they were 64-bit machines), and gcc on x86\nmachines. Otherwise, the type gets defined as a \"long int\", which\nprobably will give you a 32-bit quantity.\n\nOK, so GCC on 32-bit machines has a convention that \"long long int\" is a\n64-bit quantity. On my machine there is library support for simple\n64-bit integer math; we'll need to have addition, subtraction,\nmultiplication and division. I'll warn you that on a previous release of\ngcc on my Linux box I had to poke around in obscure directories to find\nthe subtraction or division routine, but my more recent installations\nseem to have all of the routines up in the normal places.\n\nSo, it may be sufficient for testing purposes to remove the\n\"&& defined(i386)\" and see what you get. We can tailor the defines to\nyour machine later.\n\n - Tom\n", "msg_date": "Sun, 16 Aug 1998 03:37:00 +0000", "msg_from": "\"Thomas G. Lockhart\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] int8 type -- call for porting results!" }, { "msg_contents": "I just started compiling the 6.4 snapshot from this weekend on our AIX 4.1.4\nsystem. I am running into problems surrounding snprintf().\n\n1. Do I need to set something in Makefile.global to activate the\ncompilation of snprintf()\n\n2. snprintf() does not compile clean. It has several explicate referenced\nto FILE data elements which are not on our FILE structure. The error\nmessages follow:\n\n 81 | f._flags = __SWR | __SSTR;\n ........a..........b.......c......\na - 1506-022 (S) \"_flags\" is not a member of \"struct {...}\".\nb - 1506-045 (S) Undeclared identifier __SWR.\nc - 1506-045 (S) Undeclared identifier __SSTR.\n 82 | f._bf._base = f._p = (unsigned char *)str;\n ........a.............b...........................\na - 1506-022 (S) \"_bf\" is not a member of \"struct {...}\".\nb - 1506-022 (S) \"_p\" is not a member of \"struct {...}\".\n 83 | f._bf._size = f._w = n;\n ........a.............b........\na - 1506-022 (S) \"_bf\" is not a member of \"struct {...}\".\nb - 1506-022 (S) \"_w\" is not a member of \"struct {...}\".\n 86 | *f._p = '\\0';\n .................a...........\na - 1506-022 (S) \"_p\" is not a member of \"struct {...}\".\ngmake: *** [snprintf.o] Error 1\n\nThis section does not look to portable. I'm thinking that you could use a\nsimple sprintf() in int8out() and made the buffer sufficiently big enough\nthat it could not overflow. I will gladly submit a patch.\n\nPlease advise.\n\nThomas G. Lockhart wrote:\n\n> Hi. A month or two ago I put an int8 data type into Postgres. Aside from\n> being useful on its own, it could also form the basis for other types\n> needing extended range, such as money, decimal, and numeric types (the\n> last two are SQL92 types).\n>\n> Anyway, I implemented it on a gcc/x86/Linux machine, and we will need to\n> ensure that it works on other platforms. If you are doing any work at\n> all with a post-v6.3.2 source tree on another platform/OS combination,\n> can you please look at the results of the int8 regression test, or run\n> that test on your own, and let me know if it worked? If it didn't work,\n> then we should either put it on the list of things to do or make it work\n> in time for v6.4. But at the moment I don't know either way.\n>\n> btw, there is a chance that the Alpha port will work since I coded for\n> it and I used to work on Alpha machines...\n>\n> TIA\n>\n> - Tom\n\n\n\n", "msg_date": "Tue, 18 Aug 1998 12:59:08 -0400", "msg_from": "David Hartwig <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] int8 type -- call for porting results!" }, { "msg_contents": "On Tue, 18 Aug 1998, David Hartwig wrote:\n\n> I just started compiling the 6.4 snapshot from this weekend on our AIX 4.1.4\n> system. I am running into problems surrounding snprintf().\n> \n> 1. Do I need to set something in Makefile.global to activate the\n> compilation of snprintf()\n\n\tLet me check the code tonight from home, but there should be code\nalready for that. It isn't in Makefile.global though, it should be\nin...backend/ports/Makefile...\n\n\n", "msg_date": "Tue, 18 Aug 1998 13:17:49 -0400 (EDT)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] int8 type -- call for porting results!" }, { "msg_contents": "The Hermit Hacker <[email protected]> writes:\n> On Tue, 18 Aug 1998, David Hartwig wrote:\n>> I just started compiling the 6.4 snapshot from this weekend on our AIX 4.1.4\n>> system. I am running into problems surrounding snprintf().\n>> \n>> 1. Do I need to set something in Makefile.global to activate the\n>> compilation of snprintf()\n\nAh ... it's a typo in configure.in.\n\nAC_CHECK_FUNC(snprintf,\n\t AC_DEFINE(HAVE_SNPRINTF),\n\t ISINF='snprintf.o')\nAC_SUBST(SNPRINTF)\n\nshould read\n\nAC_CHECK_FUNC(snprintf,\n\t AC_DEFINE(HAVE_SNPRINTF),\n\t SNPRINTF='snprintf.o')\nAC_SUBST(SNPRINTF)\n\n\nLooks like this has never worked, which makes me wonder how well\ndebugged our snprintf emulation is ... I guess David will test it\nout for us ...\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 18 Aug 1998 15:09:06 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] int8 type -- call for porting results! " }, { "msg_contents": "> The Hermit Hacker <[email protected]> writes:\n> > On Tue, 18 Aug 1998, David Hartwig wrote:\n> >> I just started compiling the 6.4 snapshot from this weekend on our AIX 4.1.4\n> >> system. I am running into problems surrounding snprintf().\n> >> \n> >> 1. Do I need to set something in Makefile.global to activate the\n> >> compilation of snprintf()\n> \n> Ah ... it's a typo in configure.in.\n> \n> AC_CHECK_FUNC(snprintf,\n> \t AC_DEFINE(HAVE_SNPRINTF),\n> \t ISINF='snprintf.o')\n> AC_SUBST(SNPRINTF)\n> \n> should read\n> \n> AC_CHECK_FUNC(snprintf,\n> \t AC_DEFINE(HAVE_SNPRINTF),\n> \t SNPRINTF='snprintf.o')\n> AC_SUBST(SNPRINTF)\n> \n> \n> Looks like this has never worked, which makes me wonder how well\n> debugged our snprintf emulation is ... I guess David will test it\n> out for us ...\n\nno code used snprintf until now.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Tue, 18 Aug 1998 17:26:53 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] int8 type -- call for porting results!" }, { "msg_contents": "On Tue, 18 Aug 1998, Tom Lane wrote:\n\n> Looks like this has never worked, which makes me wonder how well\n> debugged our snprintf emulation is ... I guess David will test it\n> out for us ...\n\n\tFixed...\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Tue, 18 Aug 1998 21:16:20 -0300 (ADT)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] int8 type -- call for porting results! " }, { "msg_contents": "Has this been fixed?\n\n\n> I just started compiling the 6.4 snapshot from this weekend on our AIX 4.1.4\n> system. I am running into problems surrounding snprintf().\n> \n> 1. Do I need to set something in Makefile.global to activate the\n> compilation of snprintf()\n> \n> 2. snprintf() does not compile clean. It has several explicate referenced\n> to FILE data elements which are not on our FILE structure. The error\n> messages follow:\n> \n> 81 | f._flags = __SWR | __SSTR;\n> ........a..........b.......c......\n> a - 1506-022 (S) \"_flags\" is not a member of \"struct {...}\".\n> b - 1506-045 (S) Undeclared identifier __SWR.\n> c - 1506-045 (S) Undeclared identifier __SSTR.\n> 82 | f._bf._base = f._p = (unsigned char *)str;\n> ........a.............b...........................\n> a - 1506-022 (S) \"_bf\" is not a member of \"struct {...}\".\n> b - 1506-022 (S) \"_p\" is not a member of \"struct {...}\".\n> 83 | f._bf._size = f._w = n;\n> ........a.............b........\n> a - 1506-022 (S) \"_bf\" is not a member of \"struct {...}\".\n> b - 1506-022 (S) \"_w\" is not a member of \"struct {...}\".\n> 86 | *f._p = '\\0';\n> .................a...........\n> a - 1506-022 (S) \"_p\" is not a member of \"struct {...}\".\n> gmake: *** [snprintf.o] Error 1\n> \n> This section does not look to portable. I'm thinking that you could use a\n> simple sprintf() in int8out() and made the buffer sufficiently big enough\n> that it could not overflow. I will gladly submit a patch.\n> \n> Please advise.\n> \n> Thomas G. Lockhart wrote:\n> \n> > Hi. A month or two ago I put an int8 data type into Postgres. Aside from\n> > being useful on its own, it could also form the basis for other types\n> > needing extended range, such as money, decimal, and numeric types (the\n> > last two are SQL92 types).\n> >\n> > Anyway, I implemented it on a gcc/x86/Linux machine, and we will need to\n> > ensure that it works on other platforms. If you are doing any work at\n> > all with a post-v6.3.2 source tree on another platform/OS combination,\n> > can you please look at the results of the int8 regression test, or run\n> > that test on your own, and let me know if it worked? If it didn't work,\n> > then we should either put it on the list of things to do or make it work\n> > in time for v6.4. But at the moment I don't know either way.\n> >\n> > btw, there is a chance that the Alpha port will work since I coded for\n> > it and I used to work on Alpha machines...\n> >\n> > TIA\n> >\n> > - Tom\n> \n> \n> \n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 23 Aug 1998 21:05:29 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] int8 type -- call for porting results!" } ]
[ { "msg_contents": "> Date: Wed, 12 Aug 1998 13:11:53 -0500\n> From: \"Jackson, DeJuan\" <[email protected]>\n> Subject: RE: [HACKERS] Re: partial index\n> \n> > I had suspected that's what they were, but never really was sure. Now\n> > the next question, \"Should we rip them out?\" No one uses them, and\n> > they seem to be of very limited usefulness.\n> >\n> > I am inclinded to keep them, but I am not sure.\n> >\n> Do we have syntax for their creation and is it in the docs?\n> If not I say just take them out, unless someone can think of a use that\n> wouldn't be served by normal indexes.\n\nThey should be much faster than normal indexes, as well as take much \nless room. And in principle they coud avoid the need to archive older \nrecords in another table for performance reasons.\n\nAs to the difficulty of making optimiser use them we can go the way \nOracle went in v8.0 - support subtable (or whatever they called them ;)\n\nIn principle it is a subset of one table, selected by some condition.\n\nThe syntax could be something like this:\n\ncreate subtable parents on table people where no_of_children > 0;\n\ncreate index on parents using btree(no_of_children);\n\nthis way you do actually create a partial index on people, but you \ngive the optimiser a strong hint to use this index if you do select on \ntable parents.\n\nI suspect that the subtable itself is created by making a \npartial index or like structure on the where clause.\n\n-----------------\nHannu Krosing\n", "msg_date": "Fri, 14 Aug 1998 19:09:44 +0300", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": true, "msg_subject": "Re: Dropping partial index support - Dont!" } ]
[ { "msg_contents": "Hi,\n\n who's the parser guru? I need help!\n\n I have a table t1(a int4, b int4)\n\n When I\n\n update t1 set b = 2 where a = 1;\n\n I get a targetlist with 1 entry and resno=2.\n\n But when I\n\n update t1 set b = t2.b where a = t2.a;\n\n I get the same 1 entry targetlist with resno=1 for attribute\n \"b\". That causes deep deep trouble in the rewrite system,\n when fixing the expressions for *new* variable references.\n *new*.attr defaults to *old*.attr except given in the query\n to be updated. When fixing *new* references, the rewrite\n system looks up the original parsetree to find a TLE with the\n same resno as the attribute number in the *new*.attr. So it\n depends on having the resno same to the attno of the result\n relation.\n\n I'm absolutely unfamiliar with the parser in this area and I\n don't want to hack around and break things so close before\n 6.4. Who knows how to fix this?\n\n BTW: up to now the rewrite system looks much better. It works\n for insert, update and delete when using constant values.\n insert ... select ... works too.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Fri, 14 Aug 1998 19:05:36 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Problem with parser" }, { "msg_contents": "> Hi,\n> \n> who's the parser guru? I need help!\n> \n> I have a table t1(a int4, b int4)\n> \n> When I\n> \n> update t1 set b = 2 where a = 1;\n> \n> I get a targetlist with 1 entry and resno=2.\n> \n> But when I\n> \n> update t1 set b = t2.b where a = t2.a;\n> \n> I get the same 1 entry targetlist with resno=1 for attribute\n> \"b\". That causes deep deep trouble in the rewrite system,\n> when fixing the expressions for *new* variable references.\n> *new*.attr defaults to *old*.attr except given in the query\n> to be updated. When fixing *new* references, the rewrite\n> system looks up the original parsetree to find a TLE with the\n> same resno as the attribute number in the *new*.attr. So it\n> depends on having the resno same to the attno of the result\n> relation.\n> \n> I'm absolutely unfamiliar with the parser in this area and I\n> don't want to hack around and break things so close before\n> 6.4. Who knows how to fix this?\n> \n> BTW: up to now the rewrite system looks much better. It works\n> for insert, update and delete when using constant values.\n> insert ... select ... works too.\n\nLet me take a look at this. I am in the middle of a major patch, so it\nmay take a day or two.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 14 Aug 1998 15:06:50 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Problem with parser" }, { "msg_contents": "> Hi,\n> \n> who's the parser guru? I need help!\n> \n> I have a table t1(a int4, b int4)\n> \n> When I\n> \n> update t1 set b = 2 where a = 1;\n> \n> I get a targetlist with 1 entry and resno=2.\n> \n> But when I\n> \n> update t1 set b = t2.b where a = t2.a;\n\nIs the parser code correct here? You are actually doing:\n\n update t1 set b = t2.b from t2 where a = t2.a;\n ^^^^^^^\n\nI don't have a running system right now because of my other patch. Can\nyou send me a tree pointing to the problem? In the above example, what\nis the first resno? EXPLAIN VERBOSE should give you the plans, and dump\ndetailed plans into the postmaster log file.\n\nI think I see the problem. In MakeTargetlistExpr(), we have this code:\n\n /* Processes target columns that will be receiving results */\n if (pstate->p_is_insert || pstate->p_is_update)\n {\n /*\n * insert or update query -- insert, update work only on one\n * relation, so multiple occurence of same resdomno is bogus\n */\n rd = pstate->p_target_relation;\n Assert(rd != NULL);\n---> resdomno = attnameAttNum(rd, colname);\n attrisset = attnameIsSet(rd, colname);\n attrtype = attnumTypeId(rd, resdomno);\n if ((arrayRef != NIL) && (lfirst(arrayRef) == NIL))\n attrtype = GetArrayElementType(attrtype);\n attrtypmod = rd->rd_att->attrs[resdomno - 1]->atttypmod;\n \n\nThis looks bad to me, especially because you have a join going on in the\nupdate. In fact, the comment clearly shows a false assertion, that ther\nis only one relation in UPDATE.\n\nIs the update rewrite code assuming that the resdomno of an updated\ncolumn must match the attribute number? And the join is messing this\nup?\n\n\n\n> \n> I get the same 1 entry targetlist with resno=1 for attribute\n> \"b\". That causes deep deep trouble in the rewrite system,\n> when fixing the expressions for *new* variable references.\n> *new*.attr defaults to *old*.attr except given in the query\n> to be updated. When fixing *new* references, the rewrite\n> system looks up the original parsetree to find a TLE with the\n> same resno as the attribute number in the *new*.attr. So it\n> depends on having the resno same to the attno of the result\n> relation.\n> \n> I'm absolutely unfamiliar with the parser in this area and I\n> don't want to hack around and break things so close before\n> 6.4. Who knows how to fix this?\n> \n> BTW: up to now the rewrite system looks much better. It works\n> for insert, update and delete when using constant values.\n> insert ... select ... works too.\n> \n> \n> Jan\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> #======================================== [email protected] (Jan Wieck) #\n> \n> \n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 14 Aug 1998 15:26:06 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Problem with parser" }, { "msg_contents": "> This looks bad to me, especially because you have a join going on in the\n> update. In fact, the comment clearly shows a false assertion, that ther\n> is only one relation in UPDATE.\n>\n> Is the update rewrite code assuming that the resdomno of an updated\n> column must match the attribute number? And the join is messing this\n> up?\n>\n> --\n> Bruce Momjian | 830 Blythe Avenue\n\n Right! The rewrite code assumes that the resdomno of the\n updated columns match the attribute number in the target\n relation. I don't know if the join is messing it up - but\n looks like. Thanks for the help - I think I have to look for\n usage of p_last_resno to find all the places where this can\n happen.\n\n Little joke:\n\n At the place in analyze.c, where a TLE is created, there is a\n comment that not creating a proper target list with correct\n resdomno's might break rules :-)\n\n I love those comments. And especially all that have XXXXX\n somewhere.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Sat, 15 Aug 1998 00:49:03 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Problem with parser" }, { "msg_contents": "> > This looks bad to me, especially because you have a join going on in the\n> > update. In fact, the comment clearly shows a false assertion, that ther\n> > is only one relation in UPDATE.\n> >\n> > Is the update rewrite code assuming that the resdomno of an updated\n> > column must match the attribute number? And the join is messing this\n> > up?\n> >\n> > --\n> > Bruce Momjian | 830 Blythe Avenue\n> \n> Right! The rewrite code assumes that the resdomno of the\n> updated columns match the attribute number in the target\n> relation. I don't know if the join is messing it up - but\n> looks like. Thanks for the help - I think I have to look for\n> usage of p_last_resno to find all the places where this can\n> happen.\n\nOK, do you need me to supply a patch? I would be glad to review\nanything you have.\n\n> \n> Little joke:\n> \n> At the place in analyze.c, where a TLE is created, there is a\n> comment that not creating a proper target list with correct\n> resdomno's might break rules :-)\n> \n> I love those comments. And especially all that have XXXXX\n> somewhere.\n\nYes, I have a few favorites.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 14 Aug 1998 21:17:41 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Problem with parser" }, { "msg_contents": ">\n> OK, do you need me to supply a patch? I would be glad to review\n> anything you have.\n\n I decided to reassign the redomno's when entering\n RewriteQuery() and there's a resultRelation. It's the only\n way I think not to miss a single place where a bad resdomno\n is created.\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#======================================== [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Sat, 15 Aug 1998 15:56:30 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Problem with parser" }, { "msg_contents": "> >\n> > OK, do you need me to supply a patch? I would be glad to review\n> > anything you have.\n> \n> I decided to reassign the redomno's when entering\n> RewriteQuery() and there's a resultRelation. It's the only\n> way I think not to miss a single place where a bad resdomno\n> is created.\n\nI am going to fix the parser, so you don't have to do this in the\nrewrite system. I will let you know when it is ready.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sun, 23 Aug 1998 18:13:04 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Problem with parser" }, { "msg_contents": "> > This looks bad to me, especially because you have a join going on in the\n> > update. In fact, the comment clearly shows a false assertion, that ther\n> > is only one relation in UPDATE.\n> >\n> > Is the update rewrite code assuming that the resdomno of an updated\n> > column must match the attribute number? And the join is messing this\n> > up?\n> >\n> > --\n> > Bruce Momjian | 830 Blythe Avenue\n> \n> Right! The rewrite code assumes that the resdomno of the\n> updated columns match the attribute number in the target\n> relation. I don't know if the join is messing it up - but\n> looks like. Thanks for the help - I think I have to look for\n> usage of p_last_resno to find all the places where this can\n> happen.\n\nJan, I will be fixing this.\n\nJan, I am attaching the current TODO list. Can you tell me which items\nare fixed in 6.4?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n\nTODO list for PostgreSQL\n========================\nLast updated:\t\tMon Aug 3 21:42:02 EDT 1998\n\nCurrent maintainer:\tBruce Momjian ([email protected])\n\nThe most recent version of this document can be viewed at\nthe PostgreSQL WWW site, http://www.postgreSQL.org.\n\nTHE CHANGES FOR 6.3 APPEAR AT THE END OF THIS DOCUMENT\n\nA dash(-) marks changes to be in the next release.\n\nDevelopers who have claimed items are:\n-------------------------------------\n\t* Bruce is Bruce Momjian<[email protected]>\n\t* Bryan is Bryan Henderson<[email protected]>\n\t* D'Arcy is D'Arcy J.M. Cain <[email protected]>\n\t* Dan is Dan McGuirk <[email protected]>\n\t* Daniel is Daniel Kalchev <[email protected]>\n\t* Darren is Darren King <[email protected]>\n\t* David is David Hartwig <[email protected]>\n\t* Edmund is Edmund Mergl <[email protected]>\n\t* Erich Stamberger <[email protected]>\n\t* Gerhard is Gerhard Reithofer <[email protected]>\n\t* Goran is Goran Thyni <[email protected]>\n\t* Henry is Henry B. Hotz <[email protected]>\n\t* Igor is Igor <[email protected]>\n\t* Jan is Jan Wieck <[email protected]>\n\t* Jun is Jun Kuwamura <[email protected]>\n\t* Kurt is \"Kurt J. Lidl\" <[email protected]>\n\t* Maarten is Maarten Boekhold <[email protected]>\n \t* Marc is Marc Fournier <[email protected]>\n \t* Martin is Martin S. Utesch <[email protected]>\n\t* Michael is Michael Meskes <[email protected]>\n\t* Oleg is Oleg Bartunov <[email protected]>\n\t* Paul is Paul M. Aoki <[email protected]>\n\t* Patrick is Patrick van Kleef <[email protected]>\n\t* Peter is Peter T Mount <[email protected]>\n\t* Phil is Phil Thompson <[email protected]>\n\t* Raymond is Raymond Toy <[email protected]>\n\t* Soo-Ho Ok <[email protected]>\n\t* Stefan Simkovics <[email protected]>\n\t* Sven is Sven Verdoolaege <[email protected]>\n\t* Tatsuo is Tatsuo Ishii <[email protected]>\n\t* Thomas is Thomas Lockhart <[email protected]>\n\t* Todd is Todd Brandys is <[email protected]>\n\t* Vadim is \"Vadim B. Mikheev\" <[email protected]>\n\t* Vivek is Vivek Khera <[email protected]>\n\nAdditional 6.3 developers include:\n---------------------------------\n\t* Billy is Billy G. Allie <[email protected]>\n\t* Brook is Brook Milligan <[email protected]>\n\t* James is James Hughes <[email protected]>\n\t* Jeroen is Jeroen van Vianen <[email protected]>\n\t* Matt is Matt Maycock <[email protected]>\n\t* Ryan is Ryan Kirkpatrick <[email protected]>\n\t* TomH is Tom I Helbekkmo <[email protected]>\n\t* TomS is Tom Szybist\n\t* Travis is Travis Melhiser <[email protected]>\n\nRELIABILITY\n-----------\n* Overhaul mdmgr/smgr to fix double unlinking and double opens, cleanup\n* Overhaul bufmgr/lockmgr/transaction manager\n* Remove EXTEND?\n* CREATE VIEW requires super-user priviledge\n* Can lo_export()/lo_import() read/write anywhere, causing a security problem?\n* Tables that start with xinv confused to be large objects\n* Two and three dimmensional arrays display improperly, missing {}\n* GROUP BY in INSERT INTO table SELECT * FROM table2 fails\n* Prevent auto-table reference, like SELECT table.col WHERE col = 3 (?)\n* SELECT * FROM table WHERE int4_column = '1' fails\n* SELECT a[1] FROM test fails, it needs test.a[1]\n* UPDATE table SET table.value = 3 fails\n* -Make pg_dump preserve inheritance column order, do non-inherits first\n* User who can create databases can modify pg_database table\n* optimizer memory exhaustion with many OR's\n* elog() does not free all its memory(Jan)\n* views on subselects fail\n* disallow inherited columns with the same name as new columns\n* recover or force failure when disk space is exhausted\n* default char() value not to full length crashes server on some OS's\n* allow UPDATE using aggregate to affect all rows, not just one\n* computations in views fail:\n\tcreate view test as select usesysid * usesysid from pg_shadow;\n \nENHANCEMENTS\n------------\n* Replace table-level locking with row or page-level locking(Vadim)\n* Add SERIAL type\n* Transaction log, so re-do log can be on a separate disk\n* Allow transaction commits with rollback with no-fsync performance\n* More access control over who can create tables and access the database\n* Add full ANSI SQL capabilities\n\t* -Implement HAVING clause(Stephan)\n\t* add OUTER joins, left and right (Thomas)\n\t* make VIEWs updateable where possible\n\t* add INTERSECTS, SUBTRACTS(Stephan)\n\t* add temporary tables\n\t* add sql3 recursive unions\n\t* add the concept of dataspaces\n\t* add DECIMAL, NUMERIC, DOUBLE PRECISION, BIT, BIT VARYING\n \t* NCHAR (as distinguished from ordinary varchar),\n\t* DOMAIN capability\n* Allow compression of large fields or a compressed field type\n* Fix the rules system(Jan,Soo-Ho)\n\t* robust\n\t* making INSTEAD rules work\n\t* add CONSTRAINT\n* Full set of text operations and functions\n\t* word searches, concat,max() on text, char\n* Large objects\n\t* Fix large object mapping scheme, own reltype(Peter)\n\t* Allow large text type to use large objects(Peter)\n\t* not to stuff everything as files in a single directory\n\t* Fix large object memory leaks\n* Better interface for adding to pg_group\n* Make MONEY/DECIMAL have a defined precision\n* Fix tables >2G, or report error when 2G size reached\n\t(fix lseek()/off_t, mdextend()/RELSEG_SIZE)\n* -Allow libpq to cancel query requests\n* Add REGEX internationalization\n* allow row re-use without vacuum, maybe?(Vadim)\n* -Remove restriction that ORDER BY field must be in SELECT list(David)\n* Add word index for text fields, maybe with trigrams, i.e.:\n * ' (cat | dog) & ! fox ' meaning text has cat aor dog, but not fox\n* Populate backend status area and write program to dump status data\n* Add ALTER TABLE DROP COLUMN feature\n* Allow INSERT INTO ... SELECT to convert column types\n* Add syslog functionality(Marc)\n* Add STDDEV/VARIANCE() function for standard deviation computation/variance\n* add UNIQUE capability to non-btree indexes\n* make number of backends a config parameter, storage/sinvaladt.h:MaxBackendId\n* certain indexes will not shrink, i.e. oid indexes with many inserts\n* make NULL's come out at the beginning or end depending on the ORDER BY direction\n* change the library/backend interface to use network byte order\n* Restore unused oid's on backend exit if no one else has gotten oids\n* remove non-standard types from the system, and make them loadable\n* have UPDATE/DELETE clean out indexes\n* allow WHERE restriction on ctid\n* allow pg_descriptions when creating types, tables, columns, and functions\n* Fix compile and security of Kerberos/GSSAPI code\n* Allow psql to print nulls as distinct from \"\"(?)\n* Allow variable casts with BETWEEN 'today'::asbtime AND 'today'::abstime\n* Allow INSERT INTO ... SELECT ... FROM view to work\n* Make VACUUM on database not lock pg_class\n* Make VACUUM ANALYZE only use a readlock\n* Allow cursors to be DECLAREd/OPENed/CLOSEed outside transactions\n* Allow installation data block size and max tuple size configuration(Darren)\n* Allow views on a UNION\n* Allow DISTINCT on view\n* Allow views of aggregate columns\n* Allow variable block sizes(Darren)\n* System tables are now more update-able from SQL(Jan)\n* New pg_shadow file, pg_user is now a view of pg_shadow(Jan)\n* Allow flag to control COPY input/output of NULLs\n* Allow CLUSTER on all tables at once, and improve CLUSTER\n* Change all references of Postgres to PostgreSQL, including binary names\n* Add ELOG_TIMESTAMPS to elog()(?)\n* Change LOCK tablename to LOCK TABLE tablename(?)\n* Allow max tuple length to be changed(Darren)\n* Have psql with no database name not connect to username as default(?)\n* Allow subqueries in target list\n* Granting permissions to another user looses permissions for the owner\n* Allow queries across multiple databases\n* Add replication of distributed databases\n* Allow table destruction/alter to be rolled back\n* Add pg_attribute.atttypmod/Resdom->restypmod to PGresult structure\n* Generate error on CREATE OPERATOR of ~~, ~ and and ~*\n* Allow constraint NULL just as we honor NOT NULL\n* Allow views to specify column names outside SELECT statement\n* Add version number in startup banners for psql and postmaster\n* Restructure storing of GRANT permission information to allow +-=\n* allow psql \\copy to allow delimiters\n* allow international error message support and add error codes\n* allow ORDER BY a function(David)\n* allow usernames with dashes(GRANT fails)\n* add a function to return the last inserted oid, for use in psql scripts\n* allow creation of functional indexes to use default types\n\nPERFORMANCE\n-----------\n* Use indexes in ORDER BY for restrictive data sets, min(), max()\n* Optimizing disjunctive queries\n* Fix bushy-plans\n* Other optimizer bugs\n* Prevent fsync in SELECT-only queries\n* Cache most recent query plan(s?)\n* Shared catalog cache, reduce lseek()'s by caching table size in shared area\n* Allow compression of log and meta data\n* Add FILLFACTOR to index creation\n* -Allow indexes to be used with OR clauses(Bruce)\n* update pg_statistic table to remove operator column\n* make index creation use psort code, because it is now faster(Vadim)\n* remove fork()/exec() of backend and make it just fork()\n* Add base table name to \\d index\n* Allow char() not to use variable-sized header to reduce disk size\n* Do async I/O to do better read-ahead of data\n* Fix optmizer problem with self-table joins\n* Fix memory exhaustion when using many OR's\n* Use spin locks only on multi-CPU systems, yield CPU instead\n* Get faster regex() code from Henry Spencer <[email protected]>\n\twhen it is available\n* use mmap() rather than SYSV shared memory(?)\n* use index to restrict rows returned by multi-key index when used with\n\tnon-consecutive keys or OR clauses, so fewer heap accesses\n\nDOCUMENTATION\n-------------\n* Update usermanual source(many)\n* added features used in grammer but not in docs, like :: and CAST\n* update libpq++ and pginterface manual page\n* Add keyword list to documentation, already in /tools\n* Add 'man pgsql' to show all manual page names\n\n\n\n=============================================================================\n\n\nCHANGES IN THE 6.3.2 PATCH\n--------------------------\nconfigure detection improvements for tcl/tk(Brook Milligan, Alvin)\nManual page improvements(Bruce)\nBETWEEN and LIKE fix(Thomas)\nfix for psql \\connect used by pg_dump(Oliver Elphick)\nNew odbc driver\npgaccess, version 0.86\nqsort removed, now uses libc version, cleanups(Jeroen)\nfix for buffer over-runs detected(Maurice Gittens)\nfix for buffer overrun in libpgtcl(Randy Kunkee)\nfix for UNION with DISTINCT or ORDER BY(Bruce)\ngettimeofday configure check(Doug Winterburn)\nFix \"indexes not used\" bug(Vadim)\ndocs additions(Thomas)\nFix for backend memory leak(Bruce)\nlibreadline cleanup(Erwan MAS)\nRemove DISTDIR(Bruce)\nMakefile dependency cleanup(Jeroen van Vianen)\nASSERT fixes(Bruce)\n\n\nCHANGES IN THE 6.3.1 PATCH \n--------------------------\necpg cleanup/fixes, now version 1.1(Michael Meskes)\npg_user cleanup(Bruce)\nlarge object fix for pg_dump and tclsh([email protected])\nLIKE fix for multiple adjacent underscores\nLIKE/BETWEEN fix for having function call as target(Thomas)\nfix for redefining builtin functions(Thomas)\nultrix4 cleanup\nupgrade to pg_access 0.83\nupdated CLUSTER manual page\nmulti-byte character set support, see doc/README.mb(Tatsuo)\nconfigure --with-pgport fix\npg_ident fix\nbig-endian fix for backend communications(Kataoka)\nSUBSTR() and substring() fix(Jan)\nseveral jdbc fixes(Peter)\nlibpgtcl improvements, see libptcl/README(Randy Kunkee)\nFix for \"Datasize = 0\" error(Vadim)\nPrevent \\do from wrapping(Bruce)\nRemove duplicate Russian character set entries\nSunos4 cleanup\nAllow optional TABLE keyword in LOCK and SELECT INTO(Thomas)\nCREATE SEQUENCE options to allow a negative integer(Thomas)\nAdd \"PASSWORD\" as an allowed column identifier(Thomas)\nAdd checks for UNION target fields(Bruce)\nFix Alpha port(Dwayne Bailey)\nFix for text arrays containing quotes(Doug Gibson)\nSolaris compile fix(Albert Chin-A-Young)\nBetter identify tcl and tk libs and includes(Bruce)\n\n\n\nCHANGES IN THE 6.3 RELEASE\n--------------------------\n\nThere are some general 6.3 issues that I want to mention. These are\nonly the big items that can not be described in one sentence.\n\nFirst, we now have subselects. Now that we have them, I would like to\nmention that without subselects, SQL is a very limited language.\nSubselects are a major feature, and you should review your code for\nplaces where subselects provide a better solution for your queries. I\nthink you will find that there are more uses for subselects than you may\nthink. Vadim has put us on the big SQL map with subselects, and fully\nfunctional ones too. The only thing you can't do with subselects is to\nuse them in the target list.\n\nSecond, 6.3 uses unix domain sockets rather than TCP/IP by default. To\nenable connections from other machines, you have to use the new\npostmaster -i option, and of course edit pg_hba.conf. Also, for this\nreason, the format of pg_hba.conf has changed.\n\nThird, char() fields will now allow faster access than varchar() or\ntext. Specifically, the text and varchar() have a penalty for access to\nany columns after the first column of this type. char() used to also\nhave this access penalty, but it no longer does. This may suggest that\nyou redesign some of your tables, especially if you have short character\ncolumns that you have defined as varchar() or text. This and other\nchanges make 6.3 even faster than earlier releases.\n\nWe now have passwords definable independent of any Unix file. There are\nnew SQL USER commands. See the pg_hba.conf manual page for more\ninformation. There is a new table, pg_shadow, which is used to store\nuser information and user passwords, and it by default only SELECT-able\nby the postgres super-user. pg_user is now a view of pg_shadow, and is\nSELECT-able by PUBLIC. You should keep using pg_user in your\napplication without changes.\n\nUser-created tables now no longer have SELECT permission to PUBLIC by\ndefault. This was done because the ANSI standard requires it. You can\nof course GRANT any permissions you want after the table is created. \nSystem tables continue to be SELECT-able by PUBLIC.\n\nWe also have real deadlock detection code. No more sixty-second\ntimeouts. And the new locking code implements a FIFO better, so there\nshould be less resource starvation during heavy use.\n\nMany complaints have been made about inadequate documenation in previous\nreleases. Thomas has put much effort into many new manuals for this\nrelease. Check out the /doc directory.\n\nFor performance reasons, time travel is gone, but can be implemented\nusing triggers (see pgsql/contrib/spi/README). Please check out the new\n\\d command for types, operators, etc. Also, views have their own\npermissions now, not based on the underlying tables, so permissions on\nthem have to be set separately. Check /pgsql/interfaces for some new\nways to talk to PostgreSQL.\n\nThis is the first release that really required an explaination for\nexisting users. In many ways, this was necessary because the new\nrelease removes many limitations, and the work-arounds people were using\nare no longer needed.\n\nBug Fixes\n---------\nFix binary cursors broken by MOVE implementation(Vadim)\nFix for tcl library crash(Jan)\nFix for array handling, from Gerhard Hintermayer\nFix acl error, and remove duplicate pqtrace(Bruce)\nFix psql \\e for empty file(Bruce)\nFix for textcat on varchar() fields(Bruce)\nFix for DBT Sendproc (Zeugswetter Andres)\nFix vacuum analyze syntax problem(Bruce)\nFix for international identifiers(Tatsuo)\nFix aggregates on inherited tables(Bruce)\nFix substr() for out-of-bounds data\nFix for select 1=1 or 2=2, select 1=1 and 2=2, and select sum(2+2)(Bruce)\nFix notty output to show status result. -q option still turns it off(Bruce)\nFix for count(*), aggs with views and multiple tables and sum(3)(Bruce)\nFix cluster(Bruce)\nFix for PQtrace start/stop several times(Bruce)\nFix a variety of locking problems like newer lock waiters getting\n\tlock before older waiters, and having readlock people not share\n\tlocks if a writer is waiting for a lock, and waiting writers not\n\tgetting priority over waiting readers(Bruce)\nFix crashes in psql when executing queries from external files(James)\nFix problem with multiple order by columns, with the first one having\n\tNULL values(Jeroen)\nUse correct hash table support functions for float8 and int4(Thomas)\nRe-enable JOIN= option in CREATE OPERATOR statement (Thomas)\nChange precedence for boolean operators to match expected behavior(Thomas)\nGenerate elog(ERROR) on over-large integer(Bruce)\nAllow multiple-argument functions in constraint clauses(Thomas)\nCheck boolean input literals for 'true','false','yes','no','1','0'\n\tand throw elog(ERROR) if unrecognized(Thomas)\nMajor large objects fix\nFix for GROUP BY showing duplicates(Vadim)\nFix for index scans in MergeJion(Vadim)\n\nEnhancements\n------------\nSubselects with EXISTS, IN, ALL, ANY keywords (Vadim, Bruce, Thomas)\nNew User Manual(Thomas, others)\nSpeedup by inlining some frequently-called functions\nReal deadlock detection, no more timeouts(Bruce)\nAdd SQL92 \"constants\" CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, \n\tCURRENT_USER(Thomas)\nModify constraint syntax to be SQL92-compliant(Thomas)\nImplement SQL92 PRIMARY KEY and UNIQUE clauses using indices(Thomas)\nRecognize SQL92 syntax for FOREIGN KEY. Throw elog notice(Thomas)\nAllow NOT NULL UNIQUE constraint clause (each allowed separately before)(Thomas)\nAllow Postgres-style casting (\"::\") of non-constants(Thomas)\nAdd support for SQL3 TRUE and FALSE boolean constants(Thomas)\nSupport SQL92 syntax for IS TRUE/IS FALSE/IS NOT TRUE/IS NOT FALSE(Thomas)\nAllow shorter strings for boolean literals (e.g. \"t\", \"tr\", \"tru\")(Thomas)\nAllow SQL92 delimited identifiers(Thomas)\nImplement SQL92 binary and hexadecimal string decoding (b'10' and x'1F')(Thomas)\nSupport SQL92 syntax for type coercion of literal strings\n\t(e.g. \"DATETIME 'now'\")(Thomas)\nAdd conversions for int2, int4, and OID types to and from text(Thomas)\nUse shared lock when building indices(Vadim)\nFree memory allocated for an user query inside transaction block after\n\tthis query is done, was turned off in <= 6.2.1(Vadim)\nNew SQL statement CREATE PROCEDURAL LANGUAGE(Jan)\nNew PostgreSQL Procedural Language (PL) backend interface(Jan)\nRename pg_dump -H option to -h(Bruce)\nAdd Java support for passwords, European dates(Peter)\nUse indices for LIKE and ~, !~ operations(Bruce)\nAdd hash functions for datetime and timespan(Thomas)\nTime Travel removed(Vadim, Bruce)\nAdd paging for \\d and \\z, and fix \\i(Bruce)\nAdd Unix domain socket support to backend and to frontend library(Goran)\nImplement CREATE DATABASE/WITH LOCATION and initlocation utility(Thomas)\nAllow more SQL92 and/or Postgres reserved words as column identifiers(Thomas)\nAugment support for SQL92 SET TIME ZONE...(Thomas)\nSET/SHOW/RESET TIME ZONE uses TZ backend environment variable(Thomas)\nImplement SET keyword = DEFAULT and SET TIME ZONE DEFAULT(Thomas)\nEnable SET TIME ZONE using TZ environment variable(Thomas)\nAdd PGDATESTYLE environment variable to frontend and backend initialization(Thomas)\nAdd PGTZ, PGCOSTHEAP, PGCOSTINDEX, PGRPLANS, PGGEQO\n\tfrontend library initialization environment variables(Thomas)\nRegression tests time zone automatically set with \"setenv PGTZ PST8PDT\"(Thomas)\nAdd pg_description table for info on tables, columns, operators, types, and\n\taggregates(Bruce)\nIncrease 16 char limit on system table/index names to 32 characters(Bruce)\nRename system indices(Bruce)\nAdd 'GERMAN' option to SET DATESTYLE(Thomas)\nDefine an \"ISO-style\" timespan output format with \"hh:mm:ss\" fields(Thomas)\nAllow fractional values for delta times (e.g. '2.5 days')(Thomas)\nValidate numeric input more carefully for delta times(Thomas)\nImplement day of year as possible input to date_part()(Thomas)\nDefine timespan_finite() and text_timespan() functions(Thomas)\nRemove archive stuff(Bruce)\nAllow for a pg_password authentication database that is separate from\n\tthe system password file(Todd)\nDump ACLs, GRANT, REVOKE permissions(Matt)\nDefine text, varchar, and bpchar string length functions(Thomas)\nFix Query handling for inheritance, and cost computations(Bruce)\nImplement CREATE TABLE/AS SELECT (alternative to SELECT/INTO)(Thomas)\nAllow NOT, IS NULL, IS NOT NULL in constraints(Thomas)\nImplement UNIONs for SELECT(Bruce)\nAdd UNION, GROUP, DISTINCT to INSERT(Bruce)\nvarchar() stores only necessary bytes on disk(Bruce)\nFix for BLOBs(Peter)\nMega-Patch for JDBC...see README_6.3 for list of changes(Peter)\nRemove unused \"option\" from PQconnectdb()\nNew LOCK command and lock manual page describing deadlocks(Bruce)\nAdd new psql \\da, \\dd, \\df, \\do, \\dS, and \\dT commands(Bruce)\nEnhance psql \\z to show sequences(Bruce)\nShow NOT NULL and DEFAULT in psql \\d table(Bruce)\nNew psql .psqlrc file startup(Andrew)\nModify sample startup script in contrib/linux to show syslog(Thomas)\nNew types for IP and MAC addresses in contrib/ip_and_mac(TomH)\nUnix system time conversions with date/time types in contrib/unixdate(Thomas)\nUpdate of contrib stuff(Massimo)\nAdd Unix socket support to DBD::Pg(Goran)\nNew python interface (PyGreSQL 2.0)(D'Arcy)\nNew frontend/backend protocol has a version number, network byte order(Phil)\nSecurity features in pg_hba.conf enhanced and documented, many cleanups(Phil)\nCHAR() now faster access than VARCHAR() or TEXT\necpg embedded SQL preprocessor\nReduce system column overhead(Vadmin)\nRemove pg_time table(Vadim)\nAdd pg_type attribute to identify types that need length (bpchar, varchar)\nAdd report of offending line when COPY command fails\nAllow VIEW permissions to be set separately from the underlying tables. \n\tFor security, use GRANT/REVOKE on views as appropriate(Jan)\nTables now have no default GRANT SELECT TO PUBLIC. You must\n\texplicitly grant such permissions.\nClean up tutorial examples(Darren)\n\nSource Tree Changes\n-------------------\nAdd new html development tools, and flow chart in /tools/backend\nFix for SCO compiles\nStratus computer port \"Gillies, Robert\" <[email protected]>\nAdded support for shlib for BSD44_derived & i386_solaris\nMake configure more automated(Brook)\nAdd script to check regression test results\nBreak parser functions into smaller files, group together(Bruce)\nRename heap_create to heap_create_and_catalog, rename heap_creatr\n\tto heap_create()(Bruce)\nSparc/Linux patch for locking(TomS)\nRemove PORTNAME and reorganize port-specific stuff(Marc)\nAdd optimizer README file(Bruce)\nRemove some recursion in optimizer and clean up some code there(Bruce)\nFix for NetBSD locking(Henry)\nFix for libptcl make(Tatsuo)\nAIX patch(Darren)\nChange IS TRUE, IS FALSE, ... to expressions using \"=\" rather than\n\tfunction calls to istrue() or isfalse() to allow optimization(Thomas)\nVarious fixes NetBSD/Sparc related(TomH)\nAlpha linux locking(Travis,Ryan)\nChange elog(WARN) to elog(ERROR)(Bruce)\nFAQ for FreeBSD(Marc)\nBring in the PostODBC source tree as part of our standard distribution(Marc)\nA minor patch for HP/UX 10 vs 9(Stan)\nNew pg_attribute.atttypmod for type-specific info like varchar length(Bruce)\nUnixware patches(Billy)\nNew i386 'lock' for spin lock asm(Billy)\nSupport for multiplexed backends is removed\nStart an OpenBSD port\nStart an AUX port\nStart a Cygnus port\nAdd string functions to regression suite(Thomas)\nExpand a few function names formerly truncated to 16 characters(Thomas)\nRemove un-needed malloc() calls and replace with palloc()(Bruce)", "msg_date": "Sun, 23 Aug 1998 21:52:03 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Problem with parser" }, { "msg_contents": "> Jan, I am attaching the current TODO list. Can you tell me which items\n> are fixed in 6.4?\n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> \n\n\n> * CREATE VIEW requires super-user priviledge\n\n Fixed - regular users can create views and rules\n\n> * views on subselects fail\n\n Must check that - hope it is already fixed\n\n> * computations in views fail:\n> \tcreate view test as select usesysid * usesysid from pg_shadow;\n\n Will check this too\n\n> * Add full ANSI SQL capabilities\n> \t* -Implement HAVING clause(Stephan)\n> \t* add OUTER joins, left and right (Thomas)\n> \t* make VIEWs updateable where possible\n\n Rules can be used to make views updateable\n\n> * Fix the rules system(Jan,Soo-Ho)\n> \t* robust\n> \t* making INSTEAD rules work\n> \t* add CONSTRAINT\n\n The restricted part of rules are robust and instead rules\n work. Constraints could be implemented as rules but would\n require a new RAISE statement. I'll work on constraints\n for 6.5.\n\n> * Allow INSERT INTO ... SELECT ... FROM view to work\n\n Should work - will check it.\n\n> * Allow views on a UNION\n> * Allow DISTINCT on view\n> * Allow views of aggregate columns\n\n Check - not yet - check\n\n> * Allow views to specify column names outside SELECT statement\n\n ??? what is meant by that?\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#======================================== [email protected] (Jan Wieck) #\n\n", "msg_date": "Wed, 26 Aug 1998 11:23:09 +0200 (MET DST)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "TODO (was: Re: [HACKERS] Problem with parser)" }, { "msg_contents": "> > Jan, I am attaching the current TODO list. Can you tell me which items\n> > are fixed in 6.4?\n> > \n> > -- \n> > Bruce Momjian | 830 Blythe Avenue\n> > \n> \n> \n> > * CREATE VIEW requires super-user priviledge\n> \n> Fixed - regular users can create views and rules\n> \n> > * views on subselects fail\n> \n> Must check that - hope it is already fixed\n> \n> > * computations in views fail:\n> > \tcreate view test as select usesysid * usesysid from pg_shadow;\n> \n> Will check this too\n> \n> > * Add full ANSI SQL capabilities\n> > \t* -Implement HAVING clause(Stephan)\n> > \t* add OUTER joins, left and right (Thomas)\n> > \t* make VIEWs updateable where possible\n> \n> Rules can be used to make views updateable\n> \n> > * Fix the rules system(Jan,Soo-Ho)\n> > \t* robust\n> > \t* making INSTEAD rules work\n> > \t* add CONSTRAINT\n> \n> The restricted part of rules are robust and instead rules\n> work. Constraints could be implemented as rules but would\n> require a new RAISE statement. I'll work on constraints\n> for 6.5.\n> \n> > * Allow INSERT INTO ... SELECT ... FROM view to work\n> \n> Should work - will check it.\n> \n> > * Allow views on a UNION\n> > * Allow DISTINCT on view\n> > * Allow views of aggregate columns\n> \n> Check - not yet - check\n> \n> > * Allow views to specify column names outside SELECT statement\n> \n> ??? what is meant by that?\n\nI have no idea. I am removing it. Does anyone else know what it means?\n\nI have updated the TODO list. If you find more items you have fixed,\nlet me know. The rewrite system had a large chunk of the TODO list. \nThat is why I was so excited when you said you could fix it.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Wed, 26 Aug 1998 12:23:43 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: TODO (was: Re: [HACKERS] Problem with parser)" }, { "msg_contents": "On Wed, 26 Aug 1998, Bruce Momjian wrote:\n\n> > > * Allow views to specify column names outside SELECT statement\n> > \n> > ??? what is meant by that?\n> \n> I have no idea. I am removing it. Does anyone else know what it means?\n\n\tMight it have had something to do with the inability to do a WHERE\nclause on a field not in the target list?\n\n\n", "msg_date": "Wed, 26 Aug 1998 12:52:28 -0400 (EDT)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: TODO (was: Re: [HACKERS] Problem with parser)" } ]
[ { "msg_contents": "Hi,\n\nI would like to write a Java application on Netscape FastTrack3.01\nserver under Solaris. My Java application will access data or populate\ndata to a Postgre database installed \non a Linux machine running PostgreSQL server.\n\nHere is a list of my questions before using Postgre database for my Java\napplication:\n\n1. Does my Java application needs to go through JDBC driver\n to communicate with Postgre database?\n\n2. Where can I obtain the JDBC driver that provides Postgre database\n APIs so that my Java application can refer to?\n\n3. Do I need to install JDBC driver on my Netscape FastTrack3.0.1\n machine? \n\n If the answer is YES, where should I install JDBC driver\n on my Netscape FastTrack3.0.1 server machine?\n\n4. What system configuration is required to connect my Java application\n running under Netscape FastTrack3.0.1 machine (client machine) to\n PostgreSQL server (database server)?\n\n5. Is there a built-in SQL net layer provided by PostgreSQL server?\n SQL net is the interface that allows user's front-end application\n to access the database on Postgre server.\n\nYour answer is highly appreciated.\n\nThanks,\n\nLinda Chow\nSenior Java Engineer\nVSIS Inc.\[email protected]\n", "msg_date": "Fri, 14 Aug 1998 11:54:12 -0700", "msg_from": "Linda Chow <[email protected]>", "msg_from_op": true, "msg_subject": "access Postgre database through JDBC driver from Netscape\n\tFastTrack3.0.1 machine" } ]
[ { "msg_contents": "Can someone tell me what setheapoverride() does? I see it around\nheap_replace a lot.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Fri, 14 Aug 1998 22:22:06 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "setheapoverride" }, { "msg_contents": "> Can someone tell me what setheapoverride() does? I see it around\n> heap_replace a lot.\n\nSeems to allow a transaction to see its own change, but why is that\nimportant when doing heap_replace()?\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n", "msg_date": "Sat, 15 Aug 1998 00:35:19 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] setheapoverride" } ]