Thread: adsrc

adsrc

From
Matt Zagrabelny
Date:
Greetings Pg folk,

I've got a legacy app connecting to a legacy Pg database (9.4).

I'd like to upgrade the database to Pg 15, but when I connect and perform some tasks in the app, I get:

ERROR:  column d.adsrc does not exist at character 331

Some searching online yields that adsrc was removed in Pg 12.

Is there a way to recreate it?

Thanks for any help or answers.

Cheers,

-m


Re: adsrc

From
Christoph Moench-Tegeder
Date:
## Matt Zagrabelny (mzagrabe@d.umn.edu):

> I'd like to upgrade the database to Pg 15, but when I connect and perform
> some tasks in the app, I get:
> 
> ERROR:  column d.adsrc does not exist at character 331

That pg_attrdef.adsrc was already marked as "historical, and is best
not used" in 9.4: https://www.postgresql.org/docs/9.4/catalog-pg-attrdef.html
(In fact, that notice was added in 8.0).
The official way to get the human-readable representation of the
column's default value is "pg_get_expr(d.adbin, d.adrelid)" (use that
instead of d.adsrc) - that way the fix is rather straight-forward.
Documentation on pg_get_expr() is in this table:
https://www.postgresql.org/docs/15/functions-info.html#FUNCTIONS-INFO-CATALOG-TABLE

Regards,
Christoph

-- 
Spare Space



Re: adsrc

From
"David G. Johnston"
Date:
On Tue, Nov 5, 2024 at 2:45 PM Matt Zagrabelny <mzagrabe@d.umn.edu> wrote:
ERROR:  column d.adsrc does not exist at character 331

Some searching online yields that adsrc was removed in Pg 12.

Is there a way to recreate it?


That is a base catalog table.  Its removal means the data it stored is no longer being stored.  Even if you somehow got the column reference error to go away whatever the application is doing with that is going to be surprised to be handed an empty string.

You could always checkout the source for v15, un-revert the commit removing that field, compile, and see what happens.  But if you want to use a community build the application needs to be changed along with upgrades to the database.

David J.

Re: adsrc

From
Ron Johnson
Date:
On Tue, Nov 5, 2024 at 4:45 PM Matt Zagrabelny <mzagrabe@d.umn.edu> wrote:
Greetings Pg folk,

I've got a legacy app connecting to a legacy Pg database (9.4).

I'd like to upgrade the database to Pg 15, but when I connect and perform some tasks in the app, I get:

ERROR:  column d.adsrc does not exist at character 331

Some searching online yields that adsrc was removed in Pg 12.

1. What is the application?

2. An upgraded version of the application (or at least the db driver) probably won't reference it.
 
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

Re: adsrc

From
Matt Zagrabelny
Date:


On Tue, Nov 5, 2024 at 4:44 PM Ron Johnson <ronljohnsonjr@gmail.com> wrote:
On Tue, Nov 5, 2024 at 4:45 PM Matt Zagrabelny <mzagrabe@d.umn.edu> wrote:
Greetings Pg folk,

I've got a legacy app connecting to a legacy Pg database (9.4).

I'd like to upgrade the database to Pg 15, but when I connect and perform some tasks in the app, I get:

ERROR:  column d.adsrc does not exist at character 331

Some searching online yields that adsrc was removed in Pg 12.

1. What is the application?

Netdot - an IPAM from the 2000's.
 

2. An upgraded version of the application (or at least the db driver) probably won't reference it.

Yes. Looks like the DBD::Pg module is what needs the upgrade.

-m

Re: adsrc

From
Greg Sabino Mullane
Date:
Yes. Looks like the DBD::Pg module is what needs the upgrade.

Specifically, you will need DBD::Pg version 3.9.0 or higher, but I *highly* recommend using the latest release you can (right now, that is 3.18.0)

Cheers,
Greg