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

Avoid use of SERIAL in ALTER TABLE with PostgreSQL #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asmecher
Copy link

Per email conversation with Damien -- see http://phplens.com/lens/lensforum/msgs.php?id=18150

@peterdd
Copy link
Contributor

peterdd commented Jan 10, 2019

@asmecher, @dregad : The link is lost, so we can't see the discussed problems.

@peterdd
Copy link
Contributor

peterdd commented Jan 10, 2019

review/compare with #73 required

@asmecher
Copy link
Author

Unfortunately I don't have access to that conversation either. The problem as I recall it was the ADODB PostgreSQL driver using SERIAL as a data type, when PostgreSQL doesn't consider it that way.

The patch I've been recommending to Open Journal Systems users is here: https://gist.github.com/asmecher/d1013624ff5325eae97384ae5adc88c4

It's a shame the phplens content wasn't saved.

@dregad
Copy link
Member

dregad commented Jan 10, 2019

The link is lost, so we can't see the discussed problems.

It's a shame the phplens content wasn't saved.

Indeed, a shame that @heyjohnlim took the old phplens / adodb support forums down, and never responded to my requests to provide me with a dump.

Anyway, I found this one on the web archive : https://web.archive.org/web/20150419100241/http://phplens.com/lens/lensforum/msgs.php?id=18150 - pasted below.


Topic: AlterColumnSQL uses SERIAL type for PostgreSQL
author: Alec Smecher created: 15-09-2009 04:12:00 PM

Hi all,

It looks like it's possible for the AlterColumnSQL function in adodb/datadict/datadict-postgres.inc.php to generate ALTER TABLE statements using the SERIAL type. SERIAL is not an actual type (it's actually INT4, with a macro to create a sequence etc.) and this causes SQL errors, i.e.:

Query failed: ERROR: type "serial" does not exist

...from generated SQL statements such as...

ALTER TABLE signoffs ALTER COLUMN signoff_id TYPE SERIAL

Thanks,
Alec Smecher
Public Knowledge Project Team


author: asmecher created: 14-04-2014 06:28:25 PM

I've hacked together a serviceable workaround for this, but frankly my heart wasn't in it -- ADODB is getting pretty hard to maintain cleanly.

http://pkp.sfu.ca/support/forum/viewtopic.php?f=40&t=11896&p=45922#p45922

@asmecher
Copy link
Author

I don't know the circumstances of the forum going down, but I will say that @heyjohnlim was always pleasant to work with and seemed to me to be doing a tremendous amount of thankless middleware work. It certainly helped get OJS off the ground in its early days.

Good sleuthing finding that wayback copy -- I googled briefly for a cached copy or something but didn't spot anything. The patch I recommended above is essentially the same as the one referenced in the quoted message.

@dregad
Copy link
Member

dregad commented Jan 11, 2019

For the record, my earlier comment was absolutely not meant as a criticism of John's tremendous work on ADOdb for over a decade - I was just expressing my regrets of not being able to consult the old forums anymore.

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

Successfully merging this pull request may close these issues.

None yet

4 participants