inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

이야기를 나눠요

173만명의 커뮤니티!! 함께 토론해봐요.

SQL Error [42501]: ERROR: permission denied for database postgres

데이터 분석 SQL Fundamentals

안녕하세요 '실습용 스키마 설치 이슈 시 적용하세요'라는 강의편에 맥북에서 create schema nw; 이렇게 DBeaver에서 실행을 하면 아래와 같은 에라가 뜨네요 ㅠ SQL Error [42501]: ERROR: permission denied for database postgres

  • sql
  • postgresql
  • dbms/rdbms
심동희 댓글 0 좋아요 0 조회수 806

버전을 맞추었는데도 오류가 발생합니다. (pd ver: 2.0.3, sqlalchemy: 2.0.0)

다양한 사례로 익히는 SQL 데이터 분석

query = """ select * from nw.customers """ df = pd.read_sql_query(sql=query, con=postgres_engine) df.head(10) --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) Cell In[25], line 4 1 query = """ 2 select * from nw.customers 3 """ ----> 4 df = pd.read_sql_query(sql=query, con=postgres_engine) 5 df.head(10) File ~\anaconda3\Lib\site-packages\pandas\io\sql.py:468, in read_sql_query(sql, con, index_col, coerce_float, params, parse_dates, chunksize, dtype, dtype_backend) 465 if dtype_backend is lib.no_default: 466 dtype_backend = "numpy" # type: ignore[assignment] --> 468 with pandasSQL_builder(con) as pandas_sql: 469 return pandas_sql.read_query( 470 sql, 471 index_col=index_col, (...) 477 dtype_backend=dtype_backend, 478 ) File ~\anaconda3\Lib\site-packages\pandas\io\sql.py:832, in pandasSQL_builder(con, schema, need_transaction) 829 raise ImportError("Using URI string without sqlalchemy installed.") 831 if sqlalchemy is not None and isinstance(con, (str, sqlalchemy.engine.Connectable)): --> 832 return SQLDatabase(con, schema, need_transaction) 834 warnings.warn( 835 "pandas only supports SQLAlchemy connectable (engine/connection) or " 836 "database string URI or sqlite3 DBAPI2 connection. Other DBAPI2 " (...) 839 stacklevel=find_stack_level(), 840 ) 841 return SQLiteDatabase(con) File ~\anaconda3\Lib\site-packages\pandas\io\sql.py:1539, in SQLDatabase.__init__(self, con, schema, need_transaction) 1537 self.exit_stack.callback(con.dispose) 1538 if isinstance(con, Engine): -> 1539 con = self.exit_stack.enter_context(con.connect()) 1540 if need_transaction and not con.in_transaction(): 1541 self.exit_stack.enter_context(con.begin()) File ~\anaconda3\Lib\site-packages\sqlalchemy\engine\base.py:3245, in Engine.connect(self) 3222 def connect(self) -> Connection: 3223 """Return a new :class:`_engine.Connection` object. 3224 3225 The :class:`_engine.Connection` acts as a Python context manager, so (...) 3242 3243 """ -> 3245 return self._connection_cls(self) File ~\anaconda3\Lib\site-packages\sqlalchemy\engine\base.py:145, in Connection.__init__(self, engine, connection, _has_events, _allow_revalidate, _allow_autobegin) 143 if connection is None: 144 try: --> 145 self._dbapi_connection = engine.raw_connection() 146 except dialect.loaded_dbapi.Error as err: 147 Connection._handle_dbapi_exception_noconnection( 148 err, dialect, engine 149 ) File ~\anaconda3\Lib\site-packages\sqlalchemy\engine\base.py:3269, in Engine.raw_connection(self) 3247 def raw_connection(self) -> PoolProxiedConnection: 3248 """Return a "raw" DBAPI connection from the connection pool. 3249 3250 The returned object is a proxied version of the DBAPI (...) 3267 3268 """ -> 3269 return self.pool.connect() File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:452, in Pool.connect(self) 444 def connect(self) -> PoolProxiedConnection: 445 """Return a DBAPI connection from the pool. 446 447 The connection is instrumented such that when its (...) 450 451 """ --> 452 return _ConnectionFairy._checkout(self) File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:1255, in _ConnectionFairy._checkout(cls, pool, threadconns, fairy) 1247 @classmethod 1248 def _checkout( 1249 cls, (...) 1252 fairy: Optional[_ConnectionFairy] = None, 1253 ) -> _ConnectionFairy: 1254 if not fairy: -> 1255 fairy = _ConnectionRecord.checkout(pool) 1257 if threadconns is not None: 1258 threadconns.current = weakref.ref(fairy) File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:716, in _ConnectionRecord.checkout(cls, pool) 714 rec = cast(_ConnectionRecord, pool._do_get()) 715 else: --> 716 rec = pool._do_get() 718 try: 719 dbapi_connection = rec.get_connection() File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\impl.py:168, in QueuePool._do_get(self) 166 return self._create_connection() 167 except: --> 168 with util.safe_reraise(): 169 self._dec_overflow() 170 raise File ~\anaconda3\Lib\site-packages\sqlalchemy\util\langhelpers.py:147, in safe_reraise.__exit__(self, type_, value, traceback) 145 assert exc_value is not None 146 self._exc_info = None # remove potential circular references --> 147 raise exc_value.with_traceback(exc_tb) 148 else: 149 self._exc_info = None # remove potential circular references File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\impl.py:166, in QueuePool._do_get(self) 164 if self._inc_overflow(): 165 try: --> 166 return self._create_connection() 167 except: 168 with util.safe_reraise(): File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:393, in Pool._create_connection(self) 390 def _create_connection(self) -> ConnectionPoolEntry: 391 """Called by subclasses to create a new ConnectionRecord.""" --> 393 return _ConnectionRecord(self) File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:678, in _ConnectionRecord.__init__(self, pool, connect) 676 self.__pool = pool 677 if connect: --> 678 self.__connect() 679 self.finalize_callback = deque() File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:902, in _ConnectionRecord.__connect(self) 900 self.fresh = True 901 except BaseException as e: --> 902 with util.safe_reraise(): 903 pool.logger.debug("Error on connect(): %s", e) 904 else: 905 # in SQLAlchemy 1.4 the first_connect event is not used by 906 # the engine, so this will usually not be set File ~\anaconda3\Lib\site-packages\sqlalchemy\util\langhelpers.py:147, in safe_reraise.__exit__(self, type_, value, traceback) 145 assert exc_value is not None 146 self._exc_info = None # remove potential circular references --> 147 raise exc_value.with_traceback(exc_tb) 148 else: 149 self._exc_info = None # remove potential circular references File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:898, in _ConnectionRecord.__connect(self) 896 try: 897 self.starttime = time.time() --> 898 self.dbapi_connection = connection = pool._invoke_creator(self) 899 pool.logger.debug("Created new connection %r", connection) 900 self.fresh = True File ~\anaconda3\Lib\site-packages\sqlalchemy\engine\create.py:640, in create_engine.<locals>.connect(connection_record) 638 if connection is not None: 639 return connection --> 640 return dialect.connect(*cargs, **cparams) File ~\anaconda3\Lib\site-packages\sqlalchemy\engine\default.py:580, in DefaultDialect.connect(self, *cargs, **cparams) 578 def connect(self, *cargs, **cparams): 579 # inherits the docstring from interfaces.Dialect.connect --> 580 return self.loaded_dbapi.connect(*cargs, **cparams) File ~\anaconda3\Lib\site-packages\psycopg2\__init__.py:122, in connect(dsn, connection_factory, cursor_factory, **kwargs) 119 kwasync['async_'] = kwargs.pop('async_') 121 dsn = _ext.make_dsn(dsn, **kwargs) --> 122 conn = _connect(dsn, connection_factory=connection_factory, **kwasync) 123 if cursor_factory is not None: 124 conn.cursor_factory = cursor_factory UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position 63: invalid start byte 판다스 버전과 sqlalchemy 버전은 다음과 같이 맞추었습니다 2.0.3 2.0.0

  • sql
  • postgresql
  • dbms/rdbms
  • 퍼포먼스-마케팅
  • 데이터-엔지니어링
KoKuMa 댓글 1 좋아요 0 조회수 2341

선생님 안녕하세요!

Oracle PL/SQL 딱 이만큼.. [개념+실전]

안녕하세요! 수업 정말 잘듣고 있습니다!! 공부한거를 블로그에 작성 하려하는데 예제 같은 것을 출처를 밝혀 포스팅 해도될까요??

  • sql
  • oracle
  • PL/SQL
고재형 댓글 1 좋아요 0 조회수 504

학습방향 질문입니다

인프라공방 - 그럴듯한 서비스 만들기

인프라에 대해 처음 공부하는 터라 막막함이 있어 강의를 수강하기 시작했는데요. 강의를 듣기 전 미션을 수행하려고 보니 네트워크와 리눅스 지식은 조금 있지만 도커나 was에 대한 학습 내용을 보니 저에게는 어려움이 다가왔습니다. 먼저 미션을 수행하기 전에 아래 도커공부를 먼저 하고 인프라 미션을 수행해야할까요? https://www.brainbackdoor.com/infra-workshop/docker-container

  • 네트워크
  • linux
  • aws
  • mysql
  • spring-boot
인프런 댓글 1 좋아요 2 조회수 629

티스토리 작성 가능 여부 질문

[개정판] 딥러닝 컴퓨터 비전 완벽 가이드

