Re: [BUGS] drop tempoary table VERY slow
On Fri, 2002-05-31 at 22:28, Sam Liddicott wrote: > And when I do drop a table CPU usage goes to 99% on one CPU. When did you last do a vacuum? If you are adding and dropping temporary tables a lot, perhaps you should vacuum pg_class and pg_attribute often as well. Regards, Andrew. > > Sam > > -Original Message- > From: Sam Liddicott > Sent: 31 May 2002 10:57 > To: '[EMAIL PROTECTED]' > Subject: drop tempoary table VERY slow > > > I have a DB where this: > > select 1 into temporary table x; > runs quickly, but > > drop table x; > > takes many seconds to run. > > I don't know why. > > But: > > begin; > > select 1 into temporary table x; > abort; > > is very quick. > > Note the slow dropping applies to automatic dropping of temporary tables > when the connection is closed. > I now "abort" all my query sessions for speed. > > I cannot reproduce this on "template1" and it has not always been the case > for my DB. > -- Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington WEB: http://catalyst.net.nz/PHYS: Level 2, 150-154 Willis St DDI: +64(4)916-7201MOB: +64(21)635-694OFFICE: +64(4)499-2267 Are you enrolled at http://schoolreunions.co.nz/ yet? ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [BUGS] Bug #655: win32 client and bytea column
Yes, this is certainly our error message: pg_exec() query failed: pqReadData() -- read() failed: errno=0 No error Of course, the "0 No error" is odd. I think that just means that read() itself didn't set errno for the failure. You are clearly base64 encoding the storage info, meaning it isn't some strange character in the data. Are you using 7.2 for the server and the client? My guess is that Win isn't handling some of the larger packets, but I may be wrong. If it fails reliably, could you find the exact length where it fails. That may help. --- [EMAIL PROTECTED] wrote: > Krzysztof Stachlewski ([EMAIL PROTECTED]) reports a bug with a severity of 1 > The lower the number the more severe it is. > > Short Description > win32 client and bytea column > > Long Description > I have a problem with using bytea column with PHP. > I am using Apache 1.3.24 on Windows 2000, PHP 4.2.0 > installed as Apache module. > PostgreSQL 7.2.1 on Linux (Debian). > When trying to manipulate the bytea column I get the following error: > pg_exec() query failed: pqReadData() -- read() failed: errno=0 No error > The guys from PHP told me this is not a problem with their code, but > with postgresql. (I submitted a bug report to php.net) > The error message is shown only when the code is runned from PHP on > Windows system. Exactly the same code, runned on Linux version > of PHP 4.1.2 causes no > problems at all. The problem does not appear when the amount of > data in the bytea column or data to be inserted into bytea > column is small enough. > "Small enough" seems to be sth about few hundred bytes. > I thought this is a problem with the libpq.dll - the version of > the one that shipped with PHP was 7.0.2. > I have downloaded the latest source code of Postgres and compiled > the 7.2.1 version of the dll. That didn't solve the problem. > > Sample Code > create table bin(id int primary key, dat bytea not null); > > php code below: > $connection = pg_connect("your favourite connection string"); > $data = base64_encode(str_repeat("example", 1000)); > $query = "insert into bin values (1, decode('$data', 'base64'))"); > pg_exec($connection, $query) > ?> > > > > No file was uploaded with this report > > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [BUGS] Bug #656: timestamp function generates parsing errors when
Tom Lane wrote: > [EMAIL PROTECTED] writes: > > See the following session examples using the form given in the documentation. >'select timestamp(now());' fails similarly. > > I'm afraid you've got bit by our continuing pursuit of SQL standard > compliance. The 7.2 release notes do point out: > > Observe the following incompatibilities: > * The timestamp() function is no longer available. Use timestamp 'string' >instead, or CAST. > > but I notice that the last two examples in Table 4-17 "Date/Time Functions" > didn't get fixed. (AFAICT there are no other places in current > documentation that claim you can do that.) I have removed those two timestamp() entries from the SGML table; patch attached. I don't see any need to mention casting in that table. In fact, timestamp() was the only conversion function mentioned in that table. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 Index: doc/src/sgml/func.sgml === RCS file: /cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.98 diff -c -r1.98 func.sgml *** doc/src/sgml/func.sgml 18 May 2002 13:47:59 - 1.98 --- doc/src/sgml/func.sgml 2 Jun 2002 21:51:45 - *** *** 2730,2750 Wed Feb 21 17:01:13.000126 2001 EST - - timestamp(date) - timestamp - date to timestamp - timestamp(date '2000-12-25') - 2000-12-25 00:00:00 - - - - timestamp(date, time) - timestamp - date and time to timestamp - timestamp(date '1998-02-24',time '23:07') - 1998-02-24 23:07:00 - --- 2730,2735 ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [BUGS] PQescapeString and PQescapeBytea not exported during win
Attached patch applied. Let me know if this is incorrect. --- Rob Butler wrote: > Hello all, > > Simple "bug" > > Win 32 builds do not have PQescapeString or PQescapeBytea declared in the > libpqdll.def file. This causes linking against libpqdll.lib to fail if > either of the functions are called within a program. Add entries to the def > file for these functions so they are exported during the win 32 build. > > Thanks > Rob > > _ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > ---(end of broadcast)--- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html > -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 Index: src/interfaces/libpq/libpqdll.def === RCS file: /cvsroot/pgsql/src/interfaces/libpq/libpqdll.def,v retrieving revision 1.14 diff -c -r1.14 libpqdll.def *** src/interfaces/libpq/libpqdll.def 6 Sep 2001 02:54:56 - 1.14 --- src/interfaces/libpq/libpqdll.def 2 Jun 2002 22:33:03 - *** *** 88,90 --- 88,92 PQsetClientEncoding @ 85 PQsetnonblocking@ 86 PQfreeNotify@ 87 + PQescapeString @ 88 + PQescapeBytea @ 89 ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster