Re: Version String

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Cc: samn(at)consistentstate(dot)com
Subject: Re: Version String
Date: 2011-04-15 01:23:01
Message-ID: 66dd44a2633314f04275526e3ed8228a@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> alter function pg_catalog.version() rename to version_old;
>
> create function pg_catalog.version() returns text
> as $$select 'fake version goes here'::text$$ language sql;;

Alternatively, you could create a public version and create
a user that sees that public version (or some other schema)
before the pg_catalog one:

CREATE FUNCTION public.version() RETURNS text LANGUAGE SQL IMMUTABLE
AS $$ SELECT 'PostgreSQL 8.4.22, but really PgPlus 8.4.22'::text$$;

ALTER USER odbc_fakeout SET search_path = public, pg_catalog;

Also note that a change to pg_catalog will *not* survive a
pg_dump and restore.

Other approaches:

* Ask EDB if there is a version that doesn't mangle version()

* Recompile it yourself after fixing version()

* Make a custom version() as above that actually parses the real
version() string, so as to return the correct version even after
you upgrade.

* Patch the standard ODBC driver to grep for just numbers in the
version string, if they haven't already.

- --
Greg Sabino Mullane greg(at)endpoint(dot)com greg(at)turnstep(dot)com
End Point Corporation 610-983-9073
PGP Key: 0x14964AC8 201104142113
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAk2nncYACgkQvJuQZxSWSsgNTwCfZTMJzr+Y2hCXOibl/P5XyYlw
twQAoKBcuq6OdXEFXVv/mCYGGn7r6LnR
=NOEW
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ray Stell 2011-04-15 01:25:00 streaming AND file-based log-shipping?
Previous Message Jeff Davis 2011-04-14 23:30:46 Re: [GENERAL] Streaming Replication limitations