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

Segmentation fault at second SELECT on pivot table under peculiar conditions #5

Open
trantor opened this issue Sep 10, 2022 · 0 comments

Comments

@trantor
Copy link

trantor commented Sep 10, 2022

Hello @jakethaw .
I was playing around with your extension (quite useful btw) since I wished to use it to convert an EAV-formatted data representation into a more "standard" table.
The catch is that I would like all this to be a VIEW on existing data.
Ideally I would have something like this (which may in turn be a VIEW on the original data)

id          entity_text         attribute           value
-------------------------------------------------------------
 2          text1               name                John
 2          text1               surname             Smith
 5          text2               place               Liverpool
 5          text2               country             UK 

turned into

id          entity_text         name                surname             place           country
--------------------------------------------------------------------------------------------------
 2          text1               John                Smith
 5          text2                                                       Liverpool       UK

Now, I do not know beforehand what can appear in the attribute column of the first table, so I would have a VIEW to have the DISTINCT attribute names associated with an integer ID, to use it with your virtual table to get the output column names.
It sort of works, but at the second SELECT on the pivot table I get a segmentation fault.
I also don't know what would happen when adding data to the source table.

I guess I am asking too much but I would like to ask what would prevent to be able to achieve something like this.
Thanks in advance 👋

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

1 participant