안녕하세요! 교수님 강의를 듣고 있는 수강생입니다 ! 강의를 복습할 때 개인 블로그에 수업 내용을 정리하면서 게시를 하고 싶은데요 ! 강의 내용에 포함되어있는 이미지를 사용해서 간단하게 요약해서 게시를 하고 싶은데 저작권법에 걸리는 지 여쭤보고 싶어서 글을 작성합니다 ! 개인 블로그에 강의 자료(이미지 등)을 사용해서 복습 용도로 게시를 해도 될까요 ??

  • python
  • 머신러닝
  • 딥러닝
  • keras
  • tensorflow
  • 컴퓨터-비전
ansqudrms01 댓글 0 좋아요 0 조회수 649

빠르게 코딩하기 위한 단축기 문의 (팁)

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

삭제된 글입니다

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
hello4298 댓글 1 좋아요 0 조회수 444

선생님 혹시 tableau 강의는 없을까요

[백문이불여일타] 데이터 분석을 위한 중급 SQL 문제풀이

SAS만 다뤘었고 SQL + Python이 대세인 가 싶었는데 어느 순간 대시보드 구축능력도 요구하네요 ㅋㅋㅋㅋ tableau 강의가 있으실지요.. 뭐부터 손을 대야 할지 .. 고민입니다.

  • sql
러시안블루 댓글 0 좋아요 0 조회수 504

서로 차원이 다른 ndarray의 accuracy_score 함수 응용

[개정판] 파이썬 머신러닝 완벽 가이드

분류(Classification) 성능 평가지표 개요와 정확도(Accuracy) 소개 에서 MNIST를 모두 0으로 예측하는 코드에서 fakepred와 y_test를 비교하는데요 이때 type은 같은데 하나는 1차원 배열이고 또 다른 하나는 column을 1로 가진 2차원 배열인데 이렇게 shape이 달라도 accuracy_score를 통해 비교할 수 있나요?

  • python
  • 머신러닝
  • 통계
이주엽 댓글 1 좋아요 0 조회수 478

sql 이후 머신러닝을 배우려 합니다.

데이터 분석 SQL Fundamentals

이왕이면 강사님께서 올리신 강좌를 구매해 이어서 학습을 해보려 합니다. 로드맵이 있다면, 보고 구매를 하려고 했는데 올려져 있는 강의 수는 많은데 머신러닝 관련 로드맵이 없더라고요 파이썬 머신러닝 완벽 가이드, 딥러닝 컴퓨터 비전 완벽 가이드 딥러닝 CNN 완벽 가이드 캐글 advanced 머신러닝 실전 박치기 이 강의들을 기본부터 학습하려 하는데요 오래된 강좌가 개정되어 다른 이름으로 만들어져 있어서 내용이 겹치는게 있는지 아니면 모두 수강하는게 맞는지 어떤 순서로 학습하면 되는지 알고 싶습니다.

  • sql
  • postgresql
  • dbms/rdbms
bluebamus 댓글 1 좋아요 0 조회수 686

안녕하세요 선생님 SQLD 자격증을 취득하기위해선 해당 강의 로드맵을 다 듣는게 좋을까요?

[백문이불여일타] 데이터 분석을 위한 중급 SQL 문제풀이

안녕하세요. 강의를 보면서 열심히 공부하고있습니다. 다름이 아니라 이번에 SQLD 자격증 시험을 신청했습니다. 해당 강의 로드맵을 다 듣고 노랭이 책을 풀려고하는데, 해당 강의 로드맵을 전체적으로 들으면 될까요?

  • sql
Glitch 댓글 0 좋아요 0 조회수 422

With 문

데이터 분석 SQL Fundamentals

강사님 안녕하세요, 조인실습2에서 부서명 SALES와 RESEARCH 소속 직원별로 과거부터 현재까지 모든 급여를 취합한 평균 급여 예시가 조금 헷갈립니다. With 문이 서브쿼리 역할을 하는걸로 이해하고 있는데 해당 예시에서 왜 with문이 왜 필요한지, with문 또는 서브쿼리 사용하지 않고 쿼리를 진행시키는 방법이 있는지 궁금합니다ㅠ

  • sql
  • postgresql
  • dbms/rdbms
Taylor Shin 댓글 2 좋아요 0 조회수 575

나래비는 일본어 입니다..

다양한 사례로 익히는 SQL 데이터 분석

선생님.. 나래비는 일본어 입니다. 어감이 예뻐서 옛 우리말인줄 알고 찾아봤는데 '줄을 세우다'라는 일본어 '나라비'가 어원이라고 하네요

  • sql
  • postgresql
  • dbms/rdbms
  • 퍼포먼스-마케팅
  • 데이터-엔지니어링
moonjeongro 댓글 1 좋아요 0 조회수 2160

빅분기6회

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

오늘 빅분기 실기 6회 저만어려웠나요..?

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
enffl214 댓글 1 좋아요 0 조회수 570

오겜 Discord 차단 된것 같은데 ,, ㅠㅠ

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

삭제된 글입니다

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
idk1930 댓글 0 좋아요 0 조회수 18

구름환경 문의

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

함수에 대해 정의내릴 때 예를 들어 코랩 에서는 scaler = minmax_scale() 이렇게 정의를 내리고 scaler(data) 하는데 #코랩은 정의내릴 때 괄호를 빼면 동작안함 구름에서 테스트해보니까 scaler = minmax_scale()하고 scaler(data)하면 에러가 발생하고 괄호없이 scaler = minmax_scale 만해야 에러가 발생하지 않더라구요. 이게 구름 환경만의 특성이라서 그렇다고 보면 될까요?

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
jinu220 댓글 2 좋아요 0 조회수 715

안녕하세요 강사님! 수학때문에 고민이 있어 이렇게 질문드립니다.

딥러닝 CNN 완벽 가이드 - TFKeras 버전

안녕하세요 선생님. 우선 좋은 강의를 해주셔서 감사드립니다. 다름이 아니라 현재 섹션1,2 를 수강한 상태입니다. 섹션 1, 2를 수강하는데 수식이 굉장히 많이 등장하더라구요. 제가 수포자였어서 현재로썬 이해하는데 있어서 어려움이 많은 상태입니다.(지금은 열심히 공부하고 있습니다! 아무래도 딥러닝을 공부하는데 수학이 필수인거같아서) 그래서 작동 원리만 이해하고 우선은 넘어가는 방식으로 공부하려고 하는데 이렇게 해도 괜찮을까요?? 예를들면 경사하강법은 손실함수의 기울기가 적어지는 방향으로 학습하는 것이구나, 오차역전파는 미분을 거꾸로 하면서 가중치를 업데이트하는 것이구나, 손실함수는 이런게 있구나, 옵티마이저는 이런게 있구나 이렇게 작동하는구나 이런식으로요. 물론 언젠가는 반드시 다 이해해야겠지만 딥러닝입문자로써는 이렇게 이해만 하고 넘어가도 될까요??

  • 머신러닝
  • 딥러닝
  • keras
  • tensorflow
  • kaggle
  • cnn
이재훈 댓글 1 좋아요 0 조회수 626

train.corr().iplot(kind='heatmap', colorscale='Blues') 에러 발생시.

[리뉴얼] 처음하는 파이썬 머신러닝 부트캠프 (쉽게! 실제 캐글 문제 풀며 정리하기) [데이터분석/과학 Part2]

train.corr().iplot(kind='heatmap', colorscale='Blues') 현재 위의 코드 수행시 에러가 발생하는데요. ValueError: could not convert string to float: 'Braund, Mr. Owen Harris' train 데이터프레임에서 문자열 데이터가 포함되어 있기 때문에 해당 에러가 발생할 수 있습니다. 이 경우, 상관 관계 행렬을 계산하기 전에 문자열 열을 제거해야합니다. 저의 경우 다음처럼 새로운 객체를 만들어 진행하였습니다. object_cols = train.select_dtypes(include=['object']).columns #열의 데이터 타입이 문자인녀석 추출 new_train = train.drop(columns=object_cols) # 열의 데이터가 문자열인 것들 제거 후 새로운 객체에 생성 new_train.corr().iplot(kind='heatmap', colorscale='Blues') 이러면 잘 나옵니다.

  • python
  • 머신러닝
  • pandas
  • kaggle
이기평 댓글 1 좋아요 1 조회수 936

로컬 머신에서 iplot 으로 렌더링 안되시는 분들은

[리뉴얼] 처음하는 파이썬 머신러닝 부트캠프 (쉽게! 실제 캐글 문제 풀며 정리하기) [데이터분석/과학 Part2]

import plotly.io as pio pio.renderers.default='iframe' 다음 코드를 추가해주시면, iframe 을 통해 렌더링 됩니다. 저의 경우 다음 에러로 렌더링이 안됐습니다. ( F12 / Option+Command + i -> console 에서 확인 가능 .)

  • python
  • 머신러닝
  • pandas
  • kaggle
이기평 댓글 0 좋아요 0 조회수 465

15_코드 실행 시 오류 해결 방법

처음하는 딥러닝과 파이토치(Pytorch) 부트캠프 (쉽게! 기본부터 챗GPT 핵심 트랜스포머까지) [데이터분석/과학 Part3]

<강의 코드> transforms_for_train = transforms.Compose( [ transforms.Resize(feature_extractor.size), transforms.RandomHorizontalFlip(), transforms.ToTensor(), normalize, ] ) 강의 코드를 변경하지 않고 그대로 실행하면 아래와 같은 오류가 발생합니다 <오류 메시지> TypeError: Size should be int or sequence. Got <해결 방법> feature_extractor.size를 tuple(feature_extractor.size.values()) 로 변경한 뒤 실행합니다. transforms.Resize 내의 인자 뿐만 아니라 Crop 안의 인자도 함께 변경해주어야 합니다 transforms_for_train, transforms_for_val 모두 동일하게 변경한 뒤 실행하면 에러 없이 실행되는 것을 보실 수 있습니다.

  • 머신러닝
  • 딥러닝
  • 인공신경망
  • pytorch
  • vision-transformer
세니 댓글 0 좋아요 0 조회수 545

인기 태그

인프런 TOP Writers

주간 인기글