Re: drop constraint unnamed?

Started by Darren Fergusonover 23 years ago9 messagesgeneral
Jump to latest
#1Darren Ferguson
darren@crystalballinc.com

ALTER TABLE table RENAME TO aaa;

CREATE TABLE table (
columns .....
)

Do it without the constraint

INSERT INTO table (SELECT * FROM aaa);

DROP TABLE aaa;

This is how i would do it although there could be other options

HTH

On Mon, 14 Oct 2002, Andy Kriger wrote:

How do you drop an unnamed constraint from a table? I tried searching the
archives but the site is extremely slow and I need to get this fixed now.

I have tried
alter table table drop constraint <unnamed>;
alter table table drop constraint '<unnamed>';
alter table table drop constraint '';
alter table table drop constraint;
drop trigger triggerName from table;
drop trigger 'triggerName' from table;

Any ideas?

thx
andy

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Darren Ferguson

#2Gregory Wood
gregw@com-stock.com
In reply to: Darren Ferguson (#1)

Unless there are foreign keys and all sorts of other dependencies. As Tom
said, the recipe on http://techdocs.postgresql.org/ is much nicer to deal
with.

Greg

----- Original Message -----
From: "Darren Ferguson" <darren@crystalballinc.com>
To: "Andy Kriger" <akriger@greaterthanone.com>
Cc: "Pgsql-General" <pgsql-general@postgresql.org>
Sent: Monday, October 14, 2002 11:23 AM
Subject: Re: [GENERAL] drop constraint unnamed?

ALTER TABLE table RENAME TO aaa;

CREATE TABLE table (
columns .....
)

Do it without the constraint

INSERT INTO table (SELECT * FROM aaa);

DROP TABLE aaa;

This is how i would do it although there could be other options

HTH

On Mon, 14 Oct 2002, Andy Kriger wrote:

How do you drop an unnamed constraint from a table? I tried searching

the

archives but the site is extremely slow and I need to get this fixed

now.

Show quoted text

I have tried
alter table table drop constraint <unnamed>;
alter table table drop constraint '<unnamed>';
alter table table drop constraint '';
alter table table drop constraint;
drop trigger triggerName from table;
drop trigger 'triggerName' from table;

Any ideas?

thx
andy

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Darren Ferguson

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

#3Savita
savita@india.hp.com
In reply to: Darren Ferguson (#1)
Migrating DAta from MSSQL to postgre

Hi All,

I need some help to migrate data from MSSQL to Postgres.

I have the following a scnirio like.

1.I have a table in MSSQL.
2.I have another table in Postgres with different name and schema from the one
which is present in MSSQL.

Is it possible to migrate data from the table which is present in MSSQL to
Postgres.
-
Best Regards
- Savita
----------------------------------------------------
Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)
----------------------------------------------------
#4annachau
annachau@hongkong.com
In reply to: Savita (#3)
Re: Migrating DAta from MSSQL to postgre

I use pgADMIN II to import MSSQL to postgre

-----Original message-----
From:Savita <savita@india.hp.com>
To:Pgsql-General <pgsql-general@postgresql.org>
Date:Tue, 26 Nov 2002 10:53:34 +0530
Subject:[GENERAL] Migrating DAta from MSSQL to postgre

Hi All,

I need some help to migrate data from MSSQL to Postgres.

I have the following a scnirio like.

1.I have a table in MSSQL.
2.I have another table in Postgres with different name and schema from the one
which is present in MSSQL.

Is it possible to migrate data from the table which is present in MSSQL to
Postgres.
-
Best Regards
- Savita
----------------------------------------------------
Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)
----------------------------------------------------

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#5Shridhar Daithankar
shridhar_daithankar@persistent.co.in
In reply to: Savita (#3)
Re: Migrating DAta from MSSQL to postgre

On 26 Nov 2002 at 10:53, Savita wrote:

Hi All,

I need some help to migrate data from MSSQL to Postgres.

I have the following a scnirio like.

1.I have a table in MSSQL.
2.I have another table in Postgres with different name and schema from the one
which is present in MSSQL.

Is it possible to migrate data from the table which is present in MSSQL to
Postgres.

Obviously there are some commanalities between these two.. Some little scripts
in sed and awk might get you the text formatting needed for interoperation.

Text dump from one table and text load to other is the only way I can think..

HTH

Bye
Shridhar

--
Random, n.: As in number, predictable. As in memory access, unpredictable.

#6Savita
savita@india.hp.com
In reply to: annachau (#4)
Re: Migrating DAta from MSSQL to postgre

Hi annachau,

Thanks for the reply.I also tried PGADMIN II ,but I was geeting some errors using
that.Also I would like to know something about pgadminII.

1.Should we have same table existing in MSSQL and postgre if we use PGADMIN II.

annachau wrote:

I use pgADMIN II to import MSSQL to postgre

-----Original message-----
From:Savita <savita@india.hp.com>
To:Pgsql-General <pgsql-general@postgresql.org>
Date:Tue, 26 Nov 2002 10:53:34 +0530
Subject:[GENERAL] Migrating DAta from MSSQL to postgre

Hi All,

I need some help to migrate data from MSSQL to Postgres.

I have the following a scnirio like.

1.I have a table in MSSQL.
2.I have another table in Postgres with different name and schema from the one
which is present in MSSQL.

Is it possible to migrate data from the table which is present in MSSQL to
Postgres.
-
Best Regards
- Savita
----------------------------------------------------
Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)
----------------------------------------------------

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

--
Best Regards
- Savita
----------------------------------------------------
Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)
----------------------------------------------------
#7Mike Mascari
mascarm@mascari.com
In reply to: annachau (#4)
Re: Migrating DAta from MSSQL to postgre

Savita wrote:

Hi annachau,

Thanks for the reply.I also tried PGADMIN II ,but I was geeting some errors using
that.Also I would like to know something about pgadminII.

1.Should we have same table existing in MSSQL and postgre if we use PGADMIN II.

annachau wrote:

I use pgADMIN II to import MSSQL to postgre

Short form: Postgres
^
Long form: PostgreSQL

Mike Mascari
mascarm@mascari.com

#8Jeff Eckermann
jeff_eckermann@yahoo.com
In reply to: Savita (#6)
Re: Migrating DAta from MSSQL to postgre

PgAdmin II will create the table for you.
If you want the table structure to be different, you
could always create a new table with the structure you
want, then insert the data from the migrated table.
If you get errors with PgAdmin II that you cannot
resolve, post details to the pgsql-interfaces list,
and someone there can probably help you.

--- Savita <savita@india.hp.com> wrote:

Hi annachau,

Thanks for the reply.I also tried PGADMIN II ,but I
was geeting some errors using
that.Also I would like to know something about
pgadminII.

1.Should we have same table existing in MSSQL and
postgre if we use PGADMIN II.

annachau wrote:

I use pgADMIN II to import MSSQL to postgre

-----Original message-----
From:Savita <savita@india.hp.com>
To:Pgsql-General <pgsql-general@postgresql.org>
Date:Tue, 26 Nov 2002 10:53:34 +0530
Subject:[GENERAL] Migrating DAta from MSSQL to

postgre

Hi All,

I need some help to migrate data from MSSQL to

Postgres.

I have the following a scnirio like.

1.I have a table in MSSQL.
2.I have another table in Postgres with different

name and schema from the one

which is present in MSSQL.

Is it possible to migrate data from the table

which is present in MSSQL to

Postgres.
-
Best Regards
- Savita

----------------------------------------------------

Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)

----------------------------------------------------

---------------------------(end of

broadcast)---------------------------

TIP 4: Don't 'kill -9' the postmaster

---------------------------(end of

broadcast)---------------------------

TIP 4: Don't 'kill -9' the postmaster

--
Best Regards
- Savita
----------------------------------------------------
Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)
----------------------------------------------------

---------------------------(end of
broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please
send an appropriate
subscribe-nomail command to majordomo@postgresql.org
so that your
message can get through to the mailing list cleanly

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

#9scott.marlowe
scott.marlowe@ihs.com
In reply to: Savita (#3)
Re: Migrating DAta from MSSQL to postgre

On Tue, 26 Nov 2002, Savita wrote:

Hi All,

I need some help to migrate data from MSSQL to Postgres.

I have the following a scnirio like.

1.I have a table in MSSQL.
2.I have another table in Postgres with different name and schema from the one
which is present in MSSQL.

Is it possible to migrate data from the table which is present in MSSQL to
Postgres.

Sure. But I'm not sure what you're asking exactly. Are you wanting to
move data from tablea in the MSSQL to tablea in Postgresql, even though
they have different schema? Or do you want to make a new tableb in
Postgresql to take in the data from tablea in MSSQL? Or maybe a new
database so you can use the name tablea from MSSQL in Postgresql?

Generally, I've found it pretty easy to use ODBC and open a connection to
each database and then just 'select * from sourcetable' and the iterate
over the result set and build a whole bunch of 'insert into desttable
(f1,f2,f3,...fn) values ('v1','v2','v3',...'vn');' and wrap them up in a
begin;commit; pair.

The other method is to dump the data to a text file on the MSSQL side and
then use /copy to suck the data in. Both are pretty fast in my
experience, but the /copy is a little faster than the inserts.