Comments (13)
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.
Hmm... I can execute query via psql, but dbtoyaml fails. psycopg2 2.4.5, Python 2.7.2 on FreeBSD 8.2
from pyrseas.
That narrows it to a psycopg2 2.4.5 problem. I'll try to reproduce in a virtualenv.
from pyrseas.
Same with 2.4.4, 2.4.3 and PG 9.0.5
from pyrseas.
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.
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.
Hello Andrey, please give me an update when you have a chance.
from pyrseas.
I've upgraded to Pg 9.1 and now it seems to work.
from pyrseas.
Closing issue since we can't reproduce.
from pyrseas.
(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.
@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.
@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.
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)
- "KeyError" for partitioned table with indexes (including constraints) HOT 1
- yamltodb fails on Postgres 13 due to removal of pg_pltemplate catalog HOT 25
- ALTER SEQUENCE OWNER comes before CREATE TABLE HOT 3
- SSL Connection to remote database HOT 3
- datacopy CSV with null trailing columns not importing with -u HOT 7
- CREATE EXTENSION statements in the change script HOT 5
- [Contribution] Docker support HOT 2
- Sequences processing doesn't skip schemas defined with '-N' option. HOT 3
- dbtoyaml fails when dealing with extension-owned triggers/functions HOT 7
- Multiline Strings (source: |2) Output Unstable HOT 5
- Enable Github Discussions HOT 2
- Fails to Install: Error: pg_config executable not found HOT 5
- Error Using dbtoyaml With Supabase Schema HOT 67
- dbtoyaml Fails When PG Password Has Spaces (Improper Escaping) HOT 1
- Convert .travis.yml to GH Actions
- Fold pgdbconn back into Pyrseas HOT 1
- Key error when converting aggregate to YAML HOT 4
- plv8 to extension and fix reserved words in the primary key HOT 5
- Add REFERENCING tables in trigger HOT 3
- Support columns GENERATED AS (x) STORED HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyrseas.