8,784 questions
Best practices
0
votes
1
replies
25
views
Redshift dynamic sql sanitization - best pracises
I am writing a series of Redshift stored procedures which will involve running dynamic SQL via `EXECUTE`. From technical point of view they won't be any more complex than:
CREATE OR REPLACE PROCEDURE ...
Score of 0
2 answers
110 views
PostgreSQL Error [42601] ERROR: syntax error at or near "$1" in context "256), $1", at line 1
I am trying to create the procedure shown here in Amazon Redshift. However, I keep getting this error repeatedly:
[42601] ERROR: syntax error at or near "$1" in context "256), $1"...
Score of -3
1 answer
75 views
PostgreSQL - 42601 ERROR: SELECT query has no destination for result data
I am getting this error:
[2026-05-28 06:55:51] [42601] ERROR: SELECT query has no destination for result data
[2026-05-28 06:55:51] Hint: If you want to discard the results, use dynamic SQL (EXECUTE) ...
Score of 0
2 answers
101 views
SQL Error 42601: syntax error while concatenating TEXT
I'm getting the below error:
[42601] ERROR: syntax error at or near "$3" in context "|| $2 AS $3", at line 1
Where: PL/pgSQL function "create_internal_tables" line 19 ...
Score of 0
0 answers
33 views
Can’t chain views across databases (extract → transform → final), even using data share in same cluster
I’m trying to implement a simple layered setup in Amazon Redshift:
Intended structure
extract database
extract_schema.table_1 (raw ingested table)
transform database
transform_schema.view_1 (...
Score of 0
0 answers
103 views
Insert very slow for small data
I have a pair of very small CSV files that I am loading into Redshift. This is test data while I am building out the solution, but I am worried that it is taking too long to insert. My pipeline is:
...
Score of 0
0 answers
70 views
Is there a method for identifying the original query associated with a cursor in Redshift?
We have a large redshift deployment (64 nodes at ra3.16xl) that we are trying to optimize and downsize. Part of the problem is that we have a huge proliferation of tables and adhoc queries that are ...
Score of 3
0 answers
95 views
Intermittent 403 reading S3 Table-based Iceberg table from Redshift
I've got an Iceberg S3 Table that I am using to populate a native Redshift table
by executing INSERT ... SELECT while logged in with IAM Role (either local SQL Workbench with JDBC/groupfederation=true ...
Score of -1
1 answer
67 views
Add IAM Role to Redshift Cluster in AWS CDK
I am trying to add an IAM role to a Redshift cluster which is already created. I am using the below approach and facing errors.
from aws_cdk import (
Duration,
Stack,
aws_redshift_alpha as ...
Best practices
0
votes
0
replies
74
views
Materialising tables for multiple end user profiles in Redshift
Imagine there's a reporting tool for which users might have the permission 'Admin' or 'User'.
We have a dimension in our models called admin_view and if the value is true then only users with Admin ...
Score of 0
1 answer
54 views
Redshift PartiQL for unpivoting the keys and values in a Map typed SUPER
AWS documentation for querying Redshift's super is very much all in on supers that are arrays.
But, I happen to want a super that is a map, as I'm sure a number of people do, and I would like to then ...
Score of 1
1 answer
110 views
Redshift : Opening multiple cursors from within the same client connection is not allowed
I have the following procedure written in redshift, which uses 2 for loops to get country code first and then years as per the country codes.
--Procedure : sp_for_loop_test
create or replace procedure ...
Score of 0
0 answers
94 views
Redshift - SQL Error: Internal jdbc driver error
I am trying to use for loop within the stored procedure to retrieve the employee id and process further but getting an error:
Error: SQL Error: Internal jdbc driver error
Procedure:
create or replace ...
Score of 0
0 answers
60 views
How to connect to Amazon Redshift using AWS IdC access token (M2M) with JDBC driver in Java?
I'm trying to connect to Amazon Redshift using an AWS Identity Center (IdC) access token from a Java application via the Redshift JDBC driver.
I’m using a machine-to-machine (M2M) setup (no browser-...
Score of 0
0 answers
98 views
Power BI DirectQuery to Redshift: ODBC error with pg_catalog.date_add(...) does not exist
I'm using Power BI Desktop with Amazon Redshift in DirectQuery mode. Data loads initially (sometimes at least / sometimes it has errors), but when I scroll down in a visual (e.g., table), I eventually ...