473,508 Members | 2,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bug or Feature - plpgsql odity

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,

following odity:

I have a table "quote".
In a stored proc I do a

rquote quote%ROWTYPE;

SELECT INTO rquote * FROM quote WHERE .....(some clause resulting in one
record)

Fine so far.
Now I manually add a column to the table (via psql).

After that I do a vacuum full analyze - just to make sure.

BUT: The above SELECT fails to retrieve a value for the new column. It will
always return NULL, even after I stored the procedure again (using the create
or replace syntax). Values for all other columns are OK.

If I declare the rquote variable as type RECORD everything works as expected.

Is the %ROWTYPE" cached somewhere ? Is that intentional ?
Accessing rquote.newcolumn doesn't raise an exception, but the value is NULL

Running 7.3.2 on linux.

UC

- --
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/yrmrjqGXBvRToM4RAm1EAJoCQGXhYGhdAGexNX5QaHI8MtAGAA CgjWjC
3y04n9FTpEeX8FxEgkEU5Cw=
=okfE
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #1
3 1317
"Uwe C. Schroeder" <uw*@oss4u.com> writes:
Is the %ROWTYPE" cached somewhere ? Is that intentional ?


I see some fixes in the 7.4 CVS logs for dropped columns in plpgsql
rowtypes. Not sure if they'd have any impact on added columns, but
you could try. In general though I'd expect that plpgsql would cache
the definitions of rowtypes, the same as it does for tables.

regards, tom lane

---------------------------(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

Nov 12 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 30 November 2003 08:15 pm, Tom Lane wrote:
"Uwe C. Schroeder" <uw*@oss4u.com> writes:
Is the %ROWTYPE" cached somewhere ? Is that intentional ?


I see some fixes in the 7.4 CVS logs for dropped columns in plpgsql
rowtypes. Not sure if they'd have any impact on added columns, but
you could try. In general though I'd expect that plpgsql would cache
the definitions of rowtypes, the same as it does for tables.

regards, tom lane


So how would I force a reload of the cache ? I tried restarting postgres
alltogether, as well as recreating the procedure. Should I try a DROP and
CREATE cycle rather than a CREATE OR REPLACE ?
My understanding would be that the rowtype is compiled the moment the
procedure is created, so I'd expect a recreate of the procedure to take care
of the cache problem.

UC

- --
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/ysJjjqGXBvRToM4RAuq1AJ9LgkhYXEz19+0I8ou8/N7AeKPEgwCffzBT
XvJPiExWzZVyDAKjLUsbW4M=
=IQTs
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #3
"Uwe C. Schroeder" <uw*@oss4u.com> writes:
On Sunday 30 November 2003 08:15 pm, Tom Lane wrote:
I see some fixes in the 7.4 CVS logs for dropped columns in plpgsql
rowtypes. Not sure if they'd have any impact on added columns, but
you could try. In general though I'd expect that plpgsql would cache
the definitions of rowtypes, the same as it does for tables.
So how would I force a reload of the cache ?


Starting a fresh session would be sufficient. If 7.4 doesn't do what
you want after starting a fresh session, please file a bug report with
details.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4438
by: Mark Mikulec | last post by:
Hi there, I wonder if anyone can shed some light on a very frustrating problem. I'm running a debian linux 3.0 "woody" server, nothing special, with the latest version of postres that apt-get...
6
3957
by: Martin Marques | last post by:
We are trying to make some things work with plpgsql. The problem is that I built several functions that call one another, and I thought that the way of calling it was just making the assign: ...
1
2454
by: Rajesh Kumar Mallah | last post by:
Hi, profile_row profile_master%ROWTYPE; in a plpgsql function gives the error below tradein_clients=# SELECT general.create_accounts(); WARNING: plpgsql: ERROR during compile of...
17
3117
by: Chris Travers | last post by:
Hi all; I just made an interesting discovery. Not sure if it is a good thing or not, and using it certainly breakes first normal form.... Not even sure if it really works. However, as I am...
0
2660
by: Steve Wampler | last post by:
Hmmm, I've always used plpgsql.so (also formerly known as libplpgsql.so, I think...) as in: CREATE FUNCTION plpgsql_call_handler () RETURNS language_handler AS '/usr/lib/plpgsql.so',...
4
4936
by: Bill Moran | last post by:
I've got a bit of a strange problem that's causing me some MAJOR headaches. I'm developing the server-side of a large database application in PostgreSQL. This consists of a C daemon, and a LOT...
14
5761
by: Karl O. Pinc | last post by:
Hi, Thought perhaps some other eyes than mine can tell if I'm doing something wrong here or if there's a bug somewhere. I've never passed a ROWTYPE varaible to a function but I don't see where...
0
1451
by: sripathy sena | last post by:
Hi, I am trying to install OPenacs with postgres 7.4.3 as the database. The openacs requires plpgsql to be installed. When I try to do this by running "CREATELANG plpgsql template1". I get a...
1
2184
by: Karl O. Pinc | last post by:
FYI, mostly. But I do have questions as to how to write code that will continue to work in subsequent postgresql versions. See code below. begintest() uses EXIT to exit a BEGIN block from...
0
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.