Re: [HACKERS] No merge sort?

2003-03-13 Thread Taral
On Thu, Mar 13, 2003 at 10:30:27PM -0500, Tom Lane wrote: > The idea is you look at the index to make a list of main-table tuple > positions you are interested in, which you represent compactly as a > compressed bitmap. (There is some finagling needed because PG actually > uses block/line number r

Re: [HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Tom Lane
"Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes: > Would it be possible to do a command line app? > > bash$ pg_error 1200D > Severity: ERROR > Message: Division by zero > Detail: > Hint: Modify statement to prevent zeros appearing in denominators. You're assuming that there's a one-to-one ma

Re: [HACKERS] No merge sort?

2003-03-13 Thread Tom Lane
Taral <[EMAIL PROTECTED]> writes: > On Thu, Mar 13, 2003 at 04:28:34PM -0500, Tom Lane wrote: >> Seems like a waste of effort to me. I find this example less than >> compelling --- the case that could be sped up is quite narrow, >> and the potential performance gain not all that large. (A sort >>

Re: [HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Christopher Kings-Lynne
> On Thu, 2003-03-13 at 21:16, Christopher Kings-Lynne wrote: > > Would it be possible to do a command line app? > > > > bash$ pg_error 1200D > > Severity: ERROR > > Message: Division by zero > > Detail: > > Hint: Modify statement to prevent zeros appearing in denominators. > > Is there any benefit

Re: [HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Neil Conway
On Thu, 2003-03-13 at 21:16, Christopher Kings-Lynne wrote: > Would it be possible to do a command line app? > > bash$ pg_error 1200D > Severity: ERROR > Message: Division by zero > Detail: > Hint: Modify statement to prevent zeros appearing in denominators. Is there any benefit to having this ov

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Bruce Momjian
Marc G. Fournier wrote: > On Tue, 11 Mar 2003, Bruce Momjian wrote: > > > Six months would be June 1 beta, so maybe that is still a good target. > > We released v7.3 just before Dec 1st, so six months is May 1st, not June > 1st ... Six months is June 1 --- December (1), January-May (5) == 6. --

Re: [HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Christopher Kings-Lynne
> Great work, Tom! > > While we're effectively changing every elog call site in the backend, > would it also be a good idea to adopt a standard for the format of error > messages? (e.g. capitalization, grammar, etc.) I 100% agree with this - a style guide! Chris ---(end

Re: [HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Christopher Kings-Lynne
> Comments? All the error stuff sounds really neat. I volunteer for doing lots of elog changes when the time comes. Would it be possible to do a command line app? bash$ pg_error 1200D Severity: ERROR Message: Division by zero Detail: Hint: Modify statement to prevent zeros appearing in denomina

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Christopher Kings-Lynne
> implode(text[], text) returns text - join array elements into a > string using given string delimiter > > I'm open to opinions on implode() -- I only picked implode() because > that's what it is called in PHP. Any suggestions? It's also called 'join' in PHP... Chris ---

Re: [HACKERS] No merge sort?

2003-03-13 Thread Taral
On Thu, Mar 13, 2003 at 04:28:34PM -0500, Tom Lane wrote: > Seems like a waste of effort to me. I find this example less than > compelling --- the case that could be sped up is quite narrow, > and the potential performance gain not all that large. (A sort > is a sort however you slice it, with O(

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Barry Lind
Tom Lane wrote: Barry Lind <[EMAIL PROTECTED]> writes: Tom Lane wrote: See binary cursors ... Generally that is not an option. It either requires users to code to postgresql specific sql syntax, or requires the driver to do it magically for them. Fair enough. I don't see anything much w

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Tom Lane
Hiroshi Inoue <[EMAIL PROTECTED]> writes: > Hmm as for PREPAREd statements, it seems much better to > implement functions which returns fields info for the > statement than relying on such a protocol level change. Well, we're changing the protocol anyway for other purposes, so the extra burden of

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Greg Stark
Joe Conway <[EMAIL PROTECTED]> writes: > I'm leaning toward implode() and explode() now anyway because split() uses a > regex for the delimiter in PHP (and probably Perl), and I was not planning to > get that fancy. PHP isn't exactly an exemplar for great language design. explode/implode are te

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Hiroshi Inoue
Tom Lane wrote: > > "Dave Page" <[EMAIL PROTECTED]> writes: > > It's rumoured that Hiroshi Inoue once said: > >> Does looking up by the catalog keys take no cost ? > > > Obviously there is cost, but doing a lookup only on demand, has got to be > > cheaper in the long run than

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Tom Lane
Barry Lind <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> See binary cursors ... > Generally that is not an option. It either requires users to code to > postgresql specific sql syntax, or requires the driver to do it > magically for them. Fair enough. I don't see anything much wrong with a

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Joe Conway
Tom Lane wrote: Joe Conway <[EMAIL PROTECTED]> writes: Hmmm -- I doubt that would fly, although I see it is specifically allowed as a function name (func_name_keyword list). Anyone have opinions on this either way? Good point --- it would work today, but any small tweak in the JOIN grammar might

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: >> In both Perl and Python, that type of function is called "join". > Hmmm -- I doubt that would fly, although I see it is specifically > allowed as a function name (func_name_keyword list). Anyone have > opinions on this either way? Good point --- it woul

Re: [HACKERS] [INTERFACES] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Tom Lane
Jean-Luc Lachance <[EMAIL PROTECTED]> writes: > Why trade 5 characters for a 4 byte integer -- a saving of 1 byte? It's more than that: in one case you have something on the order of a "load immediate" instruction, whereas in the other case the code is like "load pointer to global string", plus yo

Re: [HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > While we're effectively changing every elog call site in the backend, > would it also be a good idea to adopt a standard for the format of error > messages? (e.g. capitalization, grammar, etc.) Yup. I was planning to bring that up as a separate thread. I

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Hiroshi Inoue
> -Original Message- > From: Dave Page > > > -Original Message- > > From: Hiroshi Inoue [mailto:[EMAIL PROTECTED] > > Sent: 13 March 2003 10:04 > > To: Dave Page > > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; > > [EMAIL PROTECTED]; [EMAIL PROTECTED]; > > [EMAIL PROTECTED] > > Sub

Re: [HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Neil Conway
On Thu, 2003-03-13 at 15:51, Tom Lane wrote: > After digging through our many past discussions of what to do with error > messages, I have put together the following first-cut proposal. Great work, Tom! While we're effectively changing every elog call site in the backend, would it also be a good

Re: [HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Larry Rosenman
--On Thursday, March 13, 2003 16:20:21 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: Larry Rosenman <[EMAIL PROTECTED]> writes: __FUNCTION__ or an equivalent is MANDATED by C99, and available on UnixWare's native cc. You might want to make a configure test for it. Right, __func__ is the C99 spellin

Re: [HACKERS] No merge sort?

2003-03-13 Thread Tom Lane
Taral <[EMAIL PROTECTED]> writes: > Do I need to code merge sort into postgresql? Seems like a waste of effort to me. I find this example less than compelling --- the case that could be sped up is quite narrow, and the potential performance gain not all that large. (A sort is a sort however you

Re: [HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Tom Lane
Larry Rosenman <[EMAIL PROTECTED]> writes: > __FUNCTION__ or an equivalent is MANDATED by C99, and available on > UnixWare's native cc. > You might want to make a configure test for it. Right, __func__ is the C99 spelling. I did have a configure test in mind here: __func__ or __FUNCTION__ or NUL

Re: [HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Larry Rosenman
--On Thursday, March 13, 2003 15:51:00 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: (__FUNCTION__ is only used if we are compiling in gcc). errstart() pushes an empty entry onto an error-data-collection stack and fills in the behind-the-scenes file/line entries. errmsg() and friends stash value

[HACKERS] No merge sort?

2003-03-13 Thread Taral
I tried general, but no response. Anyone here can shed some light on the issue? Do I need to code merge sort into postgresql? - Forwarded message from Taral <[EMAIL PROTECTED]> - From: Taral <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: Wed, 12 Mar 2003 17:54:35 -0600 Subject: [GENERAL]

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Tom Lane
Hannu Krosing <[EMAIL PROTECTED]> writes: > Tom Lane kirjutas N, 13.03.2003 kell 19:12: >>> The standard spelling for that appears to be >>> somearray || ARRAY[element] >>> which also has the nice property that it is commutative. >> >> Sure ... but that just means that || is the operator name for

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Hannu Krosing
Tom Lane kirjutas N, 13.03.2003 kell 19:12: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > OK, let's look at these more closely: > > >> array_push(anyarray, anyelement) returns anyarray > > > The standard spelling for that appears to be > > somearray || ARRAY[element] > > which also has t

[HACKERS] Upgrading the backend's error-message infrastructure

2003-03-13 Thread Tom Lane
(Or, protocol upgrade phase 1...) After digging through our many past discussions of what to do with error messages, I have put together the following first-cut proposal. Fire at will... Objective - The basic objective here is to divide error reports into multiple fields, and in partic

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Barry Lind
Tom Lane wrote: Barry Lind <[EMAIL PROTECTED]> writes: AFAICS the only context where this could make sense is binary transmission of parameters for a previously-prepared statement. We do have all the pieces for that on the roadmap. Actually it is the select of binary data that I was refering to

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Andrew Dunstan
Couldn't it be done optionally, so the clients that want the info pay the price and those that don't want it get the speed and lower bandwidth? Just a thought andrew - Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> > "Zeugswetter Andreas SB SD" <[EMAIL PROTECTED]> writes: > > A

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Rod Taylor
On Thu, 2003-03-13 at 12:53, Joe Conway wrote: > Peter Eisentraut wrote: > array_pop(anyarray) returns anyelement > > > > That appears to mean that you return somearray[0] and alter the array > > as a side effect. How do you plan to do that? > > I'll give you this one -- doesn't make sense.

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Dave Page
> -Original Message- > From: Zeugswetter Andreas SB SD [mailto:[EMAIL PROTECTED] > Sent: 13 March 2003 17:07 > To: Hiroshi Inoue; Dave Page > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: RE: [HACKERS] Roadmap for FE/BE protocol redesign > > > If this where a

Re: [HACKERS] Problems with win32 patch/build

2003-03-13 Thread Merlin Moncure
> I am working my way through getting the postgres win32 port (7.2.1) > compiled under MSVC. I got through the patch and the compilation, but > am having problems with the linker. Trying to link the backend, I get > 43 linker errors like: > unresolved external symbol GUC-scanstr > unresolved exte

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Dave Page
> -Original Message- > From: Hiroshi Inoue [mailto:[EMAIL PROTECTED] > Sent: 13 March 2003 10:04 > To: Dave Page > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: Re: [HACKERS] Roadmap for FE/BE protocol redesign > > >

[HACKERS] Problems with win32 patch/build

2003-03-13 Thread Merlin Moncure
I am working my way through getting the postgres win32 port (7.2.1) compiled under MSVC. I got through the patch and the compilation, but am having problems with the linker. Trying to link the backend, I get 43 linker errors like: unresolved external symbol GUC-scanstr unresolved external symbol

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Joe Conway
Alvaro Herrera wrote: Yeah, and join is also consistent with the inverse function being called "split". IIRC the equivalent function in PHP is explode(). Actually it looks like PHP supports both explode() and split(), and their inverse functions implode() and join(). split() appears to split the

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Joe Conway
johnn wrote: On Thu, Mar 13, 2003 at 09:53:15AM -0800, Joe Conway wrote: implode(text[], text) returns text - join array elements into a string using given string delimiter In both Perl and Python, that type of function is called "join". Hmmm -- I doubt that would fly, although I see it is spec

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Alvaro Herrera
On Thu, Mar 13, 2003 at 12:00:46PM -0600, johnn wrote: > On Thu, Mar 13, 2003 at 09:53:15AM -0800, Joe Conway wrote: > > implode(text[], text) returns text - join array elements into a > > string using given string delimiter > > > > I'm open to opinions on implode() -- I only picked im

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread johnnnnnn
On Thu, Mar 13, 2003 at 09:53:15AM -0800, Joe Conway wrote: > implode(text[], text) returns text - join array elements into a > string using given string delimiter > > I'm open to opinions on implode() -- I only picked implode() because > that's what it is called in PHP. Any suggestions?

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Joe Conway
Peter Eisentraut wrote: array_pop(anyarray) returns anyelement That appears to mean that you return somearray[0] and alter the array as a side effect. How do you plan to do that? I'll give you this one -- doesn't make sense. split(text, text) returns text[] - split string into array on delimiter

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Tom Lane
Barry Lind <[EMAIL PROTECTED]> writes: >> AFAICS the only context where this could make sense is binary >> transmission of parameters for a previously-prepared statement. We do >> have all the pieces for that on the roadmap. >> > Actually it is the select of binary data that I was refering to. A

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Tom Lane
"Zeugswetter Andreas SB SD" <[EMAIL PROTECTED]> writes: > Also doesn't the planner/executor already have all needed info available ? Not directly, and not necessarily in the form that the client would want it in (eg, converting type OID to type name isn't free). I don't care to load either the ba

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > OK, let's look at these more closely: >> array_push(anyarray, anyelement) returns anyarray > The standard spelling for that appears to be > somearray || ARRAY[element] > which also has the nice property that it is commutative. Sure ... but that

Re: [HACKERS] [SQL] What's wrong with this group by clause?

2003-03-13 Thread Tom Lane
Manfred Koizar <[EMAIL PROTECTED]> writes: > ISTM you have found a Postgres 7.3 bug. Yeah. Actually, the planner bug has been there a long time, but it was only latent until the parser stopped suppressing duplicate GROUP BY items: 2002-08-18 14:46 tgl * src/backend/parser/parse_clause.

Re: [HACKERS] SQL99 ARRAY support proposal

2003-03-13 Thread Peter Eisentraut
OK, let's look at these more closely: > >> array_push(anyarray, anyelement) returns anyarray The standard spelling for that appears to be somearray || ARRAY[element] which also has the nice property that it is commutative. > >> array_pop(anyarray) returns anyelement That appears

Re: [HACKERS] [SQL] What's wrong with this group by clause?

2003-03-13 Thread Christoph Haller
> > On Tue, 4 Nov 2003 18:28:12 -0300, Franco Bruno Borghesi > <[EMAIL PROTECTED]> wrote: > >Below you can find a simplified example of a real case. > >I don't understand why I'm getting the "john" record twice. > > ISTM you have found a Postgres 7.3 bug. > > I get one john with > PostgreSQL 7.1.3

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Barry Lind
Tom Lane wrote: Barry Lind <[EMAIL PROTECTED]> writes: One addition I would personally like to see (it comes up in my apps code) is the ability to detect wheather the server is big endian or little endian. When using binary cursors this is necessary in order to read int data. Actually, my

Re: [HACKERS] Request for quote looking to pay for work

2003-03-13 Thread Dave Cramer
Thought I would change the title to see if anyone would respond? It wasn't clear but the intent was to support the following in the backend. On Tue, 2003-03-11 at 18:20, Dave Cramer wrote: > I have a customer porting an application from informix to postgres. They > require 2 things: > > 1) Curs

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Christof Petig
Barry Lind wrote: 3) Protocol level support for CURSORs. It would be nice if cursor support was done at the protocol level and not as a SQL command. I want to second this proposal. Currently I avoid using cursors in my programs since a) they need much more logic and _string_concatenation_ to be

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Barry Lind <[EMAIL PROTECTED]> writes: > > > 4) Protocol level support of PREPARE. In jdbc and most other > > interfaces, there is support for parameterized SQL. If you want to take > > advantage of the performance benefits of reusing parsed plans you h

Re: [HACKERS] [SQL] What's wrong with this group by clause?

2003-03-13 Thread Manfred Koizar
[forwarding to -hackers] On Tue, 4 Nov 2003 18:28:12 -0300, Franco Bruno Borghesi <[EMAIL PROTECTED]> wrote: >Below you can find a simplified example of a real case. >I don't understand why I'm getting the "john" record twice. ISTM you have found a Postgres 7.3 bug. I get one john with Postgr

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Hannu Krosing
Hiroshi Inoue kirjutas N, 13.03.2003 kell 12:03: > Dave Page wrote: > > > > > Does looking up by the catalog keys take no cost ? > > > > Obviously there is cost, but doing a lookup only on demand, has got to be > > cheaper in the long run than including the entire column definition in the > > mes

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Christopher Kings-Lynne
> > Obviously there is cost, but doing a lookup only on demand, has got to be > > cheaper in the long run than including the entire column definition in the > > message whether it's wanted or not? > > So if there are 100 fields, should we ask the backend > the column name 100 times ? No, you do a

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Hiroshi Inoue
Dave Page wrote: > > It's rumoured that Hiroshi Inoue once said: > > Tom Lane wrote: > >> > >> "Dave Page" <[EMAIL PROTECTED]> writes: > >> > No, but with them we can avoid cluttering the wire protocol with > >> > fields for all this, and the JDBC required data. With 2 numeric

Re: [HACKERS] Roadmap for FE/BE protocol redesign

2003-03-13 Thread Dave Page
It's rumoured that Hiroshi Inoue once said: > Tom Lane wrote: >> >> "Dave Page" <[EMAIL PROTECTED]> writes: >> > No, but with them we can avoid cluttering the wire protocol with >> > fields for all this, and the JDBC required data. With 2 numeric >> > columns (attrelid, attnum), any application/int

Re: [HACKERS] bug in setval?

2003-03-13 Thread Dave Page
It's rumoured that Christopher Kings-Lynne once said: > When I create a new table with a serial column, the first row defaults > to inserting '1'. > > If I delete all the rows from the table and want to reset the sequence, > I can't: > > ERROR: users_health_types_type_id_seq.setval: value 0 is out