pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joel Fradkin <jfradkin@wazagua.com>
To: pgsql-admin@postgresql.org
Subject: graphical tools
Date: Tue, 08 Mar 2005 13:57:37 -0500
Message-ID: <000001c52410$b33181d0$797ba8c0@jfradkin> (raw)

I have seen this question a few times and still have not found a tool that
lets me edit the schema.
I have pgadminIII which I like, I also have tried a few other tools some are
not free, but none seem to allow me to just change the type of a field from
say char to varchar etc.
Is there a tool (even if its not free)?
Or do I have to do something like MSSQL does behind the scenes:

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
ALTER TABLE dbo.tblQuestions
	DROP CONSTRAINT DF_tblQuestions_Q_Default_Y_NAnswer
GO
ALTER TABLE dbo.tblQuestions
	DROP CONSTRAINT DF_tblQuestions_QY_N_or_TextAnswerBadScore
GO
ALTER TABLE dbo.tblQuestions
	DROP CONSTRAINT DF_tblQuestions_SecFeedBackTracking
GO
ALTER TABLE dbo.tblQuestions
	DROP CONSTRAINT DF_tblQuestions_SecFeedBackDaysfromclose
GO
CREATE TABLE dbo.Tmp_tblQuestions
	(
	Clinum varchar(16) NOT NULL,
	AuditID int NOT NULL,
	SectionId int NOT NULL,
	QuestionID int NOT NULL,
	Question char(5) NOT NULL,
	QuestionType char(1) NULL,
	QInfo1 varchar(4096) NULL,
	QInfo2 varchar(4096) NULL,
	QInfo3 varchar(4096) NULL,
	QText varchar(4096) NULL,
	QDescr varchar(4096) NULL,
	QCorectAnswerY_N char(1) NULL,
	QWeightedAnswerThreshold decimal(5, 2) NULL,
	QY_N_or_TextAnswerScore decimal(5, 2) NULL,
	QuestionDisplay varchar(25) NOT NULL,
	QNA_acceptible bit NULL,
	Q_Default_Y_NAnswer char(1) NULL,
	QY_N_or_TextAnswerBadScore decimal(5, 2) NULL,
	Q_FeedBackTracking char(1) NULL,
	Q_FeedBackDaysfromclose int NULL
	)  ON [PRIMARY]
GO
ALTER TABLE dbo.Tmp_tblQuestions ADD CONSTRAINT
	DF_tblQuestions_Q_Default_Y_NAnswer DEFAULT ('E') FOR
Q_Default_Y_NAnswer
GO
ALTER TABLE dbo.Tmp_tblQuestions ADD CONSTRAINT
	DF_tblQuestions_QY_N_or_TextAnswerBadScore DEFAULT (5) FOR
QY_N_or_TextAnswerBadScore
GO
ALTER TABLE dbo.Tmp_tblQuestions ADD CONSTRAINT
	DF_tblQuestions_SecFeedBackTracking DEFAULT ('N') FOR
Q_FeedBackTracking
GO
ALTER TABLE dbo.Tmp_tblQuestions ADD CONSTRAINT
	DF_tblQuestions_SecFeedBackDaysfromclose DEFAULT (30) FOR
Q_FeedBackDaysfromclose
GO
IF EXISTS(SELECT * FROM dbo.tblQuestions)
	 EXEC('INSERT INTO dbo.Tmp_tblQuestions (Clinum, AuditID, SectionId,
QuestionID, Question, QuestionType, QInfo1, QInfo2, QInfo3, QText, QDescr,
QCorectAnswerY_N, QWeightedAnswerThreshold, QY_N_or_TextAnswerScore,
QuestionDisplay, QNA_acceptible, Q_Default_Y_NAnswer,
QY_N_or_TextAnswerBadScore, Q_FeedBackTracking, Q_FeedBackDaysfromclose)
		SELECT CONVERT(varchar(16), Clinum), AuditID, SectionId,
QuestionID, Question, QuestionType, QInfo1, QInfo2, QInfo3, QText, QDescr,
QCorectAnswerY_N, QWeightedAnswerThreshold, QY_N_or_TextAnswerScore,
QuestionDisplay, QNA_acceptible, Q_Default_Y_NAnswer,
QY_N_or_TextAnswerBadScore, Q_FeedBackTracking, Q_FeedBackDaysfromclose FROM
dbo.tblQuestions TABLOCKX')
GO
DROP TABLE dbo.tblQuestions
GO
EXECUTE sp_rename N'dbo.Tmp_tblQuestions', N'tblQuestions', 'OBJECT'
GO
ALTER TABLE dbo.tblQuestions ADD CONSTRAINT
	PK_tblQuestions PRIMARY KEY NONCLUSTERED 
	(
	Clinum,
	AuditID,
	SectionId,
	QuestionID
	) WITH FILLFACTOR = 90 ON [PRIMARY]

GO
COMMIT

Joel Fradkin
 

 





Message-ID: <000001c52410$b33181d0$797ba8c0@jfradkin>
Permalink:  ../000001c52410$b33181d0$797ba8c0@jfradkin/
Also on:    postgresql.org/message-id/000001c52410$b33181d0$797ba8c0@jfradkin

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jfradkin@wazagua.com
  Subject: Re: graphical tools
  In-Reply-To: <000001c52410$b33181d0$797ba8c0@jfradkin>
  References: <000001c52410$b33181d0$797ba8c0@jfradkin>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox