I saw a friend using WPD and I wanted to buy it to my company, that uses PostgreSQL Database.
But when I tried to use this 'Table relations foreign-key' feature between Separate Database connection PostgreSQL tables (SQL or manual), that I researched in theses tutorials:
P.S. -> The 'Table relations foreign-key' feature ONLY worked between Separated Database connection PostgreSQL tables (SQL or manual) and Google spreadsheet tables.
But when I tried to use the 'Table relations foreign-key' feature between two themselves Separate Database connection PostgreSQL tables (SQL or manual) .
It doesn't work by any ways. (All this as explained.)
- Is this a bug or feature limitation?
How can it be fixed?
Due to the nature of how the SQL/PostgreSQL foreign keys work, the tables that you wish to connect via foreign key relations have to be on the same Database connection.
If they are not on the same Database connection, the foreign key will not work, sadly.
That is the limitation that is currently existing - Our developers hope to find a way to improve it in the future, but we can't say an ETA on it.
You could follow our changeLog page - here we always state any changes/improvements at each Update cycle.
Let me know if you have any further questions. Thanks.
the developers advised us that they are able to successfully create foreign key relations on both local PostgreSQL and an external live PostgreSQL database.
-
Could you possibly help us replicate this, by sending us temporary Access credentials to your database;
and if you can point out more details such as which tables you are trying to connect, and which columns,
so that we can try to remote in, if that is OK?
In case you send any credentials, make sure to mark reply as Private. Thank you.
Thank you for the credentials, i can definitely log into everything now - as well as WP Admin;
and i see the tables + columns that you pointed out in the database.
We will share all the details with the developers and they will help us replicate the foreign key relations as you described, with the respective tables and columns;
i will advise you on the results as soon as we test everything out.
Basically, for some reason, they are not sure - on your PostgreSql server, using the GROUP BY has issues.
If they try Query like this, it would fail :
SELECT ("wdt_id") AS "wdt_id", ("birthdate") AS "birthdate" FROM
(SELECT wpdatatable_6."wdt_id",
wpdatatable_6."name",
wpdatatable_6."birthdate"
FROM wpdatatable_6
)
tbl GROUP BY ("wdt_id", "birthdate") ORDER BY "birthdate"
But if they remove GROUP BY, then it works, but it won't group the rows.
- Could you please contact your server support, to see if they perhaps disabled or forbid the GROUP BY?
I have already forwarded your msg to the server support. Any feedback will be forwarded as soon as possible.
By the way, I don't think that's the problem. - I tried and it worked (no parentheses):
SELECT ("wdt_id") AS "wdt_id", ("birthdate") AS "birthdate" FROM
(SELECT wpdatatable_6."wdt_id", wpdatatable_6."name", wpdatatable_6."birthdate" FROM wpdatatable_6 ) tbl GROUP BY "wdt_id", "birthdate" ORDER BY "birthdate"
- But what does the fact that the 'GROUP BY' is supposedly not working have to do with the Table relations foreign-key not working as well?
Keep in mind that I'm a layman on this subject and I may be writing some nonsense in any part of this message...
For some reason the brackets after the Group By are not valid on your server, so the dev has excluded that , and now it works.
In order for this to be implemented in the plugin core, we will firstly test more PostGreSQL databases.
Since this is a string column, the foreign key date is returned as it is saved in the database. 1234-05-05
In order to show as it is in wpDataTables, you will have to insert a hook, into the functions.php file of your current theme :
function wpdatatables_filter_cell_by_column_name( $formattedValue, $tableId , $columnHeader)
{
//here you can set table id that you need
// $tableId is int
// here you will insert table id for which you need this hook
if ($tableId == 1) {
//here you will insert orig header for columns where you need to change content
// $columnHeader is string
if ($columnHeader == "funcquatro" ) {
$dateFormat = get_option('wdtDateFormat');
// here is logic for converting date format from
// database to format set in wpdatatables
$formattedValue = WDTTools::wdtConvertStringToUnixTimestamp($formattedValue, $dateFormat);
$formattedValue = date($dateFormat, $formattedValue);
}
}
return $formattedValue;
}
add_filter('wpdatatables_filter_cell_output','wpdatatables_filter_cell_by_column_name', 10, 3);
For the time being, if you update a theme, you will have to repeat this, and change the theme functions file again;
unless if you use a child theme, in that case it will not be overwritten.
As i started reading the message, i was very happy, but then, at the end, when i realised some other changes got lost through the update, of course, that is a shame.
I was not aware that the devs did other changes, apart from the hooks advised in the child theme's PhP file...
I will check it with them - and we will do our best to advise as quick as possible. As soon as they respond i will inform you right away.
Oh, sorry - somehow i did not see the last message you sent after the previous one.
I am definitely happy now, to see that you found the other updated changes in the /wpdatatables/source/class.wpdatatable.php file.
That is awesome!
Yes, i will check with developers, if they have plans to modify these details in the plugin for the future, or if you should proceed to repeat this indefinitely.
Apologies, i confirmed this a lot quicker than i thought. I found correspondence with the developers, they confirmed that they have to do more testing on this, on various databases and server types;
but once they complete all the testing, they will work on implementing a permanent fix.
I can't say an ETA on it , but if you wish you can follow our ChangeLog page. At each update, they add patch notes for any change/bug fix/new feature;
you can also find the changeLog on the plugin dashboard in Wp-Admin;
And once they complete all the work for this - they will certainly add it to the patch notes.-
Until then, you will have to do these modifications at each update to overwrite the code.
Thank you again for the wonderful review, and all the kind words,
i can not express how much it means to us.
We will of course, do our best to advise as much as possible on the other ticket - and please don't hesitate to open new tickets for any new question or concern.
Hello,
I saw a friend using WPD and I wanted to buy it to my company, that uses PostgreSQL Database.
But when I tried to use this 'Table relations foreign-key' feature between Separate Database connection PostgreSQL tables (SQL or manual), that I researched in theses tutorials:
https://wpdatatables.com/documentation/front-end-editing/configuring-table-relations-foreign-key/
It doesn't work by any ways.
- Is this a bug or feature limitation?
How can it be fixed?
Thanks/Хвала
P.S. ->
The 'Table relations foreign-key' feature ONLY worked between Separated Database connection PostgreSQL tables (SQL or manual) and Google spreadsheet tables.
But when I tried to use the 'Table relations foreign-key' feature between two themselves Separate Database connection PostgreSQL tables (SQL or manual) .
It doesn't work by any ways.
(All this as explained.)
- Is this a bug or feature limitation? How can it be fixed?
Thanks/Хвала
Hello Zeba,
Thanks for showing interest in wpDataTables.
You are correct, it is exactly like this.
Due to the nature of how the SQL/PostgreSQL foreign keys work, the tables that you wish to connect via foreign key relations have to be on the same Database connection.
If they are not on the same Database connection, the foreign key will not work, sadly.
That is the limitation that is currently existing - Our developers hope to find a way to improve it in the future, but we can't say an ETA on it.
You could follow our changeLog page - here we always state any changes/improvements at each Update cycle.
Let me know if you have any further questions. Thanks.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Uroš,
I think you didn't understand.
The tables that I wish to connect via foreign key relations are both PostgreSQL tables and on the same Database connection.
- Is this a bug or feature limitation specifically between PostgreSQL tables?
Because I can connect OK tables via foreign key relations , when they're on MySQL Database connection.
Hello Zeba,
My apologies, I can now see what you meant.
I have to check this with our senior 2nd level Team to make sure that we give you the most up to date information.
As soon as they confirm it, I will immediately come back to you. Thank you for your patience and for clarifying the issue.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Uroš,
Glad I could help. Keep an eye on quality control & QA.
I'm really looking forward to hearing from the team.
Thanks for your patience as well.
Hi, Zeba
We are all cooperating together on this,
the developers advised us that they are able to successfully create foreign key relations on both local PostgreSQL and an external live PostgreSQL database.
-
Could you possibly help us replicate this, by sending us temporary Access credentials to your database;
and if you can point out more details such as which tables you are trying to connect, and which columns,
so that we can try to remote in, if that is OK?
In case you send any credentials, make sure to mark reply as Private. Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi, Zeba
Thank you for the credentials, i can definitely log into everything now - as well as WP Admin;
and i see the tables + columns that you pointed out in the database.
We will share all the details with the developers and they will help us replicate the foreign key relations as you described, with the respective tables and columns;
i will advise you on the results as soon as we test everything out.
Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Miloš,
I trust the competence and professionalism of the team.
I look forward to your return!
Hope for the best,
Zeba
Hi, Zeba
Thank you very much for your patience.
The developers tested everything.
Basically, for some reason, they are not sure - on your PostgreSql server, using the GROUP BY has issues.
If they try Query like this, it would fail :
But if they remove GROUP BY, then it works, but it won't group the rows.
- Could you please contact your server support, to see if they perhaps disabled or forbid the GROUP BY?
Looking forward to your reply. Thank you
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Miloš,
I have already forwarded your msg to the server support.
Any feedback will be forwarded as soon as possible.
By the way, I don't think that's the problem.
- I tried and it worked (no parentheses):
SELECT ("wdt_id") AS "wdt_id", ("birthdate") AS "birthdate" FROM
(SELECT wpdatatable_6."wdt_id",
wpdatatable_6."name",
wpdatatable_6."birthdate"
FROM wpdatatable_6
)
tbl GROUP BY "wdt_id", "birthdate" ORDER BY "birthdate"
- But what does the fact that the 'GROUP BY' is supposedly not working have to do with the Table relations foreign-key not working as well?
Keep in mind that I'm a layman on this subject and I may be writing some nonsense in any part of this message...
Thanks!
Hi, Zeba
I will pass this to the devs, and i am waiting for their answer;
as soon as they respond i will pass the details, thank you for that.
And of course, let us know what the server support says. Thank you
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Miloš,
The server Support reported that there were never any existing limitations applied to the the PostgreSQL database.
- Let the devs know that they are free to test and even create new views and/or tables.
All credentials have always been released.
Wheter in PostgreSQL or even in the WpDatatables itself as well.
- The Table relations foreign-key feature is really important, a vital highlight!
I trust the support of the programmers Team.
Thank you all for the request and patience so far.
--
Adriano
Hi, Adriano
Thank you for the latest information.
I will pass it to the devs, as well as pointing out that they are free to test fully as you suggested.
I will keep you posted on their progress.
Thanks.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi, Adriano
Thank you for your patience.
- We got update from our developer.
For some reason the brackets after the Group By are not valid on your server, so the dev has excluded that , and now it works.
In order for this to be implemented in the plugin core, we will firstly test more PostGreSQL databases.
Since this is a string column, the foreign key date is returned as it is saved in the database. 1234-05-05
In order to show as it is in wpDataTables, you will have to insert a hook, into the functions.php file of your current theme :
For the time being, if you update a theme, you will have to repeat this, and change the theme functions file again;
unless if you use a child theme, in that case it will not be overwritten.
-
Let me know how it goes. Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Miloš,
Sorry for the delay in responding.
I come to say that this suggested function snippet is excellent for date fields.
It's saved on functions.php and I'm using a child theme.
However, you made more changes because all the other foreign-key with PostgreSQL started working too!
(although not knowing how to identify what was done by them)
A big Hail to the amazing programmers!!!
--
However, when I went to update the plugin now, all Table relations foreign-key on PostgreSQL fixes were lost.
I would like to be able to update the plugin and keep the fixes made to this previous major limitation.
How to do?
Thanks!
Hi Miloš,
I'm pretty sure that the change made by the developers was in the /wpdatatables/source/class.wpdatatable.php file.
https://3ibi.com/milos/class.wpdatatable_FIXED.php.txt
I replaced all files with their updated versions, with the exception of class.wpdatatable.php .
https://3ibi.com/milos/class.wpdatatable_UPDATED.php.txt
And it started working OK again.
And how to proceed in case of new updates?
Thank you all
Hi, Zeba
As i started reading the message, i was very happy, but then, at the end, when i realised some other changes got lost through the update, of course, that is a shame.
I was not aware that the devs did other changes, apart from the hooks advised in the child theme's PhP file...
I will check it with them - and we will do our best to advise as quick as possible. As soon as they respond i will inform you right away.
Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi, Zeba
Oh, sorry - somehow i did not see the last message you sent after the previous one.
I am definitely happy now, to see that you found the other updated changes in the /wpdatatables/source/class.wpdatatable.php file.
That is awesome!
Yes, i will check with developers, if they have plans to modify these details in the plugin for the future, or if you should proceed to repeat this indefinitely.
As soon as they confirm it , i will advise on it.
Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi, Zeba
Apologies, i confirmed this a lot quicker than i thought. I found correspondence with the developers, they confirmed that they have to do more testing on this, on various databases and server types;
but once they complete all the testing, they will work on implementing a permanent fix.
I can't say an ETA on it , but if you wish you can follow our ChangeLog page. At each update, they add patch notes for any change/bug fix/new feature;
you can also find the changeLog on the plugin dashboard in Wp-Admin;
And once they complete all the work for this - they will certainly add it to the patch notes.-
Until then, you will have to do these modifications at each update to overwrite the code.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Miloš,
Firstly,
I really appreciate the team's proactiveness.
The changes were very welcome and completely solved the limitation also discovered by themselves.
This is full service.
And I reinforce the big Hail to the amazing devs!!!
(especially for anyone reading to be aware too)
Last but not least,
I found the exact line with the modification made by the team in the file class.wpdatatable.php that solved the limitation.
It's okay for me to redo this change with each new update.
I hope they can implement a permanent fix, after doing more testing on this.
Thank you so much,
for you and your team!!
Hi, Zeba
I just wanted to follow up on this issue.
We are happy to say that the developers added this in the latest update version 4.4 ,
"
Fixed issue with foreign keys for PostgreSQL database
"
Just wanted to let you know, so from now on you don't have to modify anything when you update the plugin.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Miloš Jovanović,
I was very happy when I read your message.
I'm glad to have maybe collaborated in some way.
I really appreciate your and all wpDatatable's dev team proactiveness.
- When user, support and developers are aligned, anything is possible.
I imagine that some users like me can be a bit boring.
But we play on the same side.
"Gratitude and attitude are not challenges; they are choices." – Robert Braathe
(No wonder you are the best at this.)
And I make a point of truly emphasizing how grateful I am.
All the best!
Regards,
To whom it may concern,
I'd like to reinforce my gratitude by sharing this quick review on Wordpress.org:
https://wordpress.org/support/topic/best-plugin-best-people/
Thanks!
Hey, Zeba
Thank you again for the wonderful review, and all the kind words,
i can not express how much it means to us.
We will of course, do our best to advise as much as possible on the other ticket - and please don't hesitate to open new tickets for any new question or concern.
Thanks again, have a great day
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables