Which version will this run on?

Started by Mads Lie Jensenabout 16 years ago3 messagesgeneral
Jump to latest
#1Mads Lie Jensen
mads@gartneriet.dk

Hi

I have this:

SELECT pg_catalog.pg_get_constraintdef(r.oid, true) AS condef
FROM pg_catalog.pg_constraint r,
pg_catalog.pg_class c
WHERE c.oid=r.conrelid
AND r.contype = 'f'
AND c.relname = 'table_name'

which gives me the foreign keys of a given table in the database.
It is working perfectly on my 8.4.2-version of pstgresql.

But what other versions of postgresql will it run on?

Its used in a php-project, and I would like to know which minimum
version of postgres I should recommend.

Thanks in advance.

--
Mads Lie Jensen - mads@gartneriet.dk - ICQ #25478403
Gartneriet - http://www.gartneriet.dk/

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Mads Lie Jensen (#1)
Re: Which version will this run on?

Mads Lie Jensen <mads@gartneriet.dk> writes:

SELECT pg_catalog.pg_get_constraintdef(r.oid, true) AS condef
FROM pg_catalog.pg_constraint r,
pg_catalog.pg_class c
WHERE c.oid=r.conrelid
AND r.contype = 'f'
AND c.relname = 'table_name'

which gives me the foreign keys of a given table in the database.
It is working perfectly on my 8.4.2-version of pstgresql.

But what other versions of postgresql will it run on?

A quick test says that it works back to 7.4, which is the oldest
version that is supported at all anymore. I don't think you need
to worry too much.

regards, tom lane

#3Mads Lie Jensen
mads@gartneriet.dk
In reply to: Mads Lie Jensen (#1)
Re: Which version will this run on?

On Sun, 31 Jan 2010 16:11:46 -0500, tgl@sss.pgh.pa.us (Tom Lane) wrote:

A quick test says that it works back to 7.4, which is the oldest
version that is supported at all anymore. I don't think you need
to worry too much.

Thank you for the answer.
Had it worked on just any 8.x-version, I would have been more than happy
:-)
--
Mads Lie Jensen - mads@gartneriet.dk - ICQ #25478403
Gartneriet - http://www.gartneriet.dk/