Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
the latest update doesn't work in postgres.
The delta field is a string (varchar) so cannot be referred to as in integer.
There's SELECT statements using double quotes for a string (SQL needs single quotes).
patch attached to fix both.
Comment | File | Size | Author |
---|---|---|---|
#3 | print_mail-install-6.x.patch | 1.27 KB | AlexisWilke |
print_pdf.install.pg_.patch | 1.19 KB | Shiny | |
print.install.pg_.patch | 1.35 KB | Shiny | |
Comments
Comment #1
AlexisWilke CreditAttribution: AlexisWilke commentedShiny,
Cool! Thank you for the patches. Ran in the same problem here.
Alexis
Comment #2
nileshgr CreditAttribution: nileshgr commentedEhehehe, I was thinking of filing this bug report. Surprised to see that PG users are increasing.
And of course with patches.
Comment #3
AlexisWilke CreditAttribution: AlexisWilke commentedThere is the same problem in the print_mail module for those who use it. See attached.
Thank you.
Alexis
Comment #4
jcnventura CreditAttribution: jcnventura commentedHi,
Thanks for the patch (next time remember print_mail :P)!
I try to create and test pg compatible SQL, but I have to say that I usually test only the runtime code of the module in the alternate platform. My bad.
I've committed it to CVS.
João
Comment #5
nileshgr CreditAttribution: nileshgr commentedThere's just one error you made everywhere repeatedly.
Let's say, a & b are integer & character respectively.
SELECT a, b where a = 0 and b = 0; - this works in mysql but not in pgsql
SELECT a, b where a = 0 and b = "0"; - this works in mysql but not in pgsql
SELECT a, b where a = 0 and b = '0'; - this works in both
So the thing is, you need to use single quotes while comparing a string column.
Just keep that in mind while writing future code.
Comment #6
AlexisWilke CreditAttribution: AlexisWilke commentedYes. In PostgreSQL the double quotes are used to escape "strange" column names. For instance, I saw a table with a "timestamp" which is also a type in PostgreSQL and to handle that column, you must use double quotes to make sure it works in all cases:
INSERT INTO some_table ("timestamp") VALUES (%d);
If I'm correct, MySQL uses backward quotes as in `int` to handle this special case. Each database uses a different scheme because it is not defined in the SQL92 specs...
Thank you.
Alexis
Comment #7
nileshgr CreditAttribution: nileshgr commentedPostgreSQL strictly follows ANSI SQL for commands in DDL, DCL, TCL & DML categories (limited only to ANSI, there are some additions to it for handing postgre's features). It is MySQL which violates the standards.
Comment #8
jcnventura CreditAttribution: jcnventura commentedAnd this is the reason why I'm really happy that Drupal 7 abstracts the database layer.. :)
Comment #9
nileshgr CreditAttribution: nileshgr commentedThere's no guarantee that there will be no bugs in it either? :D
So, a general theorem: Know SQL & PHP well if you plan to use Drupal & PostgreSQL :D