Re: [SQL] Date format issue

2004-03-18 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes:
> You didn't say what version you're using, but IIRC, there was a bug which
> caused the above sort of behavior.  I think it was fixed in 7.4 and could
> be fixed in 7.3.x with a catalog change which you might be able to find in
> the archives.

Good memory!  Here's the CVS log entry:

2003-03-13 23:44  tgl

* src/include/catalog/pg_proc.h (REL7_3_STABLE): Repair incorrect
prorettype entry for timestamptz_izone.  Can't force initdb in the
7.3 branch, but we can at least make it right for people who
install 7.3.3 from scratch.

It looks like
UPDATE pg_proc SET prorettype = 1114 WHERE oid = 1026;
would fix it, but I counsel testing that in a scratch database ...

regards, tom lane

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [SQL] perfomance question

2004-03-18 Thread Josh Berkus
Sad,

> what are perfomance difference bitween
> a)  update t1 set f1 = 'x', f2 = 'y';
> b)  update t1 set f1 = 'x', f2 = f2;
> c)  update t1 set f1 = 'x';
> ?

Not a lot.  Why don't you try it?

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco


---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [SQL] perfomance question

2004-03-18 Thread sad
On Thursday 18 March 2004 21:38, you wrote:
> Sad,
>
> > what are perfomance difference bitween
> > a)  update t1 set f1 = 'x', f2 = 'y';
> > b)  update t1 set f1 = 'x', f2 = f2;
> > c)  update t1 set f1 = 'x';
> > ?
>
> Not a lot.  Why don't you try it?

Really ! why ? :-)

I forgot to ask the second question:
How these updates affect a data storage ?
(does (b) cause physical update of f2 ?)



---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [SQL] perfomance question

2004-03-18 Thread Adam Ruth
On Mar 18, 2004, at 11:27 PM, sad wrote:

On Thursday 18 March 2004 21:38, you wrote:
Sad,

what are perfomance difference bitween
a)  update t1 set f1 = 'x', f2 = 'y';
b)  update t1 set f1 = 'x', f2 = f2;
c)  update t1 set f1 = 'x';
?
Not a lot.  Why don't you try it?
Really ! why ? :-)

I forgot to ask the second question:
How these updates affect a data storage ?
(does (b) cause physical update of f2 ?)
Updates always apply to full rows at a time.  So while "update t1 set 
f1 = 'x'" only changes the value of f1 to 'x', f2 will have a second 
copy with the same value in the new row that is created as part of the 
update.  It's all part of the MVCC architecture.  There may be some 
uncommon exceptions to this rule, but I'm not sure.

Adam Ruth



---(end of 
broadcast)---
TIP 7: don't forget to increase your free space map settings



---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match