[HACKERS] Signature change for SPI_cursor_open

2004-10-30 Thread Thomas Hallgren
Apparently the signature for function SPI_cursor_open got an additional "read_only" parameter starting with 8.0.0beta3. The documentation states that this flag should be "true for read-only execution". I can't see any mention of this on the hackers list nor in the change logs. Is it correct to a

Re: [PATCHES] [HACKERS] ARC Memory Usage analysis

2004-10-30 Thread Jan Wieck
On 10/26/2004 1:53 AM, Tom Lane wrote: Greg Stark <[EMAIL PROTECTED]> writes: Tom Lane <[EMAIL PROTECTED]> writes: Another issue is what we do with the effective_cache_size value once we have a number we trust. We can't readily change the size of the ARC lists on the fly. Huh? I thought effective

Re: [PATCHES] [HACKERS] ARC Memory Usage analysis

2004-10-30 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > On 10/26/2004 1:53 AM, Tom Lane wrote: >> Greg Stark <[EMAIL PROTECTED]> writes: > Tom Lane <[EMAIL PROTECTED]> writes: >>> Another issue is what we do with the effective_cache_size value once we >>> have a number we trust. We can't readily change the size o

Re: [HACKERS] Signature change for SPI_cursor_open

2004-10-30 Thread Tom Lane
Thomas Hallgren <[EMAIL PROTECTED]> writes: > Apparently the signature for function SPI_cursor_open got an additional > "read_only" parameter starting with 8.0.0beta3. The documentation states > that this flag should be "true for read-only execution". > Is it correct to assume that this flag imp

[HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Dennis Bjorklund
I have a long term plan to implement charset support in pg and now when I have dropped the work on the timestamps, I've been looking into this subject. Today we store the max length of a string in the typmod field, but that has to be extended so we also store the charset and the collation of the s

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Tom Lane
Dennis Bjorklund <[EMAIL PROTECTED]> writes: > Today we store the max length of a string in the typmod field, but that > has to be extended so we also store the charset and the collation of the > string. Why would we not keep this information right in the string values? > [ unworkable proposal sn

Re: [HACKERS] psql and schemas

2004-10-30 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > psql's slash commands for schemas seem a little weird to me. The behaviors you mention were written at different times by different people, and mostly have nothing to do with schemas per se. I agree that some more consistency would probably be good. Do y

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Dennis Bjorklund
On Sat, 30 Oct 2004, Tom Lane wrote: > Why would we not keep this information right in the string values? We could, but then we would need to parse it every time. Storing it in a structured way seems like the database solution and at least as a user from the client side it makes sense. Are you

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Tom Lane
Dennis Bjorklund <[EMAIL PROTECTED]> writes: > On Sat, 30 Oct 2004, Tom Lane wrote: >> Why would we not keep this information right in the string values? > We could, but then we would need to parse it every time. Huh? We'd store it in the most compact pre-parsed form we could think of; probably

Re: [HACKERS] 8.0b4: COMMIT outside of a transaction echoes ROLLBACK

2004-10-30 Thread Alvaro Herrera
On Wed, Oct 27, 2004 at 09:29:21PM -0400, Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > On Wed, Oct 27, 2004 at 04:21:53PM -0400, Tom Lane wrote: > >> On the other hand, it's also a pretty minor issue, and if it turns out > >> to require a lot of code rejiggering to make it do th

Re: [HACKERS] Signature change for SPI_cursor_open

2004-10-30 Thread Thomas Hallgren
Tom Lane wrote: > You should set the flag if and only if you are executing a pl/java > function that has a provolatile setting of "stable" or "immutable". > The new rule is that only functions declared "volatile" are allowed > to have side effects on the database. See pghackers discussions in > ea

Re: [HACKERS] Signature change for SPI_cursor_open

2004-10-30 Thread Tom Lane
Thomas Hallgren <[EMAIL PROTECTED]> writes: > Ok, now I understand. Thanks for the explanation. I guess that if > read_only is set to true and an attempt is made to execute a plan that > has side effect, that will cause an ERROR? Right, it'll bounce anything except a SELECT query. (This test is

[HACKERS] array_to_column function

2004-10-30 Thread David Fetter
Kind people, Here's something I came up with, having accidentally discovered the ARRAY() constructor (BTW, I think at least some pointer to it should be in the array section of functions & operators). CREATE OR REPLACE FUNCTION array_to_column (ANYARRAY) RETURNS SETOF ANYELEMENT IMMUTABLE LANGUAG

[HACKERS] Problems using pgxs on Win32

2004-10-30 Thread Thomas Hallgren
I'm trying to change the Makefile system for PL/Java so that it uses PGXS instead of compiling using a complete PostgreSQL source tree. As it turns out, the directory "include/port/win32" is not present in the PostgreSQL binary installation. Without it, it's not possible to compile on win32. D

Re: [HACKERS] 8.0b4: COMMIT outside of a transaction echoes ROLLBACK

2004-10-30 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > On Wed, Oct 27, 2004 at 09:29:21PM -0400, Tom Lane wrote: >> Wouldn't it be better to just stay in TBLOCK_STARTED state, as if the >> COMMIT were just some random utility command? > It's the same thing, because CommitTransactionCommand acts identically

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Dennis Bjorklund
On Sat, 30 Oct 2004, Tom Lane wrote: > > Are you worried about performance or is it the smaller change that you > > want? > > I'm worried about the fact that instead of, say, one length(text) > function, we would now have to have a different one for every > characterset/collation. This is not ab

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Tom Lane
Dennis Bjorklund <[EMAIL PROTECTED]> writes: > On Sat, 30 Oct 2004, Tom Lane wrote: >> I'm worried about the fact that instead of, say, one length(text) >> function, we would now have to have a different one for every >> characterset/collation. > For some functions one really want different ones d

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Dennis Bjorklund
On Sat, 30 Oct 2004, Tom Lane wrote: > > The alternative is storing the charset and collation inside each string. > > That seems like a too big price to pay, it belong in the type. > > No, the alternative you're proposing is too big a price to pay. So you want to expand every string with 8 byt

Re: [HACKERS] array_to_column function

2004-10-30 Thread Markus Bertheau
Ð ÐÐÑ, 30.10.2004, Ð 21:54, David Fetter ÐÐÑÐÑ: > Kind people, > CREATE OR REPLACE FUNCTION array_to_column (ANYARRAY) You want to see that function distributed with PostgreSQL? It would probably have to be implemented in C then, because PL/pgSQL-support has to be explicitly "enabled" for every d

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Tatsuo Ishii
> On Sat, 30 Oct 2004, Tom Lane wrote: > > > > The alternative is storing the charset and collation inside each string. > > > That seems like a too big price to pay, it belong in the type. > > > > No, the alternative you're proposing is too big a price to pay. > > So you want to expand every s

[HACKERS] not null partial index?

2004-10-30 Thread Tatsuo Ishii
It seems partial indexes with not null condition do not work: I did some testings with pgbench database and I observe: 1) statistics information is slghtly incorrect 2) partial index is not used Am I missing something? -- Tatsuo Ishii $ psql test Welcome to psql 7.4.6, the PostgreSQL interactiv

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Dennis Bjorklund
On Sun, 31 Oct 2004, Tatsuo Ishii wrote: > > So you want to expand every string with 8 bytes (two oid's)? > > For me that seems to be the right way. I'm not sure if two oids are > the right solution but we need to store extra info in varlena > structure to support charset/collation anyway. In my

Re: [HACKERS] not null partial index?

2004-10-30 Thread Tom Lane
Tatsuo Ishii <[EMAIL PROTECTED]> writes: > It seems partial indexes with not null condition do not work: What you created wasn't a partial index, it was a functional index. Try something like create index nonnullindex on accounts(bid) where bid is not null; regards

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Tatsuo Ishii
> > For me that seems to be the right way. I'm not sure if two oids are > > the right solution but we need to store extra info in varlena > > structure to support charset/collation anyway. In my understanding > > TOAST has already done in similar way. > > > > Other than charset/collation we also n

Re: [HACKERS] not null partial index?

2004-10-30 Thread Tatsuo Ishii
> Tatsuo Ishii <[EMAIL PROTECTED]> writes: > > It seems partial indexes with not null condition do not work: > > What you created wasn't a partial index, it was a functional index. > Try something like > create index nonnullindex on accounts(bid) where bid is not null; Sorry for the confusi

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Dennis Bjorklund
On Sun, 31 Oct 2004, Tatsuo Ishii wrote: > > and now we could add functions that work with this charset > > > > CREATE FUNCTION bar (x VARCHAR(255) CHARACTER SET foo) > > > > What we are saying is that we don't want to be able to do this? > > Not sure we want to add above. Is it somethin

Re: [HACKERS] not null partial index?

2004-10-30 Thread Tom Lane
Tatsuo Ishii <[EMAIL PROTECTED]> writes: > Sorry for the confusing and foolish question. However still I wonder > why my expression(functional) index does not work. You could likely have gotten it to match to a query like SELECT ... WHERE (bid is not null) = true; which would have the prop

Re: [HACKERS] Charset/collate support and function parameters

2004-10-30 Thread Tatsuo Ishii
> On Sun, 31 Oct 2004, Tatsuo Ishii wrote: > > > > and now we could add functions that work with this charset > > > > > > CREATE FUNCTION bar (x VARCHAR(255) CHARACTER SET foo) > > > > > > What we are saying is that we don't want to be able to do this? > > > > Not sure we want to add abo