Comments (17)
@rayrrr you up for making a PR as described in #94 (comment)?
from sqlalchemy-redshift.
I'm going to pick this up.
from sqlalchemy-redshift.
Does this happen with regular postgres databases under the postgres SQLalchemy dialect?
from sqlalchemy-redshift.
Haven't tried it, but "tag" seems to be Redshift specific.
from sqlalchemy-redshift.
Can you create a PR that overrides the Preparer in sqla-redshift with a subclass with those reserved words in.
Also put those words in a line delimited file and load it with pkg_resources.resource_string
from sqlalchemy-redshift.
That's frustrating that they are different. Can you find out the differences. Are there some that redshift removed?
from sqlalchemy-redshift.
See http://docs.aws.amazon.com/redshift/latest/dg/c_redshift-and-postgres-sql.html
from sqlalchemy-redshift.
I just ran into a problem with a column called open
, which looks like another case of a word reserved in Redshift but not PG.
Looks like PG reserved words are documented in https://www.postgresql.org/docs/current/static/sql-keywords-appendix.html
from sqlalchemy-redshift.
Do we have a spec for redshift reserved words?
from sqlalchemy-redshift.
http://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html
from sqlalchemy-redshift.
Here's a stab at getting a full list of Redshift-specific reserved words that aren't reserved by PG:
# File keywords.txt is a copy-paste of the table in https://www.postgresql.org/docs/current/static/sql-keywords-appendix.html
cat keywords.txt | grep '^[A-Z]*\treserved' | sed 's/\([A-Z]*\).*/\1/' > pg_reserved.txt
# File rs_reserved.txt is a copy-paste from http://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html
diff pg_reserved.txt rs_reserved.txt | grep '>' | sed 's/> //'
This gives the following:
AES128
AES256
ALLOWOVERWRITE
BACKUP
BETWEEN
BLANKSASNULL
BYTEDICT
BZIP2
CREDENTIALS
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_USER
CURRENT_USER_ID
DEFLATE
DEFRAG
DELTA
DELTA32K
DISABLE
EMPTYASNULL
ENABLE
ENCODE
ENCRYPT
ENCRYPTION
EXPLICIT
GLOBALDICT256
GLOBALDICT64K
GZIP
IDENTITY
IGNORE
LUN
LUNS
LZO
LZOP
MINUS
MOSTLY13
MOSTLY32
MOSTLY8
NEW
NULLS
OFF
OFFLINE
OID
OLD
OPEN
PARALLEL
PARTITION
PERCENT
PERMISSIONS
RAW
READRATIO
RECOVER
RESPECT
REJECTLOG
RESORT
RESTORE
SESSION_USER
SNAPSHOT
SYSDATE
SYSTEM
TAG
TDES
TEXT255
TEXT32K
TIMESTAMP
TOP
TRUNCATECOLUMNS
WALLET
WITHOUT
from sqlalchemy-redshift.
@jklukas are there any that are reserved by PG but not Redshift?
from sqlalchemy-redshift.
These are reserved by PG but not Redshift:
› diff pg_reserved.txt rs_reserved.txt | grep '<' | sed 's/< //'
ASYMMETRIC
COLLATION
CONCURRENTLY
FETCH
LATERAL
RETURNING
SYMMETRIC
TABLESAMPLE
VARIADIC
WINDOW
from sqlalchemy-redshift.
That's based on list of reserved words in current PG. I'll bet most of those are new since whichever 8.x Redshift was originally forked from.
from sqlalchemy-redshift.
Sure, I'll give it a go this weekend.
from sqlalchemy-redshift.
See #117
from sqlalchemy-redshift.
Fixed by #117
from sqlalchemy-redshift.
Related Issues (20)
- Use bind parameters
- Update project CI
- Regression causing errors during reflection for 1.4 FutureEngine HOT 5
- Log handler added in v0.8.13 produces duplicate logs in application
- Regression in v0.8.13: table reflection broken for non-superusers HOT 2
- Do not run integration tests with dbuser having elevated permissions HOT 1
- Migration error: 'Relation "alembic_version" already exists'
- Alembic migration issue: alter table
- Alembic migrations use RETURNING on update
- Performance degradation and memory peaks when updating from 0.8.12
- Class method needs updating HOT 1
- Table Reflection Slowness
- Temp Table Reflection
- Programming Error with percentile_cont HOT 1
- statements save OIDs unless commited
- Proposal: Remove pkg_resources from the fast path
- Any way to support sqlalchemy >= 2.0? HOT 3
- util.text_type issue HOT 1
- attach query group while running redshift queries
- Reflection does not populate primary key column if its name requres to be enclosed in double quotes
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 sqlalchemy-redshift.