Commit 86dc90056 - Rework planning and execution of UPDATE and DELETE - Mailing list pgsql-hackers

From Rushabh Lathia
Subject Commit 86dc90056 - Rework planning and execution of UPDATE and DELETE
Date
Msg-id CAGPqQf02w895YKz2a2qpfmgAp8PaGe=oRAJWMEYeoZzPh9shgA@mail.gmail.com
Whole thread Raw
Responses Re: Commit 86dc90056 - Rework planning and execution of UPDATE and DELETE  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Commit 86dc90056 - Rework planning and execution of UPDATE and DELETE  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-hackers
Hi.

With the commit mentioned in the $subject, I am seeing the
change in behaviour with the varlena header size.  Please
consider the below test:

postgres@83795=#CREATE TABLE test_storage_char(d char(20));
CREATE TABLE
postgres@83795=#INSERT INTO test_storage_char SELECT REPEAT('e', 20);
INSERT 0 1
postgres@83795=#SELECT d, pg_column_size(d) FROM test_storage_char;
          d           | pg_column_size
----------------------+----------------
 eeeeeeeeeeeeeeeeeeee |             21
(1 row)

postgres@83795=#ALTER TABLE test_storage_char ALTER COLUMN  d SET STORAGE PLAIN;
ALTER TABLE
postgres@83795=#SELECT d, pg_column_size(d) FROM test_storage_char;
          d           | pg_column_size
----------------------+----------------
 eeeeeeeeeeeeeeeeeeee |             21
(1 row)

postgres@83795=#UPDATE test_storage_char SET d='ab' WHERE d LIKE '%e%';
UPDATE 1
postgres@83795=#SELECT d, pg_column_size(d) FROM test_storage_char;
          d           | pg_column_size
----------------------+----------------
 ab                   |             24
(1 row)

After changing the STORAGE for the column and UPDATE, pg_column_size 
now returns the size as 24. 

BEFORE Commit 86dc90056:

postgres@129158=#SELECT d, pg_column_size(d) FROM test_storage_char;
          d           | pg_column_size
----------------------+----------------
 ab                   |             21
(1 row)

I am not sure whether this change is expected? Or missing something
in the toasting the attribute?


Thanks,
Rushabh Lathia

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Table refer leak in logical replication
Next
From: Tom Lane
Date:
Subject: Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb