Skip to content

DOC: Improvement for def psql_insert_copy(table, conn, keys, data_iter) #53942

Open
@try-and-succeed

Description

@try-and-succeed

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#insertion-method

Documentation problem

The function psql_insert_copy does not work for capitalized schema names and table names. The fix is quite easy.

Suggested fix for documentation

To work with capitalized letters in schema name and table name the function should get changed from

    if table.schema:
        table_name = '{}.{}'.format(table.schema, table.name)
    else:
        table_name = table.name

to

    if table.schema:
        table_name = '"{}"."{}"'.format(table.schema, table.name)
    else:
        table_name = '"{}"'.format(table.name)

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsIO SQLto_sql, read_sql, read_sql_query

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions