Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Peter Eisentraut
Tom Lane wrote: Why not enums? ;-) Well, macros is how we do it elsewhere for char system columns. I'm not sure we could rely on the behavior if we declared pg_type.typtype as an enum type ... and if we don't, there's not much point. I was thinking C enums: enum typtype_type {

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: Tom Lane wrote: I'm not sure we could rely on the behavior if we declared pg_type.typtype as an enum type ... and if we don't, there's not much point. I was thinking C enums: enum typtype_type { TYPTYPE_BASE = 'b', TYPTYPE_COMPOSITE

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Peter Eisentraut
Tom Lane wrote: What bothers me about that is I don't think the C spec mandates the representation width. If we could guarantee that enum typtype_type was 1 byte I'd be all for it. The width is 4 both for the macro and the enum case. Both #define TYPTYPE_BASE 'b' and enum ... {

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Gregory Stark
Peter Eisentraut [EMAIL PROTECTED] writes: Tom Lane wrote: What bothers me about that is I don't think the C spec mandates the representation width. If we could guarantee that enum typtype_type was 1 byte I'd be all for it. The width is 4 both for the macro and the enum case. Both

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Peter Eisentraut
Gregory Stark wrote: The width is 4 both for the macro and the enum case.  Both #define TYPTYPE_BASE 'b' and enum ... {   TYPTYPE_BASE = 'b', effectively generate int constants named TYPTYPE_BASE with decimal value 98.  So there are no storage advantages either way.

Re: [HACKERS] Bug in UTF8-Validation Code?

2007-04-01 Thread Martijn van Oosterhout
On Sat, Mar 31, 2007 at 07:47:21PM -0700, Mark Dilger wrote: OK, I can take a stab at fixing this. I'd like to state some assumptions so people can comment and reply: I assume that I need to fix *all* cases where invalid byte encodings get into the database through functions shipped in

Re: [HACKERS] Last minute mini-proposal (I know, Iknow)forPQexecf()

2007-04-01 Thread korryd
I don't necessarily object to PQexecf() as a shortcut for some multi-step operation, but I don't think you've got the format string semantics down yet. I'm thinking that we could start with the standard conversion specifiers - those are well understood and would be expected by just about any

Re: [HACKERS] Column storage positions

2007-04-01 Thread Guillaume Smet
On 2/20/07, Phil Currier [EMAIL PROTECTED] wrote: Inspired by this thread [1], and in particular by the idea of storing three numbers (permanent ID, on-disk storage position, display position) for each column, I spent a little time messing around with a prototype implementation of column storage

Re: [HACKERS] Bug in UTF8-Validation Code?

2007-04-01 Thread Andrew - Supernews
On 2007-04-01, Mark Dilger [EMAIL PROTECTED] wrote: Do any of the string functions (see http://www.postgresql.org/docs/8.2/interactive/functions-string.html) run the risk of generating invalid utf8 encoded strings? Do I need to add checks? Are there known bugs with these functions in this

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: We could use enum {} to define the labels and then make a rule that all actual variables should be declared using char rather than declaring them as enum typtype. But I fear somebody would get that wrong some day. Yeah, that seems to me to be just

Re: [HACKERS] Last minute mini-proposal (I know, Iknow)forPQexecf()

2007-04-01 Thread Tom Lane
[EMAIL PROTECTED] writes: I don't necessarily object to PQexecf() as a shortcut for some multi-step operation, but I don't think you've got the format string semantics down yet. I'm thinking that we could start with the standard conversion specifiers - those are well understood and would be

Re: [HACKERS] Oracle indemnifies PostgreSQL on its patents

2007-04-01 Thread Jeroen T. Vermeulen
On Sun, April 1, 2007 01:32, Tom Lane wrote: The idea of OIN is to have a large patent pool that can be counter-asserted against anyone who doesn't want to play nice. Mutual assured destruction in the patent sphere, if you will. And from the participants' point of view, I suppose the big

Re: [HACKERS] Last minute mini-proposal (I know, Iknow)forPQexecf()

2007-04-01 Thread korryd
That's exactly the approach I don't want to take. To implement our quoting-escape additions, we'll have to stop relying on sprintf and implement for ourselves whatever standard C escapes we want to support. Ok - then it seems like it might make sense to implement PQexecf() in terms of

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Peter Eisentraut
Tom Lane wrote: It seems clear to me that this authorizes, but *does not require*, the compiler to store an enum field in a byte or short instead of an int when all the declared values will fit.  So if we tried to do this, we'd have the problem of needing compiler-specific data type

Re: [HACKERS] Bug in UTF8-Validation Code?

2007-04-01 Thread Mark Dilger
Martijn van Oosterhout wrote: There's also the performance angle. The current mbverify is very inefficient for encodings like UTF-8. You might need to refactor a bit there... There appears to be a lot of function call overhead in the current implementation. In pg_verify_mbstr, the function

[HACKERS] Implicit casts to text

2007-04-01 Thread Peter Eisentraut
The attached patch changes all implicit casts to text to assignment and cleans up the associated regression test damage. This change has been discussed for the longest time; I propose that we bite the bullet and do it now. The issue described in

Re: [PATCHES] [HACKERS] Full page writes improvement, code update

2007-04-01 Thread Koichi Suzuki
Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: Any page written during a backup has a backup block that would not be removable by Koichi's tool, so yes, you'd still be safe. How does it know not to do that? regards, tom lane ---(end

Re: [HACKERS] Column storage positions

2007-04-01 Thread Phil Currier
On 4/1/07, Guillaume Smet [EMAIL PROTECTED] wrote: Phil, did you make any progress with your patch? Your results seemed very encouraging and your implementation interesting. IIRC, the problem was that you weren't interested in working on the visual/mysqlish column ordering. As the plan was to

Re: [HACKERS] Column storage positions

2007-04-01 Thread Andrew Dunstan
Phil Currier wrote: I haven't done much with it since February, largely because my available free time evaporated. But I do intend to get back to it when I have a chance. But you're right, the storage position stuff I've worked on is completely independent from display positions, and certainly

Re: Macros for typtype (was Re: [HACKERS] Arrays of Complex Types)

2007-04-01 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: Tom Lane wrote: It seems clear to me that this authorizes, but *does not require*, the compiler to store an enum field in a byte or short instead of an int when all the declared values will fit. FWIW, I never meant to suggest using enums tuple

Re: [HACKERS] Bug in UTF8-Validation Code?

2007-04-01 Thread Tom Lane
Mark Dilger [EMAIL PROTECTED] writes: Refactoring the way these table driven functions work would impact lots of other code. Just grep for all files #including mb/pg_wchar.h for the list of them. The list includes interfaces/libpq, and I'm wondering if software that links against postgres

Re: [HACKERS] Bug in UTF8-Validation Code?

2007-04-01 Thread Tatsuo Ishii
Mark Dilger [EMAIL PROTECTED] writes: Refactoring the way these table driven functions work would impact lots of other code. Just grep for all files #including mb/pg_wchar.h for the list of them. The list includes interfaces/libpq, and I'm wondering if software that links against

Re: [HACKERS] Bug in UTF8-Validation Code?

2007-04-01 Thread Tom Lane
Tatsuo Ishii [EMAIL PROTECTED] writes: No, we've never exported those with the intent that client code should use 'em. I thought PQescapeString() of 8.3 uses mbverify functions to make sure that user supplied multibyte string is valid. Certainly --- but we can change PQescapeString to match