<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: PostgreSQL, SQLAlchemy, Dropping all tables and sequences</title>
	<atom:link href="http://www.luckydonkey.com/2007/11/23/postgresql-sqlalchemy-dropping-all-tables-and-sequences/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.luckydonkey.com/2007/11/23/postgresql-sqlalchemy-dropping-all-tables-and-sequences/</link>
	<description>Never knowingly knowing narwhals</description>
	<pubDate>Thu, 28 Aug 2008 03:29:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Rick Copeland</title>
		<link>http://www.luckydonkey.com/2007/11/23/postgresql-sqlalchemy-dropping-all-tables-and-sequences/#comment-1990</link>
		<dc:creator>Rick Copeland</dc:creator>
		<pubDate>Mon, 07 Jan 2008 20:09:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.luckydonkey.com/2007/11/23/postgresql-sqlalchemy-dropping-all-tables-and-sequences/#comment-1990</guid>
		<description>drop_all() doesn't actually work if there are circular ForeignKey dependences in PostgreSQL.  I have a short explanation (and quick fix) at http://pythonisito.blogspot.com/2008/01/cascading-drop-table-with-sqlalchemy.html</description>
		<content:encoded><![CDATA[<p>drop_all() doesn&#8217;t actually work if there are circular ForeignKey dependences in PostgreSQL.  I have a short explanation (and quick fix) at <a href="http://pythonisito.blogspot.com/2008/01/cascading-drop-table-with-sqlalchemy.html" rel="nofollow">http://pythonisito.blogspot.com/2008/01/cascading-drop-table-with-sqlalchemy.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike bayer</title>
		<link>http://www.luckydonkey.com/2007/11/23/postgresql-sqlalchemy-dropping-all-tables-and-sequences/#comment-1975</link>
		<dc:creator>mike bayer</dc:creator>
		<pubDate>Mon, 03 Dec 2007 04:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.luckydonkey.com/2007/11/23/postgresql-sqlalchemy-dropping-all-tables-and-sequences/#comment-1975</guid>
		<description>hiya -

sqlalchemy drops tables in order of dependency, where by "dependency" we mean foreign key dependencies..you can declare these explicitly using the ForeignKey construct.  But table reflection already uses the PG system tables to get this information automatically (we used to use information_schema but it proved to be too slow and quirky).  this feature can be used to drop all tables in the correct order like so:

engine = create_engine("posgres://user:pass@host/db")
meta = MetaData(engine)
meta.reflect()
meta.drop_all()

however, it currently doesn't cover sequences except for those which were created implicitly using SERIAL columns...we might add support for reflection of external sequences eventually.

- mike</description>
		<content:encoded><![CDATA[<p>hiya -</p>
<p>sqlalchemy drops tables in order of dependency, where by &#8220;dependency&#8221; we mean foreign key dependencies..you can declare these explicitly using the ForeignKey construct.  But table reflection already uses the PG system tables to get this information automatically (we used to use information_schema but it proved to be too slow and quirky).  this feature can be used to drop all tables in the correct order like so:</p>
<p>engine = create_engine(&#8221;posgres://user:pass@host/db&#8221;)<br />
meta = MetaData(engine)<br />
meta.reflect()<br />
meta.drop_all()</p>
<p>however, it currently doesn&#8217;t cover sequences except for those which were created implicitly using SERIAL columns&#8230;we might add support for reflection of external sequences eventually.</p>
<p>- mike</p>
]]></content:encoded>
	</item>
</channel>
</rss>
