<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>key_column_usage &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/key_column_usage/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Sat, 23 Sep 2017 07:48:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>PostgreSQL: Script to find Source and Destination of All Foreign Key Constraint</title>
		<link>https://www.dbrnd.com/2015/10/postgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 20 Oct 2015 17:43:08 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[PostgreSQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[constraint_column_usage]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[key_column_usage]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[table_constraints]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=908</guid>

					<description><![CDATA[In this post, I am sharing a script to find all list of Foreign Keys with source and destination in PostgreSQL. Using below script, you can easily find all foreign keys of a Postgres Database, and it is also handy for Database Architect to find the different references of a database server. [crayon-6aa4ad6748405441212946/]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20Source%20and%20Destination%20of%20All%20Foreign%20Key%20Constraint" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20Source%20and%20Destination%20of%20All%20Foreign%20Key%20Constraint" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20Source%20and%20Destination%20of%20All%20Foreign%20Key%20Constraint" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20Source%20and%20Destination%20of%20All%20Foreign%20Key%20Constraint" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20Source%20and%20Destination%20of%20All%20Foreign%20Key%20Constraint" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20Source%20and%20Destination%20of%20All%20Foreign%20Key%20Constraint" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fpostgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint%2F&#038;title=PostgreSQL%3A%20Script%20to%20find%20Source%20and%20Destination%20of%20All%20Foreign%20Key%20Constraint" data-a2a-url="https://www.dbrnd.com/2015/10/postgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint/" data-a2a-title="PostgreSQL: Script to find Source and Destination of All Foreign Key Constraint"></a></p><p>In this post, I am sharing a script to find all list of Foreign Keys with source and destination in PostgreSQL.</p>
<p>Using below script, you can easily find all foreign keys of a Postgres Database, and it is also handy for Database Architect to find the different references of a database server.</p>
<pre class="crayon-plain-tag">SELECT
	tc.constraint_name AS ForeignKeyConstraintName
	,tc.table_name AS TableName
	,kcu.column_name AS ColumnName
	,ccu.table_name AS ForeignKeyTableName
	,ccu.column_name AS ForeignKeyColumn
FROM information_schema.table_constraints AS tc 
JOIN information_schema.key_column_usage AS kcu
	ON tc.constraint_name = kcu.constraint_name
JOIN information_schema.constraint_column_usage AS ccu
	ON ccu.constraint_name = tc.constraint_name
WHERE tc.constraint_type = 'FOREIGN KEY';</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
