Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to insert mysql_fdw tables? #96

Open
sangli00 opened this issue Mar 30, 2016 · 13 comments
Open

How to insert mysql_fdw tables? #96

sangli00 opened this issue Mar 30, 2016 · 13 comments

Comments

@sangli00
Copy link

select * from test;
id | name
----+------
1 | ss
(1 row)

how to insert into test select 2,'tt';
ERROR: first column of remote table must be unique for INSERT/UPDATE/DELETE operation

@sangli00
Copy link
Author

why need mysql table first column is unique ?
if first column is not unique ,so I can't inset to mysql ?

@ibrarahmad
Copy link
Contributor

The first column is a key column, the delete and update operation need to
have at-least one column unique.

On Wed, Mar 30, 2016 at 12:29 PM, LSang notifications@github.com wrote:

why need mysql table first column is unique ?
if first column is not unique ,so I can't inset to mysql ?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#96 (comment)

Ibrar Ahmed
EnterpriseDB http://www.enterprisedb.com

@sangli00
Copy link
Author

if i modify code mysql_fdw.c mysql_is_column_unique function,away return TRUE , is OK?

@ahsanhadi
Copy link

Not sure i understand your question?

@sangli00
Copy link
Author

I don't know ,why the first column is unique? what mean in this operation .

@ahsanhadi
Copy link

I think what Ibrar is saying that we don't have something like OID or tuple-ID in mysql that we can use for performing update/delete operation. So we need to enforce the first column of the table to be unique in order to support these operations..

Ibrar can confirm...

@sangli00
Copy link
Author

@ibrarahmad how to fast delete mysql table ? if i can truncate table in mysql .table is so much ,how to do it ? delete from tab is so slowly.

@rmuller
Copy link

rmuller commented Sep 19, 2017

Why must the first column of the target table of an INSERT operation be unique?

This is a serious issue, because table copy operations are far more expensive because of this constraint.

@ahsanhadi
Copy link

ahsanhadi commented Sep 19, 2017 via email

@ahsanhadi
Copy link

ahsanhadi commented Sep 19, 2017 via email

@rmuller
Copy link

rmuller commented Sep 20, 2017

Thanks for your reply.

The tid, or tuple identifier (row identifier) is a pair (block number, tuple index within block) that identifies the physical location of the row within its table.

The tid is the page/offset of the tuple. You can't really remove it because it is a characteristic of the tuple, not really in each tuple. Each page has a number, and each page has slots, so the page
number/slotnumber of the tuple is its tid.

I do not understand how this is related to my question.

@ibrarahmad
Copy link
Contributor

ibrarahmad commented Sep 20, 2017 via email

@rmuller
Copy link

rmuller commented Sep 20, 2017

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants