Re: [HACKERS] forcing returned values to be binary

2005-11-13 Thread Tom Lane
Dave Cramer <[EMAIL PROTECTED]> writes: > I was thinking that it may be necessary to issue a describe before > the execute, but I'm thinking now that the driver can only handle > specific types, so anything outside of what it knows about would be > an error anyway. > I gather it's not possib

Re: [HACKERS] forcing returned values to be binary

2005-11-13 Thread Dave Cramer
Yeah, I finally read it through and found it. There's some anecdotal evidence of up to 2x performance, so I'm interested in how to implement this in the jdbc driver. ( I'm a little skeptical about 2x) I was thinking that it may be necessary to issue a describe before the execute, but I'm

Re: [HACKERS] forcing returned values to be binary

2005-11-13 Thread Tom Lane
Dave Cramer <[EMAIL PROTECTED]> writes: > Is there a way to force select * from foo to use binary values ? In what context? There is a provision for that in the V3 extended-query protocol. regards, tom lane ---(end of broadcast)---

Re: [HACKERS] syntax for drop if exists

2005-11-13 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > The MySQL syntax is actually "drop table if exists foo ...". > Implementing this unfortunately generates a shift/reduce conflict, What did you try exactly? I don't see any fundamental reason for a conflict here. You may just need to rearrange the gr

Re: [HACKERS] MERGE vs REPLACE

2005-11-13 Thread Martijn van Oosterhout
On Sun, Nov 13, 2005 at 11:32:47PM +0100, Petr Jelinek wrote: > I am really not db expert and I don't have copy of sql standard but you > don't need to use 2 tables I think - USING part can also be subquery > (some SELECT) and if I am right then you could simulate what REPLACE > does because in

Re: [HACKERS] MERGE vs REPLACE

2005-11-13 Thread Petr Jelinek
Peter Eisentraut wrote: In that regard, MERGE is quite flexible, but MERGE doesn't address the point of REPLACE, because MERGE requires *two* tables as input, whereas REPLACE only takes *one*. Unless someone can show that you can trick MERGE into doing the REPLACE job anyway, we're not discu

Re: [HACKERS] SIGSEGV taken on 8.1 during dump/reload

2005-11-13 Thread Kevin Brown
Martijn van Oosterhout wrote: > None of this applies to PostgreSQL because we open the modules > directly, and don't rely on the linker loader. Ah, right. I forgot the context was the server, not one of the utilities... Sorry for the waste of bandwidth... -- Kevin Brown

[HACKERS] forcing returned values to be binary

2005-11-13 Thread Dave Cramer
Is there a way to force select * from foo to use binary values ? Dave ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [HACKERS] Supporting NULL elements in arrays

2005-11-13 Thread Tom Lane
I wrote: > ... Now, when the bitmap is present, it would be fairly tedious > to calculate the length of the bitmap to determine the offset to the > actual data; and that's an operation that we'd like to be cheap. What > I'm thinking of doing is commandeering the whole "flags" field of > ArrayType

Re: [HACKERS] MERGE vs REPLACE

2005-11-13 Thread Peter Eisentraut
Tom Lane wrote: > IIRC, SQL's MERGE deals with this by offering two quite separate > specifications of what to do when there is or isn't already a > matching row. In that regard, MERGE is quite flexible, but MERGE doesn't address the point of REPLACE, because MERGE requires *two* tables as input,

Re: [HACKERS] 8.1 substring bug?

2005-11-13 Thread Tom Lane
I wrote: > Martijn van Oosterhout writes: >> In this particular case the syntax makes it unclear that the substring >> is the problem. Perhaps here the solution would be to put a cast in the >> grammer, like so: > ... > But I think we could do this in substr_list in the case where we have > just "

Re: [HACKERS] [JDBC] prepareThreshold=1 and statement.executeBatch() ??

2005-11-13 Thread Kris Jurka
On Sun, 13 Nov 2005, Joost Kraaijeveld wrote: You have tested this with an insert statement. Could you do that also for an update (or try to tell me how I can do that)? I am getting very strange differences in running time between inserts and update ( 26 inserts are measured in seconds,

Re: [HACKERS] MERGE vs REPLACE

2005-11-13 Thread Joshua D. Drake
Petr Jelinek wrote: Tom Lane wrote: It'd be useful to look at what comparable functionality is offered by other DBs besides MySQL. Anyone know what DB2 or Oracle have in this area? Oracle: http://www.psoug.org/reference/merge.html http://www.psoug.org/reference/translate_replace.html But

Re: [HACKERS] MERGE vs REPLACE

2005-11-13 Thread Petr Jelinek
Tom Lane wrote: It'd be useful to look at what comparable functionality is offered by other DBs besides MySQL. Anyone know what DB2 or Oracle have in this area? IIRC they both have MERGE. -- Regards Petr Jelinek (PJMODOS) ---(end of broadcast)--

[HACKERS] syntax for drop if exists

2005-11-13 Thread Andrew Dunstan
I was just looking briefly at doing "drop if exists" as we discussed recently. The MySQL syntax is actually "drop table if exists foo ...". Implementing this unfortunately generates a shift/reduce conflict, unless I put IF in the func_name_keyword list, which strikes me as a bad idea. Alt

Re: [HACKERS] MERGE vs REPLACE

2005-11-13 Thread Tom Lane
Robert Treat <[EMAIL PROTECTED]> writes: > I disagree in that REPLACE is advertised as a solution for the INSERT else > UPDATE problem, but has a different behavior than a true INSERT else UPDATE > would produce. Maybe that's a problem with the implementation, or maybe > it's a problem in the

Re: [HACKERS] MERGE vs REPLACE

2005-11-13 Thread Robert Treat
On Sunday 13 November 2005 10:01, Gregory Maxwell wrote: > On 11/13/05, Robert Treat <[EMAIL PROTECTED]> wrote: > > On Saturday 12 November 2005 04:06, Matteo Beccati wrote: > > > | 1 |1 | NULL | > > > > Wow, that seems ugly maybe there's a reason for it, but I'm not sure > > we could devia

Re: [HACKERS] [JDBC] prepareThreshold=1 and statement.executeBatch() ??

2005-11-13 Thread Oliver Jowett
On Sun, 13 Nov 2005, Joost Kraaijeveld wrote: I have a connection that is created with "prepareThreshold=1" in the connection string. I use a prepared statement that I fill with addbatch() and that I execute with executeBatch() (for full source: see "application.java" attachment). LOG: stateme

[HACKERS] REPLACE implementation (was: Re: MERGE vs REPLACE)

2005-11-13 Thread Jaime Casanova
On 11/12/05, Matteo Beccati <[EMAIL PROTECTED]> wrote: > Tom Lane wrote: > > Peter Eisentraut <[EMAIL PROTECTED]> writes: > >> It seems to me that it has always been implicitly assumed around here > >> that the MERGE command would be a substitute for a MySQL-like REPLACE > >> functionality. After

Re: [HACKERS] Supporting NULL elements in arrays

2005-11-13 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > Jim C. Nasby wrote: >> Instead of bending over backwards to try and support older cases, would >> a compatability mode be possible? Seems that would solve a lot of >> problems. > Last time I thought about this problem, that's what I concluded. I don't > th

Re: [HACKERS] Multi-table-unique-constraint

2005-11-13 Thread Andrew Dunstan
Tom Lane wrote: Matt Newell <[EMAIL PROTECTED]> writes: BTW, i'm on the list now, so no need to cc me. Common practice around here is to cc people anyway --- this has grown out of a history of occasionally-slow list mail delivery. If you don't want it, best to fix it in your mail f

Re: [HACKERS] [JDBC] prepareThreshold=1 and statement.executeBatch() ??

2005-11-13 Thread Tom Lane
Oliver Jowett <[EMAIL PROTECTED]> writes: > The driver does not actually issue PREPARE or EXECUTE statements; the > server is pretending that the protocol-level Prepare/Bind/Execute > messages are actually something issuing PREPARE/EXECUTE at the SQL level I had not realized that the logging co

Re: [HACKERS] Multi-table-unique-constraint

2005-11-13 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: > Maybe the solution is to make inherited tables actually the same table, > and jank it with an extra per-row attribute to differentiate them or > something :) Aside from destroying the inheritance-for-partitioning stuff, this wouldn't work for

Re: [HACKERS] SIGSEGV taken on 8.1 during dump/reload

2005-11-13 Thread Martijn van Oosterhout
On Sat, Nov 12, 2005 at 10:46:33PM -0800, Kevin Brown wrote: > Hmm...but isn't the version number also something that can be stored > in the shared library itself during link time (e.g., via the -soname > option to the linker)? The manpage for ld under Linux implies that > this will cause the exec

Re: [HACKERS] MERGE vs REPLACE

2005-11-13 Thread Gregory Maxwell
On 11/13/05, Robert Treat <[EMAIL PROTECTED]> wrote: > On Saturday 12 November 2005 04:06, Matteo Beccati wrote: > > | 1 |1 | NULL | > Wow, that seems ugly maybe there's a reason for it, but I'm not sure we > could deviate from my$ql's behavior on this even if we wanted... they are the > "s

Re: [HACKERS] MERGE vs REPLACE

2005-11-13 Thread Robert Treat
On Saturday 12 November 2005 04:06, Matteo Beccati wrote: > Tom Lane wrote: > > Peter Eisentraut <[EMAIL PROTECTED]> writes: > >> It seems to me that it has always been implicitly assumed around here > >> that the MERGE command would be a substitute for a MySQL-like REPLACE > >> functionality. Aft

Re: [HACKERS] [JDBC] prepareThreshold=1 and statement.executeBatch() ??

2005-11-13 Thread Joost Kraaijeveld
Hi Kris, You have tested this with an insert statement. Could you do that also for an update (or try to tell me how I can do that)? I am getting very strange differences in running time between inserts and update ( 26 inserts are measured in seconds, 26 updates over 1 column in the same

Re: [HACKERS] [JDBC] prepareThreshold=1 and statement.executeBatch() ??

2005-11-13 Thread Kris Jurka
On Sun, 13 Nov 2005, Joost Kraaijeveld wrote: I have a connection that is created with "prepareThreshold=1" in the connection string. I use a prepared statement that I fill with addbatch() and that I execute with executeBatch() (for full source: see "application.java" attachment). LOG: state