Understanding table joins

Hi, is this the debug flag?

image

Enabling it still doesnt return any detailed message to why it’s failing.

{"status":"500","message":"A server error occured, to see the error enable the DEBUG flag."}

I am using postgresql node.js, when I have the table without joins there is no error and the data is available.

No, that’s not the debug option you need to enable. The debug flag is located in the Server Connect options. That’s already been explained in our docs:

1 Like

Thanks, can you help me understand what this means

{"status":"500","code":"42883","message":"select * from \"transaction\" inner join \"user\" on \"user\".\"user_id\" = \"transaction\".\"user\" and \"user\".\"name\" = \"transaction\".\"user\" and \"user\".\"image\" = \"transaction\".\"user\" - operator does not exist: character varying = integer","stack":"error: select * from \"transaction\" inner join \"user\" on \"user\".\"user_id\" = \"transaction\".\"user\" and \"user\".\"name\" = \"transaction\".\"user\" and \"user\".\"image\" = \"transaction\".\"user\" - operator does not exist: character varying = integer\n at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:278:15)\n at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)\n at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)\n at TLSSocket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:8:42)\n at TLSSocket.emit (events.js:314:20)\n at addChunk (_stream_readable.js:303:12)\n at readableAddChunk (_stream_readable.js:279:9)\n at TLSSocket.Readable.push (_stream_readable.js:218:10)\n at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)"}

Can you show a screenshot of is the join setup in the UI?

But why is your join dialog empty? Are you trying to use join or not?

I tried with all the fields before it did the same, I just assumed if it was empty then all fields would be selected.

image

Same error

{"status":"500","code":"42883","message":"select * from \"transaction\" inner join \"user\" on \"user\".\"user_id\" = \"transaction\".\"user\" and \"user\".\"name\" = \"transaction\".\"user\" and \"user\".\"bitmoji\" = \"transaction\".\"user\" - operator does not exist: character varying = integer","stack":"error: select * from \"transaction\" inner join \"user\" on \"user\".\"user_id\" = \"transaction\".\"user\" and \"user\".\"name\" = \"transaction\".\"user\" and \"user\".\"bitmoji\" = \"transaction\".\"user\" - operator does not exist: character varying = integer\n at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:278:15)\n at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)\n at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)\n at TLSSocket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:8:42)\n at TLSSocket.emit (events.js:314:20)\n at addChunk (_stream_readable.js:303:12)\n at readableAddChunk (_stream_readable.js:279:9)\n at TLSSocket.Readable.push (_stream_readable.js:218:10)\n at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)"}

But that’s totally wrong. You can’t just add all the fields like that and not even select a column for the other table.
Are you sure you know what a db table join is, how it is used and when?

No I dont understand there is no documentation on this

But what are you trying to achieve? Why do you want to use a join?

There are literally thousands of resources regarding sql joins in the internet so if you don’t know what/how/when to use, I suggest you to check this:
https://www.w3schools.com/sql/sql_join.asp

I want to display a list of transactions and reference an individual transaction to the user who created it.

How am I supposed to learn without asking questions? I have no experience with this kind of thing before.

Please check the resource I linked to to understand how sql joins work.
Then go back to the join dialog, select the proper join per your needs and select the two columns in your both tables you need to join.

I have it working now thanks :sweat:

1 Like