Copy PostgreSQL table to MySQL using the ONLY clause

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Copy PostgreSQL table to MySQL using the ONLY clause

Gabriel Corrêa de Oliveira
I need to copy tables from PostgreSQL to MySQL, but I need Squirrel to add the ONLY clause to every SELECT statement that it performs against the PostgreSQL database.

Example: SELECT * FROM ONLY MY_TABLE

This is needed because I have descendant tables whose data I can't import into the destination database.

It is also necessary because if the SELECTs are performed without the ONLY clause, it will read data from descendant tables and some unique keys will be violated in the destination database.

Does anybody know how I can achieve this?

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Copy PostgreSQL table to MySQL using the ONLY clause

John Hardin
On Fri, 22 Jan 2016, Gabriel Corrêa de Oliveira wrote:

> I need to copy tables from PostgreSQL to MySQL, but I need Squirrel to add
> the ONLY clause to every SELECT statement that it performs against the
> PostgreSQL database.
>
> Example: SELECT * FROM ONLY MY_TABLE
>
> This is needed because I have descendant tables whose data I can't import
> into the destination database.
>
> It is also necessary because if the SELECTs are performed without the ONLY
> clause, it will read data from descendant tables and some unique keys will
> be violated in the destination database.
>
> Does anybody know how I can achieve this?
Can you define a view with the ONLY and query from that?


--
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  [hidden email]    FALaholic #11174     pgpk -a [hidden email]
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   Trusting in anti-gun laws to keep you from being shot is like
   refusing to wear your seatbelt because you trust traffic laws to
   keep you from being in a car accident.              -- Erin Palette
-----------------------------------------------------------------------
  Tomorrow: John Moses Browning's 161st Birthday
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Copy PostgreSQL table to MySQL using the ONLY clause

Gabriel Corrêa de Oliveira
I can; however, there isn't a "copy" option in the context menu when I select a view.

On Fri, Jan 22, 2016 at 2:47 PM, John Hardin <[hidden email]> wrote:
On Fri, 22 Jan 2016, Gabriel Corrêa de Oliveira wrote:

I need to copy tables from PostgreSQL to MySQL, but I need Squirrel to add
the ONLY clause to every SELECT statement that it performs against the
PostgreSQL database.

Example: SELECT * FROM ONLY MY_TABLE

This is needed because I have descendant tables whose data I can't import
into the destination database.

It is also necessary because if the SELECTs are performed without the ONLY
clause, it will read data from descendant tables and some unique keys will
be violated in the destination database.

Does anybody know how I can achieve this?

Can you define a view with the ONLY and query from that?


--
 John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
 [hidden email]    FALaholic #11174     pgpk -a [hidden email]
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
  Trusting in anti-gun laws to keep you from being shot is like
  refusing to wear your seatbelt because you trust traffic laws to
  keep you from being in a car accident.              -- Erin Palette
-----------------------------------------------------------------------
 Tomorrow: John Moses Browning's 161st Birthday


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Copy PostgreSQL table to MySQL using the ONLY clause

John Hardin
On Fri, 22 Jan 2016, Gabriel Corrêa de Oliveira wrote:

> I can; however, there isn't a "copy" option in the context menu when I
> select a view.

Select the table, do Copy, and modify the SQL to use the view name?

(I'm shooting in the dark, I've never used that option.)

> On Fri, Jan 22, 2016 at 2:47 PM, John Hardin <[hidden email]> wrote:
>
>> On Fri, 22 Jan 2016, Gabriel Corrêa de Oliveira wrote:
>>
>> I need to copy tables from PostgreSQL to MySQL, but I need Squirrel to add
>>> the ONLY clause to every SELECT statement that it performs against the
>>> PostgreSQL database.
>>>
>>> Example: SELECT * FROM ONLY MY_TABLE
>>>
>>> This is needed because I have descendant tables whose data I can't import
>>> into the destination database.
>>>
>>> It is also necessary because if the SELECTs are performed without the ONLY
>>> clause, it will read data from descendant tables and some unique keys will
>>> be violated in the destination database.
>>>
>>> Does anybody know how I can achieve this?
>>>
>>
>> Can you define a view with the ONLY and query from that?
--
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  [hidden email]    FALaholic #11174     pgpk -a [hidden email]
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   Where We Want You To Go Today 07/05/07: Microsoft patents in-OS
   adware architecture incorporating spyware, profiling, competitor
   suppression and delivery confirmation (U.S. Patent #20070157227)
-----------------------------------------------------------------------
  Tomorrow: John Moses Browning's 161st Birthday
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Loading...