On Mon, 2005-03-07 at 19:34 -0800, David Fetter wrote:
Although the SQL:2003 command MERGE has not yet been implemented in
PostgreSQL, I'm guessing that there are best practices for how to
implement the MERGE functionality.
To recap, MERGE means (roughly) INSERT the tuple if no tuple
On Tue, Mar 08, 2005 at 12:27:21PM +0800, Christopher Kings-Lynne wrote:
Luckily, PG 8 is available for this. Do you have a short example?
No, and I think it should be in the manual as an example.
You will need to enter a loop that uses exception handling to detect
unique_violation.
On Mon, 2005-03-07 at 20:50 -0500, Tom Lane wrote:
Simon Riggs [EMAIL PROTECTED] writes:
Well, we're using the CRC in 3 separate places...
(1) for xlog records
(2) for complete blocks copied to xlog
(3) for control files
For (1), records are so short that probably CRC16 would be
You can create a procedure to do that, but MERGE would work better.
ISTM that would require writing some new code that was a mix of
heap_update and heap_insert logic for the low level stuff would be
required. The existing heap_update code is most similar, since the logic
is roughly
UPDATE
Perhaps you should rebuild the backend with -g (see --enable-debug) so
that gdb can actually be somewhat helpful. It's usually a good idea to
have --enable-cassert turned on when hacking C code, too.
When I rebuilded the backend with --enable-debug and --enable-cassert
the database stops and
let me, i have turned enable_seqscan to off, in order to discourage
optimizer to choose seq_scan whenever an idex_scan can be used.
But in this case, why optimizer don't chooses seq_scan (discourage is
different than prevent) ?
At many cases i need only a small fragment of raws to be
Ioannis Theoharis wrote:
let me, i have turned enable_seqscan to off, in order to discourage
optimizer to choose seq_scan whenever an idex_scan can be used.
But in this case, why optimizer don't chooses seq_scan (discourage is
different than prevent) ?
You probably know that PostgreSQL uses a
Hi,
if you're using a pg version prio to 8.0 your pitfall might also be
a conversion between int and bigint datatypes.
So if you're doing somthing like
SELECT a.x, b.y, c.y FROM a, b WHERE a.x = b.x;
and a.x is INT4 and b.x is INT8 (or BIGINT) the planner counts this as
a data conversion and uses
[EMAIL PROTECTED] writes:
Perhaps you should rebuild the backend with -g (see --enable-debug) so
that gdb can actually be somewhat helpful. It's usually a good idea to
have --enable-cassert turned on when hacking C code, too.
When I rebuilded the backend with --enable-debug and
Hello all,
I have a table with a VARCHAR column that I need to convert to a BYTEA.
How do I cast VARCHAR to BYTEA?
The following doesn't seem to work as it yields the 'cannot cast varchar to
bytea' error message:
varchar_data::bytea
On the same topic, how do I do the reverse, that
Thank you, Tom.
Yes, the exact bytes in the varchar datum (without encoding) is what I would
like to become the bytes in the BYTEA.
So, how do I create a cast WITHOUT FUNCTION as you mention below? I assume
plpgsql is required, right?
Is there anyway this can be done in a VIEW without having
Hi there,
I just noticed a little optimizer problem - in second query there is
unused 'tycho t2' table alias which gets backend buried. This is
artificial query, I just tried to check if optimizier could recognize
this.
tycho=# explain analyze select t.pm_ra,t.pm_dec from tycho t where t.pm_ra
Oleg Bartunov wrote:
I just noticed a little optimizer problem - in second query there is
unused 'tycho t2' table alias which gets backend buried.
It's not an unused table alias, it is specifying the cartesian product
of `tycho' with itself. I don't see how this is an optimizer problem:
it's a
On Tue, Mar 08, 2005 at 02:16:52PM -0800, Moran.Michael wrote:
Yes, the exact bytes in the varchar datum (without encoding) is what I would
like to become the bytes in the BYTEA.
So, how do I create a cast WITHOUT FUNCTION as you mention below? I assume
plpgsql is required, right?
Did you
How do I cast VARCHAR to BYTEA?
I think it would work to create a cast WITHOUT FUNCTION, assuming that
the semantics you want is that the exact bytes in the varchar datum
become the bytes in the bytea (no encoding or backslashing conversions).
Are pg_escape_bytea and pg_unescape_bytea available
Robert Treat wrote:
On Thursday 03 March 2005 19:08, Neil Conway wrote:
Thomas F.O'Connell wrote:
committers, myself included, deserve some blame for not making more
rapid progress on the queue of unapplied patches for 8.1. In the
meanwhile, the queue should be easier for folks to find
Does the Intel compiler not support inline assembler?
_InterlockedExchange() is a function call and we prefer to have asm()
code if we can get it.
---
Vikram Kalsi wrote:
Just an update, the __INTEL_COMPILER is true on
Vikram Kalsi wrote:
The _InterlockedExchange() function is defined in ia64intrin.h header file
int _InterlockedExchange(volatile int *Target, long value)
Do an exchange operation atomically. Maps to the xchg4 instruction.
More information is available at
The Intel compiler complains about global variables that are not marked
either static or extern. They are remarks so I think you are OK with
that.
The attached patch should remove the warnings but I am not applying it
because a non-static/extern global variable should be fine in C code.
The
Here are two questions related to PG8.0.1:
1. durability of create tablespace - what happens if several checkpoints
done after create tablespace then system crashes - without redo, will the
PG_VERSION file and symlinks survive in win32? Seems checkpoint didn't sync
the content of PG_VERSION file.
Qingqing Zhou [EMAIL PROTECTED] writes:
Here are two questions related to PG8.0.1:
1. durability of create tablespace - what happens if several checkpoints
done after create tablespace then system crashes - without redo, will the
PG_VERSION file and symlinks survive in win32? Seems checkpoint
Bruce Momjian wrote:
The attached patch should remove the warnings but I am not applying it
because a non-static/extern global variable should be fine in C code.
What's the harm in applying it? Variables and functions not used outside
the compilation unit in which they are defined _should_ be
I was ignoring the warnings anyway.
I didn't look into that much but after upgrading to RHEL AS4, I am
able to compile successfully with --enable-thread-safety
Thanks,
On Tue, 8 Mar 2005 23:28:20 -0500 (EST), Bruce Momjian
pgman@candle.pha.pa.us wrote:
The Intel compiler complains about
Running latest cvs on freebsd gives me errors in test strings and test
errors, and completely hangs at this point:
parallel group (14 tests): limit prepare sequence copy2 truncate
rowtypes polymorphism temp domain conversion rangefuncs without_oid
alter_table
Chris
parallel group (13 tests):
There is no such thing as crash without redo: that is what WAL is all
about. The creation of the tablespace will be correctly replayed from
WAL. (Of course, this claim depends on various assumptions about
whether fsync behaves per spec ... but if it does not, tablespace
creation is hardly
Christopher Kings-Lynne [EMAIL PROTECTED] writes:
Running latest cvs on freebsd gives me errors in test strings and test
errors, and completely hangs at this point:
Time for a clean rebuild? I've not seen any failures, neither has
the build farm ...
regards, tom lane
Christopher Kings-Lynne [EMAIL PROTECTED]
Running latest cvs on freebsd gives me errors in test strings and test
errors, and completely hangs at this point:
I got a similar problem and system hangs randomly(esp. in test strings) in
win32-mingw. The problem I found is in pgunlink(). There is a
Time for a clean rebuild? I've not seen any failures, neither has
the build farm ...
cvs up
gmake clean
./configure --prefix=/home/chriskl/local --enable-depend --enable-debug
--enable-cassert --with-perl --with-pam --with-openssl
gmake check
Still hangs. Gets new failure in create function
On Wed, Mar 09, 2005 at 03:24:20PM +0800, Christopher Kings-Lynne wrote:
gmake clean
Have you tried gmake distclean?
I just built the latest HEAD on FreeBSD 4.11-STABLE and all tests
passed. Configure options were:
./configure --prefix=/usr/local/pgsql81 \
--with-pgport=5481 \
Have you tried gmake distclean?
I just built the latest HEAD on FreeBSD 4.11-STABLE and all tests
passed. Configure options were:
Hrm, I just did a gmake install; gmake installcheck - that worked fine.
Then I did gmake check again and now that works fine...
It must have been picking up
30 matches
Mail list logo