Giter Club home page Giter Club logo

Comments (13)

jmafc avatar jmafc commented on July 16, 2024

I executed the query against PG 9.0.6 using psql and didn't get an error. Can you please try doing that? Also, please tell me what version of psycopg2 you are using (I've tested with 2.4.4 on Python 2.6, 2.7 and 3.2).

from pyrseas.

andreypopp avatar andreypopp commented on July 16, 2024

Hmm... I can execute query via psql, but dbtoyaml fails. psycopg2 2.4.5, Python 2.7.2 on FreeBSD 8.2

from pyrseas.

jmafc avatar jmafc commented on July 16, 2024

That narrows it to a psycopg2 2.4.5 problem. I'll try to reproduce in a virtualenv.

from pyrseas.

andreypopp avatar andreypopp commented on July 16, 2024

Same with 2.4.4, 2.4.3 and PG 9.0.5

from pyrseas.

andreypopp avatar andreypopp commented on July 16, 2024

Also cannot reproduce from iPython shell using same version of psycopg2:

select conrelid::regclass::name from pg_constraint limit 10

works just fine.

from pyrseas.

jmafc avatar jmafc commented on July 16, 2024

I have tested in a virtualenv that had the following: Pyrseas master from GitHub, psycopg2 2.4.5, PyYAML 3.10, distribute 0.6.24 and Python 2.7, against PG 9.0.6. All unit tests passed, including tests/dbobjects/test_constraints.py. I also ran dbtoyaml against pyrseas_testdb after the latter tests (which leaves some primary key/foreign key constraints in the database), and got no errors.

I'm not sure if your comment "Same with 2.4.4, 2.4.3 and PG 9.0.5" means you did reproduce the problem with those versions or not. If it didn't reproduce, maybe you should try again with your original versions but in a different area/virtualenv.

from pyrseas.

jmafc avatar jmafc commented on July 16, 2024

Hello Andrey, please give me an update when you have a chance.

from pyrseas.

andreypopp avatar andreypopp commented on July 16, 2024

I've upgraded to Pg 9.1 and now it seems to work.

from pyrseas.

jmafc avatar jmafc commented on July 16, 2024

Closing issue since we can't reproduce.

from pyrseas.

feikesteenbergen avatar feikesteenbergen commented on July 16, 2024

(issue is already fixed), but for anyone having this issue in the future, the following might be useful.

We ran into this issue recently. Some debugging showed us that the cause is that we have a table in the public schema called name. The solution for this query would be to fully qualify the cast to name, so.

feike=# CREATE TABLE public.name(i int);
CREATE TABLE
feike=# SELECT 0::regclass::name;
 name
------
 -
(1 row)

feike=# SET search_path TO public, pg_catalog;
SET
feike=# SELECT 0::regclass::name;
ERROR:  cannot cast type regclass to name
LINE 1: SELECT 0::regclass::name;
                          ^
feike=# SELECT 0::regclass::pg_catalog.name;
 name
------
 -
(1 row)

Fixed by commit 84a365d

from pyrseas.

feikesteenbergen avatar feikesteenbergen commented on July 16, 2024

@jmafc Could you create a new release containing this (and other) bugfixes? We're currently running the latest release https://github.com/perseas/Pyrseas/releases/tag/v0.7.3, but this fix is not part of that release.

from pyrseas.

jmafc avatar jmafc commented on July 16, 2024

@feikesteenbergen I'm a bit reluctant to creating a new 0.7 maintenance release because (a) we're in the home stretch of work for release 0.8 (I estimate that in about one month we'll be done with dependency tracking and in another month we'll be able to add PG 10 support) and (b) there are only two other bugfixes in the r0.7 branch (three commits, for issues #155 and #157). However, I do seem to recall that there was some other (probably closed) issue for which somebody had asked another 0.7 release, so I'll try to track that down.

from pyrseas.

jmafc avatar jmafc commented on July 16, 2024

The issue that someone had also asked for a 0.7 maintenance release was #160. One of the persons who asked apparently decided to use the master branch for the time being.

from pyrseas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.