[HACKERS] int64/double for time/timestamp

2005-02-22 Thread Teodor Sigaev
Hi! I work on memory leaks during creation index on time/timestamp column using GiST and found follow problem (?): For timestamp storage and defines are defined as (from utils/timestamp.h): #ifdef HAVE_INT64_TIMESTAMP typedef int64 Timestamp; #define TimestampGetDatum(X) Int64GetDatum(X) #define

[HACKERS] Question about Unrecognized SPI code ...

2005-02-22 Thread Hans-Jürgen Schönig
I just found an interesting issue in recent PostgreSQL releases: CREATE VIEW view_nonsense AS SELECT 1 AS a, 2 AS b; CREATE RULE myrule AS ON INSERT TO view_nonsense DO INSTEAD NOTHING; CREATE OR REPLACE FUNCTION debug() RETURNS boolean AS ' DECLARE BEGIN

Re: [HACKERS] Get rid of system attributes in pg_attribute?

2005-02-22 Thread Robert Treat
On Monday 21 February 2005 04:23, Christopher Kings-Lynne wrote: I'm wondering how useful it is to store explicit representations of the system attributes in pg_attribute. We could very easily hard-wire those things instead, which would make for a large reduction in the number of entries

Re: [HACKERS] Get rid of system attributes in pg_attribute?

2005-02-22 Thread Robert Treat
On Sunday 20 February 2005 12:30, Tom Lane wrote: Robert Treat [EMAIL PROTECTED] writes: One of us is not understanding the other :-) I'm asking if I have a piece of code that does something like select attname from pg_attribute where attrelid = 'stock'::regclass::oid with the intent of

[HACKERS] big problem

2005-02-22 Thread Bostjan Potocnik
Hi all, I couldn't find anything related to my problem on web or irc, so i'm posting here. I deleted valuable data from wrong table :) pretty common problem i think. Guy on #postgresql at freenode told me that my data is still there, but tricky part is how to undo my delete. I'm using pg 7.4.7

Re: [HACKERS] big problem

2005-02-22 Thread Christopher Kings-Lynne
I deleted valuable data from wrong table :) pretty common problem i think. Guy on #postgresql at freenode told me that my data is still there, but tricky part is how to undo my delete. I'm using pg 7.4.7 on fbsd, i dont' use any special config and pg_xlog is fine. I hope there is a solution :)

Re: [HACKERS] Get rid of system attributes in pg_attribute?

2005-02-22 Thread Tom Lane
Robert Treat [EMAIL PROTECTED] writes: Does anyone know of client code that actually pays attention to pg_attribute rows with negative attnums? Well, the corner case would be for those times when we use oid for updating specific rows in a table, if a user creates there own oid column then

Re: [HACKERS] big problem

2005-02-22 Thread Tom Lane
Christopher Kings-Lynne [EMAIL PROTECTED] writes: I deleted valuable data from wrong table :) pretty common problem i think. Guy on #postgresql at freenode told me that my data is still there, but tricky part is how to undo my delete. I'm using pg 7.4.7 on fbsd, i dont' use any special config

Re: [HACKERS] Get rid of system attributes in pg_attribute?

2005-02-22 Thread Robert Treat
On Tuesday 22 February 2005 10:32, Tom Lane wrote: Robert Treat [EMAIL PROTECTED] writes: Does anyone know of client code that actually pays attention to pg_attribute rows with negative attnums? Well, the corner case would be for those times when we use oid for updating specific rows

Re: [HACKERS] Get rid of system attributes in pg_attribute?

2005-02-22 Thread Tom Lane
Robert Treat [EMAIL PROTECTED] writes: On Tuesday 22 February 2005 10:32, Tom Lane wrote: Probably ctid is the more interesting case; I'm pretty sure ODBC relies on ctid as a short-term-unique row identifier. Yeah... how many utility tools out there reference system columns explicitly? I

Re: [HACKERS] psql: recall previous command?

2005-02-22 Thread Darcy Buskermolen
On February 21, 2005 08:26 pm, Neil Conway wrote: Is there a way to recall the previous command in psql? Obviously, up arrow or Ctrl-P using readline and the default readline bindings is close, but it recalls the previous _line_ of input. That is not at all the same thing in the case of a

Re: [HACKERS] Get rid of system attributes in pg_attribute?

2005-02-22 Thread Andreas Pflug
Tom Lane wrote: Well, that probably knocks out my thought that we could stop reserving the system column names (at least ctid and xmin, which are the two that actually seem useful to ordinary clients, need to stay reserved). But it still seems like we don't have to represent these columns

Re: [HACKERS] Get rid of system attributes in pg_attribute?

2005-02-22 Thread Tom Lane
Andreas Pflug [EMAIL PROTECTED] writes: Tom Lane wrote: it still seems like we don't have to represent these columns explicitly in pg_attribute. Hm, technically you might be right. Still, I like pgAdmin3 to show that columns (when show system objects is enabled) for teaching purposes, so

Re: [HACKERS] Question about Unrecognized SPI code ...

2005-02-22 Thread Tom Lane
=?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= [EMAIL PROTECTED] writes: ERROR: SPI_execute_plan failed executing query INSERT INTO view_nonsense VALUES (10, 20): Unrecognized SPI code 0 CONTEXT: PL/pgSQL function debug line 4 at SQL statement SPI_result_code_string(int code) and PL/pgSQL don't

Re: [HACKERS] int64/double for time/timestamp

2005-02-22 Thread Tom Lane
Teodor Sigaev [EMAIL PROTECTED] writes: It looks consistently, but for time (from utils/date.h): ifdef HAVE_INT64_TIMESTAMP typedef int64 TimeADT; #else typedef float8 TimeADT; #endif #define TimeADTGetDatum(X)Float8GetDatum(X) #define DatumGetTimeADT(X)((TimeADT)

Re: [HACKERS] Get rid of system attributes in pg_attribute?

2005-02-22 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug [EMAIL PROTECTED] writes: Tom Lane wrote: it still seems like we don't have to represent these columns explicitly in pg_attribute. Hm, technically you might be right. Still, I like pgAdmin3 to show that columns (when show system objects is enabled) for teaching

Re: [HACKERS] [NOVICE] Question on TRUNCATE privleges

2005-02-22 Thread Tom Lane
Keith Worthington [EMAIL PROTECTED] writes: I have just discovered that I can speed up one of my functions by a factor of 600 by changing an unqualified DELETE to a TRUNCATE. Unfortunately, the function is run by multiple users and I get the error message TESTDB= TRUNCATE

Re: [HACKERS] [NOVICE] Question on TRUNCATE privleges

2005-02-22 Thread Robert Treat
On Tue, 2005-02-22 at 14:00, Tom Lane wrote: Keith Worthington [EMAIL PROTECTED] writes: I have just discovered that I can speed up one of my functions by a factor of 600 by changing an unqualified DELETE to a TRUNCATE. Unfortunately, the function is run by multiple users and I get the

Re: [HACKERS] [pgsql-hackers-win32] UNICODE/UTF-8 on win32

2005-02-22 Thread Magnus Hagander
The installer does not permit it, but initdb lets you do anything yuo want - I think that's where we are. If you know what you're doing, you can use it by manually initdbing. There is no such thing as unicode locale. Unicode (UTF8) is an encoding, that has to be paired with a locale. I assume you

Re: [HACKERS] Design notes for BufMgrLock rewrite

2005-02-22 Thread Simon Riggs
On Mon, 2005-02-21 at 18:45 -0500, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: ...but do you agree with my comments on the lack of scalability in cache miss situations? No. Grabbing a lock during a cache miss is the least of your worries; you're going to do I/O, or at least a

Re: [HACKERS] Repleacement for src/port/snprintf.c

2005-02-22 Thread Nicolai Tufar
On Mon, Feb 21, 2005 at 10:53:08PM -0500, Bruce Momjian wrote: Applied. Thanks a lot. The patch attached solves the tread safety problem. Please review it before applying, I am not sure I am doing the right thing On Tue, 22 Feb 2005 19:57:15 +0100, Kurt Roeckx [EMAIL PROTECTED] wrote: The

Re: [HACKERS] left-deep plans?

2005-02-22 Thread Neil Conway
Kenneth Marshall wrote: GEQO is an attempt to provide a near-optimal join order without using an exhaustive search. An exhaustive, deterministic search of a subset of the search space has a non-zero probability of finding only a local minimum in execution time. I'm not sure what you mean. By an

Re: [HACKERS] UTF8 or Unicode

2005-02-22 Thread Tatsuo Ishii
I do not object the changing UNICODE-UTF-8, but all these discussions sound a little bit funny to me. If you want to blame UNICODE, you should blame LATIN1 etc. as well. LATIN1(ISO-8859-1) is actually a character set name, not an encoding name. ISO-8859-1 can be encoded in 8-bit single byte

Re: [HACKERS] left-deep plans?

2005-02-22 Thread Kenneth Marshall
On Tue, Feb 22, 2005 at 05:40:40PM +1100, Neil Conway wrote: Tom Lane wrote: Yes, and it's been rejected. The notion is obviously bogus; it amounts to assuming that every database is a star schema with only one core table. Interesting; yes, I suppose that's true. Once we get into GEQO

[HACKERS] Postgres on VXworks+SH4

2005-02-22 Thread anupam.chaudhury
Hi! Im considering the possibility of using postgres in embededded environment with VxWorks (RTOS) Hitachi SH4 processor. Can anyone tell me if using postgres on such a platform is possible? You may provide me some reference links for further information too. Thanks in advance.

Re: [HACKERS] [PATCHES] [pgsql-hackers-win32] Repleacement for src/port/snprintf.c

2005-02-22 Thread Kurt Roeckx
On Mon, Feb 21, 2005 at 10:53:08PM -0500, Bruce Momjian wrote: Applied. The configure test is a little broken. It needs to quote the $'s. I've rewritten the test a little. Kurt Index: config/c-library.m4 === RCS file:

[HACKERS] Cannot link to postgres 8.0.0 databases using ODBC from Access

2005-02-22 Thread laurie . burrow
I have cross posted this issue here following suggestion on the pg_odbc list I'd try turning off log_discconnections, and see if you get any joy. If that works and the log still displays problems related to BackendRun, I'd email the pg-hackers list. We have an Access 97 database front end

Re: [HACKERS] [NOVICE] Question on TRUNCATE privleges

2005-02-22 Thread A.M.
The author doesn't mention why he got a 600x increase- perhaps he bypassed the delete triggers which was OK for his situation. I don't like the notion that an optimization requires additional privileges...why not detect an unqualified delete and call truncate instead IFF there are no delete