By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

how to compare two tables

P: 35
Hi all
I have a problem
Suppose i have two tables for ex AAA and BBB
I want to just compare whether these two table has the
same structure or not
How can i do this Is there any qeury for that

Mar 28 '07 #1
Share this Question
Share on Google+
2 Replies

P: 4
You can use 3rd party software like
Mar 28 '07 #2

Expert 100+
P: 534
If you don't have access to third party tools, such as one Michael suggested above, I can help you with query to dump the table definition. (Also see Information Schema )

But if this is something you need just once the easiest way is probably to open psql session and use meta-command \d table-name

Expand|Select|Wrap|Line Numbers
  1. \d AAA
  2. \d BBB
with this you also get information on table indexes and constraints.
Mar 28 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.