Find answers, ask questions, and connect with our
community around the world.

Home Forums AWS AWS Certified Data Engineer Associate DEA-C01 Confusing question about Amazon Redshift Reply To: Confusing question about Amazon Redshift

  • Irene-TutorialsDojo

    Administrator
    June 13, 2025 at 12:36 pm

    Hi to22,

    Thank you for your patience.

    The AWS Redshift documentation confirms that current_schema() is a leader node–only function, and pg_table_def is a catalog table that also resides on the leader node. Queries that reference only catalog tables, like pg_table_def , execute on the leader node.

    Therefore, the query:

    sql

    SELECT * FROM pg_table_def WHERE schemaname = current_schema() LIMIT 1;

    should run without error, as both components are processed on the leader node. The error described in the original question is incorrect, and the answer suggesting that pg_table_def
    resides on compute nodes is inaccurate.

    To better reflect actual Redshift behavior, we are updating the question to reference a user-created table, which resides on compute nodes. In that case, using current_schema()
    inappropriately would indeed cause an error, aligning with expected behavior per the documentation.

    This revision will be reflected on the portal shortly.

    We appreciate your help in improving our content. Please don’t hesitate to reach out if you have any further questions.

    Best,

    Irene @ Tutorials Dojo

Skip to content