Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > PostgreSQL > PostgreSQL Syntax questions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-12-08, 11:50
krishtpt krishtpt is offline
Registered User
 
Join Date: Jun 2008
Posts: 1
PostgreSQL Syntax questions

Hi There,

I am new to Postgresql. I have few questions regarding the sql syntax in Postgresql.
1. I am trying to disable constraints from a particular table in postgresql. But I couldn't get the alter command for the same.
2. I am trying to fetch all the constraints from a specific table using a select query. I am using 'select * from pg_constraint'. If I execute this query I am able to get all the constraints from all the tables. But I couldn't find which constraint is for what table. How can I get this data.
3. I am also trying to fetch all the triggers for a specific table using a select query. How can I get this data?
4. I also would like to know how can I execute an sql file from windows command prompt in postgresql.

Please help me with these details.

Thanks
Krish
Reply With Quote
  #2 (permalink)  
Old 06-12-08, 12:30
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 654
1. I am trying to disable constraints from a particular table in postgresql. But I couldn't get the alter command for the same.

You cannot disable it. You have to either drop it, or declare it as "deferrable" so it is evaluated when you commit your data.

2. I am trying to fetch all the constraints from a specific table using a select query. I am using 'select * from pg_constraint'. If I execute this query I am able to get all the constraints from all the tables. But I couldn't find which constraint is for what table. How can I get this data.
http://www.postgresql.org/docs/8.3/s...ble-usage.html
http://www.postgresql.org/docs/8.3/s...nstraints.html
http://www.postgresql.org/docs/8.3/s...nstraints.html

3. I am also trying to fetch all the triggers for a specific table using a select query. How can I get this data?
http://www.postgresql.org/docs/8.3/s...-triggers.html

4. I also would like to know how can I execute an sql file from windows command prompt in postgresql.
http://www.postgresql.org/docs/curre.../app-psql.html
Reply With Quote
  #3 (permalink)  
Old 06-16-08, 17:07
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,354
Also, refer to the Information_Schema
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On