pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Version String
4+ messages / 3 participants
[nested] [flat]

* Version String
@ 2011-04-14 21:21 Sam Nelson <samn@consistentstate.com>
  2011-04-14 23:23 ` Re: Version String Jerry Sievers <gsievers19@comcast.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Sam Nelson @ 2011-04-14 21:21 UTC (permalink / raw)
  To: pgsql-admin

Hi, list


We're attempting to change the version string for a Postgres Plus instance
to sort of trick a standard Postgres ODBC driver into connecting to the
pgplus instance.  I know there is a postgres plus ODBC driver out there,
but, while I don't know the specifics of why, it's currently not being used,
and I believe there's a good reason for that (although we have asked and are
waiting for a response).


So, is this doable?  Is there a way to change the version string that
postgres reports back to us?

---
===========================
Samuel Nelson
Consistent State
www.consistentstate.com
303-955-0509
===========================

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Version String
  2011-04-14 21:21 Version String Sam Nelson <samn@consistentstate.com>
@ 2011-04-14 23:23 ` Jerry Sievers <gsievers19@comcast.net>
  2011-04-15 01:23   ` Re: Version String Greg Sabino Mullane <greg@turnstep.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Jerry Sievers @ 2011-04-14 23:23 UTC (permalink / raw)
  To: Sam Nelson <samn@consistentstate.com>; +Cc: pgsql-admin

Sam Nelson <samn@consistentstate.com> writes:

> Hi, list
>
> We're attempting to change the version string for a Postgres Plus
> instance to sort of trick a standard Postgres ODBC driver into
> connecting to the pgplus instance.  I know there is a postgres
> plus ODBC driver out there, but, while I don't know the specifics of
> why, it's currently not being used, and I believe there's a good
> reason for that (although we have asked and are waiting for a
> response).
>
> So, is this doable?  Is there a way to change the version string that postgres reports back to us?

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

I am not making any claim as to this being a good practice :-)

Try it though on your dev system and see what happens.


> --- 
> ===========================
> Samuel Nelson
> Consistent State
> www.consistentstate.com
> 303-955-0509
> ===========================
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: gsievers19@comcast.net
p: 305.321.1144



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Version String
  2011-04-14 21:21 Version String Sam Nelson <samn@consistentstate.com>
  2011-04-14 23:23 ` Re: Version String Jerry Sievers <gsievers19@comcast.net>
@ 2011-04-15 01:23   ` Greg Sabino Mullane <greg@turnstep.com>
  2011-04-15 17:50     ` Re: Version String Sam Nelson <samn@consistentstate.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Greg Sabino Mullane @ 2011-04-15 01:23 UTC (permalink / raw)
  To: pgsql-admin; +Cc: samn@consistentstate.com


-----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@endpoint.com  greg@turnstep.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-----





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Version String
  2011-04-14 21:21 Version String Sam Nelson <samn@consistentstate.com>
  2011-04-14 23:23 ` Re: Version String Jerry Sievers <gsievers19@comcast.net>
  2011-04-15 01:23   ` Re: Version String Greg Sabino Mullane <greg@turnstep.com>
@ 2011-04-15 17:50     ` Sam Nelson <samn@consistentstate.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Sam Nelson @ 2011-04-15 17:50 UTC (permalink / raw)
  To: Greg Sabino Mullane <greg@turnstep.com>; +Cc: pgsql-admin

Alright, thanks guys!  I'll start testing it out, see what happens.
---
===========================
Samuel Nelson
Consistent State
www.consistentstate.com
303-955-0509
===========================


On Thu, Apr 14, 2011 at 7:23 PM, Greg Sabino Mullane <greg@turnstep.com>wrote:

>
> -----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@endpoint.com  greg@turnstep.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-----
>
>
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2011-04-15 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-04-14 21:21 Version String Sam Nelson <samn@consistentstate.com>
2011-04-14 23:23 ` Jerry Sievers <gsievers19@comcast.net>
2011-04-15 01:23   ` Greg Sabino Mullane <greg@turnstep.com>
2011-04-15 17:50     ` Sam Nelson <samn@consistentstate.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox