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

table_oid should be unsigned #961

Closed
dvarrazzo opened this issue Sep 4, 2019 · 4 comments
Closed

table_oid should be unsigned #961

dvarrazzo opened this issue Sep 4, 2019 · 4 comments

Comments

@dvarrazzo
Copy link
Member

Hey @dvarrazzo,

Few of our users get the table_oid as negative value. It mostly happens with large DB's with lot many tables and columns.
Doing a SELECT (-123434)::oid returns correct result, where -123434 is the table_oid returned.
I'm sorry I am not able to share the simulation data, but could you please have go through on the changes again and see if we are using signed int for OIDs may be ?

Thanks for the great work :)

Originally posted by @adityatoshniwal in #661 (comment)

@dvarrazzo
Copy link
Member Author

@adityatoshniwal Is the system you are testing on a 32 bit, is it Windows or Linux? what is sys.maxint?

Oid is defined as an unsigned 32 bits. On 64 bits systems, even if we were handling Oid types in a sloppy way, the result seems correct. I'm making handling more robust anyway.

@adityatoshniwal
Copy link

The user is facing issue on on Windows 10 Enterprise x64 1809 (pgAdmin application)

Thanks a lot !!

@dvarrazzo
Copy link
Member Author

Figured out so: Window 64 bits defines long as 32 bits unlike Linux.

Anyway, the patch landed in master and wiil be released in 2.8.4. Could you be able to test it?

@adityatoshniwal
Copy link

Unfortunately I am not able to reproduce at my end. I can only ask the users facing issue to upgrade pyscopg2 once released. :(

bors bot added a commit to chronhq/backend that referenced this issue Oct 27, 2019
167: Update psycopg2 requirement from ~=2.8.3 to ~=2.8.4 in /config r=MiklerGM a=dependabot-preview[bot]

Updates the requirements on [psycopg2](https://github.com/psycopg/psycopg2) to permit the latest version.
<details>
<summary>Changelog</summary>

*Sourced from [psycopg2's changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS).*

> Current release
> ---------------
> 
> What's new in psycopg 2.8.4
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> - Fixed building with Python 3.8 (:ticket:`[#854](psycopg/psycopg2#854).
> - Don't swallow keyboard interrupts on connect when a password is specified
>   in the connection string (:ticket:`[#898](psycopg/psycopg2#898).
> - Don't advance replication cursor when the message wasn't confirmed
>   (:ticket:`[#940](psycopg/psycopg2#940).
> - Fixed inclusion of ``time.h`` on linux (:ticket:`[#951](psycopg/psycopg2#951).
> - Fixed int overflow for large values in `~psycopg2.extensions.Column.table_oid`
>   and `~psycopg2.extensions.Column.type_code` (:ticket:`[#961](psycopg/psycopg2#961).
> - `~psycopg2.errorcodes` map and `~psycopg2.errors` classes updated to
>   PostgreSQL 12.
> - Wheel package compiled against OpenSSL 1.1.1d and PostgreSQL at least 11.4.
> 
> 
> What's new in psycopg 2.8.3
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> - Added *interval_status* parameter to
>   `~psycopg2.extras.ReplicationCursor.start_replication()` method and other
>   facilities to send automatic replication keepalives at periodic intervals
>   (:ticket:`[#913](psycopg/psycopg2#913).
> - Fixed namedtuples caching introduced in 2.8 (:ticket:`[#928](psycopg/psycopg2#928).
> 
> 
> What's new in psycopg 2.8.2
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> - Fixed `~psycopg2.extras.RealDictCursor` when there are repeated columns
>   (:ticket:`[#884](psycopg/psycopg2#884).
> - Binary packages built with openssl 1.1.1b. Should fix concurrency problems
>   (:tickets:`[#543](psycopg/psycopg2#543), [#836](psycopg/psycopg2#836).
> 
> 
> What's new in psycopg 2.8.1
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> - Fixed `~psycopg2.extras.RealDictRow` modifiability (:ticket:`[#886](psycopg/psycopg2#886).
> - Fixed "there's no async cursor" error polling a connection with no cursor
>   (:ticket:`[#887](psycopg/psycopg2#887).
> 
> 
> What's new in psycopg 2.8
> -------------------------
> 
> New features:
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/psycopg/psycopg2/commits)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
bors bot added a commit to chronhq/backend that referenced this issue Apr 6, 2020
230: Update psycopg2 requirement from ~=2.8.4 to ~=2.8.5 in /config r=whirish a=dependabot-preview[bot]

Updates the requirements on [psycopg2](https://github.com/psycopg/psycopg2) to permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/psycopg/psycopg2/blob/master/NEWS">psycopg2's changelog</a>.</em></p>
<blockquote>
<h2>Current release</h2>
<p>What's new in psycopg 2.8.5
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Fixed use of <code>!connection_factory</code> and <code>!cursor_factory</code> together
(:ticket:<code>[#1019](https://github.com/psycopg/psycopg2/issues/1019)</code>).</li>
<li>Added support for <code>~logging.LoggerAdapter</code> in
<code>~psycopg2.extras.LoggingConnection</code> (:ticket:<code>[#1026](https://github.com/psycopg/psycopg2/issues/1026)</code>).</li>
<li><code>~psycopg2.extensions.Column</code> objects in <code>cursor.description</code> can be sliced
(:ticket:<code>[#1034](https://github.com/psycopg/psycopg2/issues/1034)</code>).</li>
<li>Added AIX support (:ticket:<code>[#1061](https://github.com/psycopg/psycopg2/issues/1061)</code>).</li>
<li>Fixed <code>~copy.copy()</code> of <code>~psycopg2.extras.DictCursor</code> rows (:ticket:<code>[#1073](https://github.com/psycopg/psycopg2/issues/1073)</code>).</li>
</ul>
<p>What's new in psycopg 2.8.4
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Fixed building with Python 3.8 (:ticket:<code>[#854](https://github.com/psycopg/psycopg2/issues/854)</code>).</li>
<li>Don't swallow keyboard interrupts on connect when a password is specified
in the connection string (:ticket:<code>[#898](https://github.com/psycopg/psycopg2/issues/898)</code>).</li>
<li>Don't advance replication cursor when the message wasn't confirmed
(:ticket:<code>[#940](https://github.com/psycopg/psycopg2/issues/940)</code>).</li>
<li>Fixed inclusion of <code>time.h</code> on linux (:ticket:<code>[#951](https://github.com/psycopg/psycopg2/issues/951)</code>).</li>
<li>Fixed int overflow for large values in <code>~psycopg2.extensions.Column.table_oid</code>
and <code>~psycopg2.extensions.Column.type_code</code> (:ticket:<code>[#961](https://github.com/psycopg/psycopg2/issues/961)</code>).</li>
<li><code>~psycopg2.errorcodes</code> map and <code>~psycopg2.errors</code> classes updated to
PostgreSQL 12.</li>
<li>Wheel package compiled against OpenSSL 1.1.1d and PostgreSQL at least 11.4.</li>
</ul>
<p>What's new in psycopg 2.8.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Added <em>interval_status</em> parameter to
<code>~psycopg2.extras.ReplicationCursor.start_replication()</code> method and other
facilities to send automatic replication keepalives at periodic intervals
(:ticket:<code>[#913](https://github.com/psycopg/psycopg2/issues/913)</code>).</li>
<li>Fixed namedtuples caching introduced in 2.8 (:ticket:<code>[#928](https://github.com/psycopg/psycopg2/issues/928)</code>).</li>
</ul>
<p>What's new in psycopg 2.8.2
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Fixed <code>~psycopg2.extras.RealDictCursor</code> when there are repeated columns
(:ticket:<code>[#884](https://github.com/psycopg/psycopg2/issues/884)</code>).</li>
<li>Binary packages built with openssl 1.1.1b. Should fix concurrency problems
(:tickets:<code>[#543](psycopg/psycopg2#543), [#836](https://github.com/psycopg/psycopg2/issues/836)</code>).</li>
</ul>
</tr></table> ... (truncated)
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/psycopg/psycopg2/commits">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
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