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

Addition to the FAQ #36

Closed
beepsoft opened this issue Nov 4, 2020 · 2 comments
Closed

Addition to the FAQ #36

beepsoft opened this issue Nov 4, 2020 · 2 comments
Assignees

Comments

@beepsoft
Copy link

beepsoft commented Nov 4, 2020

The FAQ (http://jailer.sourceforge.net/faq.html) has this question and answer:

Q: I'm getting the message "Table has no primary key". What's wrong?
A: Jailer cannot handle tables without a primary key. Exporting data is not possible if the subject table is associated with a
 table without a primary key. In this case, you should manually define a primary key in the data model of the tool (not in the 
database!) using the Data Model Editor. Note that a key must be unique.

(On Oracle, however, rowid-pseudo columns can be used instead of primary keys)

I suggest adding that similarly to Oracle's rowid-pseudo column the ctid system column in PostgreSQL can also be used as a virtual primary key of type tid.

https://www.postgresql.org/docs/current/datatype-oid.html

A final identifier type used by the system is tid, or tuple identifier (row identifier). This is the data type of the system column ctid. A tuple ID is a pair (block number, tuple index within block) that identifies the physical location of the row within its table.

I have many-to-many join tables generated by Hibernate, which don't have primary keys generated but by using ctid I could make them work with jailer like this:
image

Maybe ctid could be also offered as an option similar to "Identity column (MS SQL)".

@Wisser
Copy link
Owner

Wisser commented Nov 5, 2020

Many thanks for the suggestion. I did not know the pseudo column "ctid" in PostgreSQL. It should be possible to use it in the same way as Oracle's rowid.

@Wisser Wisser self-assigned this Nov 5, 2020
@Wisser
Copy link
Owner

Wisser commented Nov 14, 2020

With the new release 10.2.4 the ctid column of PostgreSQL DBMS is supported.

@Wisser Wisser closed this as completed Nov 14, 2020
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

2 participants