Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Karen Goh

re-send. Kindly assist. Thanks.

----- Forwarded Message -----
From: Karen Goh <[hidden email]>
Sent: Sunday, July 14, 2019, 11:36:01 AM GMT+8
Subject: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Hi,

This is a continuation of my last problem - not sure if I should write from there cos the first part was solved with the help from this group.

I was trying to get the matching tutor_id with the parameter values which is in this case subject_names from a table which contains both the tutor_id and the subject_names.

Here's the error message:

org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 69
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118)
    at Controller.searchController.doPost(searchController.java:108)

Here's the code snippet which I do not know where I had gone wrong:


            String sql1 = "select tutor_id, subject_name from tutor_subject where subject_name in ("
                    + builder.deleteCharAt(builder.length() - 1).toString() + ")";

            PreparedStatement ps2 = connection.prepareStatement(sql1);
HashMap<Integer, ArrayList<String>> tutorSubject = new HashMap<Integer, ArrayList<String>>();           
for(String item : subjs) {
            int tutor_id = tutor.getTutor_id();
            ps2.setInt(1, tutor_id);           
            if (item != null) {
                subjs.add(item);
            ps2.setString(2, item);   
            }                         
            ps2.executeQuery();
        while (rs.next()) {
                    tutor_id = rs.getInt("tutor_id"); 
                    subjs.add(rs.getString("subject_name"));
                                           
                        tutorSubject.put(tutor_id, subjs);   
                        System.out.println(tutorSubject);
                        }
           
            System.out.println("tutor ID=" + rs.getInt("tutor_id") + ", subjectName=" + rs.getString("subject_name"));


Hope someone could point out my mistake.

Thanks.

Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Andrew Gierth
>>>>> "Karen" == Karen Goh <[hidden email]> writes:

 Karen> This is a continuation of my last problem - not sure if I should
 Karen> write from there cos the first part was solved with the help
 Karen> from this group.

 Karen> I was trying to get the matching tutor_id with the parameter
 Karen> values which is in this case subject_names from a table which
 Karen> contains both the tutor_id and the subject_names.

 Karen> Here's the error message:

When you post these questions, you really need to include the ACTUAL SQL
TEXT of the query, not just the code snippet that constructs the query
(because that way we can't see for sure what query actually got
constructed). The best place to find that is in the postgresql server's
own logs.

I would guess that the problem is that you're passing an integer
parameter where you ought to be passing a string.

--
Andrew (irc:RhodiumToad)


Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

David G Johnston
In reply to this post by Karen Goh
On Saturday, July 13, 2019, Karen Goh <[hidden email]> wrote:
            String sql1 = "select tutor_id, subject_name from tutor_subject where subject_name in ("
                    + builder.deleteCharAt(builder.length() - 1).toString() + ")";

            PreparedStatement ps2 = connection.prepareStatement(sql1);

            ps2.setInt(1, tutor_id);           

            ps2.setString(2, item);   


I still don’t see any question marks and you don’t show what is in the builder but assuming the builder has two question marks they both go into the IN expression but then you are comparing subject_name to an integer tutor_id at param 1 which would provoke that error.

David J.
Reply | Threaded
Open this post in threaded view
|

Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Karen Goh
Attn to all:

For sone kind of strange reason I do not know why the mail is not sent to all.

I have normally wrote n replied to the last person who wrote but yahoo mail didn’t let me write at there.

Hope everyone receives this mail this time round.

N please help me.

Tks!




Sent from Yahoo Mail for iPhone

Begin forwarded message:

On Tuesday, July 16, 2019, 1:01 PM, David G. Johnston <[hidden email]> wrote:

On Mon, Jul 15, 2019 at 6:59 PM Karen Goh <[hidden email]> wrote:

May I know why did you say I am comparing subject_name to an integer ?

I am trying to get both tutor_id and subject_name from the same table based on the no of ? in subjectName as per parameterValues.

Again, you need to send messages to the mailing, not me personally.

That said you might want to first figure out what:

ps2.setInt(1, tutor_id); 

is supposed to accomplish in your code.

David J.

Reply | Threaded
Open this post in threaded view
|

Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Karen Goh
Hi,

This is a continuation of my last problem - not sure if I should write from there cos the first part was solved with the help from this group.

I was trying to get the matching tutor_id with the parameter values which is in this case subject_names from a table which contains both the tutor_id and the subject_names.

Here's the error message:

org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 69
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118)
    at Controller.searchController.doPost(searchController.java:108)

Here's the code snippet which I do not know where I had gone wrong:


            String sql1 = "select tutor_id, subject_name from tutor_subject where subject_name in ("
                    + builder.deleteCharAt(builder.length() - 1).toString() + ")";

            PreparedStatement ps2 = connection.prepareStatement(sql1);
HashMap<Integer, ArrayList<String>> tutorSubject = new HashMap<Integer, ArrayList<String>>();            
for(String item : subjs) {
            int tutor_id = tutor.getTutor_id();
            ps2.setInt(1, tutor_id);            
            if (item != null) {
                subjs.add(item);
            ps2.setString(2, item);     
            }                          
            ps2.executeQuery();
        while (rs.next()) {
                    tutor_id = rs.getInt("tutor_id");  
                    subjs.add(rs.getString("subject_name"));
                                            
                        tutorSubject.put(tutor_id, subjs);    
                        System.out.println(tutorSubject);
                        }
            
            System.out.println("tutor ID=" + rs.getInt("tutor_id") + ", subjectName=" + rs.getString("subject_name"));


Hope someone could point out my mistake.

Thanks.


Sent from Yahoo Mail for iPhone

Begin forwarded message:

On Tuesday, July 16, 2019, 2:14 PM, Karen Goh <[hidden email]> wrote:

Attn to all:

For sone kind of strange reason I do not know why the mail is not sent to all.

I have normally wrote n replied to the last person who wrote but yahoo mail didn’t let me write at there.

Hope everyone receives this mail this time round.

N please help me.

Tks!




Sent from Yahoo Mail for iPhone

Begin forwarded message:

On Tuesday, July 16, 2019, 1:01 PM, David G. Johnston <[hidden email]> wrote:

On Mon, Jul 15, 2019 at 6:59 PM Karen Goh <[hidden email]> wrote:

May I know why did you say I am comparing subject_name to an integer ?

I am trying to get both tutor_id and subject_name from the same table based on the no of ? in subjectName as per parameterValues.

Again, you need to send messages to the mailing, not me personally.

That said you might want to first figure out what:

ps2.setInt(1, tutor_id); 

is supposed to accomplish in your code.

David J.

Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

MS (direkt)
Hi,

please post your statement but not all this java stuff.
Nobody knows the type and content of your builder varaible.

Regards Martin




Am 16.07.2019 um 08:17 schrieb Karen Goh:
Hi,

This is a continuation of my last problem - not sure if I should write from there cos the first part was solved with the help from this group.

I was trying to get the matching tutor_id with the parameter values which is in this case subject_names from a table which contains both the tutor_id and the subject_names.

Here's the error message:

org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 69
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118)
    at Controller.searchController.doPost(searchController.java:108)

Here's the code snippet which I do not know where I had gone wrong:


            String sql1 = "select tutor_id, subject_name from tutor_subject where subject_name in ("
                    + builder.deleteCharAt(builder.length() - 1).toString() + ")";

            PreparedStatement ps2 = connection.prepareStatement(sql1);
HashMap<Integer, ArrayList<String>> tutorSubject = new HashMap<Integer, ArrayList<String>>();            
for(String item : subjs) {
            int tutor_id = tutor.getTutor_id();
            ps2.setInt(1, tutor_id);            
            if (item != null) {
                subjs.add(item);
            ps2.setString(2, item);     
            }                          
            ps2.executeQuery();
        while (rs.next()) {
                    tutor_id = rs.getInt("tutor_id");  
                    subjs.add(rs.getString("subject_name"));
                                            
                        tutorSubject.put(tutor_id, subjs);    
                        System.out.println(tutorSubject);
                        }
            
            System.out.println("tutor ID=" + rs.getInt("tutor_id") + ", subjectName=" + rs.getString("subject_name"));


Hope someone could point out my mistake.

Thanks.


Sent from Yahoo Mail for iPhone

Begin forwarded message:

On Tuesday, July 16, 2019, 2:14 PM, Karen Goh [hidden email] wrote:

Attn to all:

For sone kind of strange reason I do not know why the mail is not sent to all.

I have normally wrote n replied to the last person who wrote but yahoo mail didn’t let me write at there.

Hope everyone receives this mail this time round.

N please help me.

Tks!




Sent from Yahoo Mail for iPhone

Begin forwarded message:

On Tuesday, July 16, 2019, 1:01 PM, David G. Johnston [hidden email] wrote:

On Mon, Jul 15, 2019 at 6:59 PM Karen Goh <[hidden email]> wrote:

May I know why did you say I am comparing subject_name to an integer ?

I am trying to get both tutor_id and subject_name from the same table based on the no of ? in subjectName as per parameterValues.

Again, you need to send messages to the mailing, not me personally.

That said you might want to first figure out what:

ps2.setInt(1, tutor_id); 

is supposed to accomplish in your code.

David J.


-- 

Widdersdorfer Str. 415, 50933 Köln; Tel. +49 / 221 / 9544 010
HRB Köln HRB 75439, Geschäftsführer: Dr. Dirk Goldner
Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Karen Goh
Can I know which forum to post to cos I think this may be the wrong forum. Cos it is sql so this forum maybe for sql execute inside the database. However, I read there is no more jdbc forum, correct me if I am wrong.


Sent from Yahoo Mail for iPhone

On Tuesday, July 16, 2019, 2:25 PM, Martin Stöcker <[hidden email]> wrote:

Hi,

please post your statement but not all this java stuff.
Nobody knows the type and content of your builder varaible.

Regards Martin




Am 16.07.2019 um 08:17 schrieb Karen Goh:
Hi,

This is a continuation of my last problem - not sure if I should write from there cos the first part was solved with the help from this group.

I was trying to get the matching tutor_id with the parameter values which is in this case subject_names from a table which contains both the tutor_id and the subject_names.

Here's the error message:

org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 69
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118)
    at Controller.searchController.doPost(searchController.java:108)

Here's the code snippet which I do not know where I had gone wrong:


            String sql1 = "select tutor_id, subject_name from tutor_subject where subject_name in ("
                    + builder.deleteCharAt(builder.length() - 1).toString() + ")";

            PreparedStatement ps2 = connection.prepareStatement(sql1);
HashMap<Integer, ArrayList<String>> tutorSubject = new HashMap<Integer, ArrayList<String>>();            
for(String item : subjs) {
            int tutor_id = tutor.getTutor_id();
            ps2.setInt(1, tutor_id);            
            if (item != null) {
                subjs.add(item);
            ps2.setString(2, item);     
            }                          
            ps2.executeQuery();
        while (rs.next()) {
                    tutor_id = rs.getInt("tutor_id");  
                    subjs.add(rs.getString("subject_name"));
                                            
                        tutorSubject.put(tutor_id, subjs);    
                        System.out.println(tutorSubject);
                        }
            
            System.out.println("tutor ID=" + rs.getInt("tutor_id") + ", subjectName=" + rs.getString("subject_name"));


Hope someone could point out my mistake.

Thanks.


Sent from Yahoo Mail for iPhone

Begin forwarded message:

On Tuesday, July 16, 2019, 2:14 PM, Karen Goh [hidden email] wrote:

Attn to all:

For sone kind of strange reason I do not know why the mail is not sent to all.

I have normally wrote n replied to the last person who wrote but yahoo mail didn’t let me write at there.

Hope everyone receives this mail this time round.

N please help me.

Tks!




Sent from Yahoo Mail for iPhone

Begin forwarded message:

On Tuesday, July 16, 2019, 1:01 PM, David G. Johnston [hidden email] wrote:

On Mon, Jul 15, 2019 at 6:59 PM Karen Goh <[hidden email]> wrote:

May I know why did you say I am comparing subject_name to an integer ?

I am trying to get both tutor_id and subject_name from the same table based on the no of ? in subjectName as per parameterValues.

Again, you need to send messages to the mailing, not me personally.

That said you might want to first figure out what:

ps2.setInt(1, tutor_id); 

is supposed to accomplish in your code.

David J.


-- 

Widdersdorfer Str. 415, 50933 Köln; Tel. <a dir="ltr" href="tel:+49%20/%20221%20/%209544%20010" x-apple-data-detectors="true" x-apple-data-detectors-type="telephone" x-apple-data-detectors-result="6">+49 / 221 / 9544 010
HRB Köln HRB 75439, Geschäftsführer: Dr. Dirk Goldner
Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Andrew Gierth
In reply to this post by Karen Goh
>>>>> "Karen" == Karen Goh <[hidden email]> writes:

 Karen> Attn to all:
 Karen> For sone kind of strange reason I do not know why the mail is
 Karen> not sent to all.

Does yahoo not provide a "reply to all" option? (If you just do a normal
reply it won't go to the list.)

--
Andrew (irc:RhodiumToad)


Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Karen Goh



Sent from Yahoo Mail for iPhone

On Tuesday, July 16, 2019, 4:41 PM, Andrew Gierth <[hidden email]> wrote:

>>>>> "Karen" == Karen Goh <[hidden email]> writes:

Karen> Attn to all:
Karen> For sone kind of strange reason I do not know why the mail is
Karen> not sent to all.

Does yahoo not provide a "reply to all" option? (If you just do a normal
reply it won't go to the list.)

Believe me. It is not the first time I sent to mailing list. I sent to Apache Tomcat many times. Anyway, please direct me to the right mailing list rather than question me. Tks

--
Andrew (irc:RhodiumToad)

Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Andrew Gierth
In reply to this post by Karen Goh
>>>>> "Karen" == Karen Goh <[hidden email]> writes:

 Karen> Can I know which forum to post to cos I think this may be the
 Karen> wrong forum.

This is good enough (though the -general list would probably be better).

But you still need to show us the actual SQL text that gets sent to the
server, NOT just the java code that generates that SQL. You can get the
statement from the server logs (by default, the statement text is logged
alongside any error).

Please at least make some effort to do that before asking again.

--
Andrew (irc:RhodiumToad)


Reply | Threaded
Open this post in threaded view
|

Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Thomas Kellerer
In reply to this post by Karen Goh
Karen Goh schrieb am 16.07.2019 um 10:21:
> Can I know which forum to post to cos I think this may be the wrong
> forum. Cos it is sql so this forum maybe for sql execute inside the
> database. However, I read there is no more jdbc forum, correct me if
> I am wrong.

While this mailing lists indeed deals with plain SQL topics, your problem is not completely off-topic.

But the reason why you don't get help is, that you are not supplying enough information so that we can help you.

The code you have shown us, doesn't show the *actual* SQL String that is generated (and send to the database).

So it's impossible to know to which parameter the error message refers to
Is it the use of "ps2.setInt(1, tutor_id);"  or maybe the use of "ps2.setString(2, item)"?

It's vital to know how that parameter is used in the actual (generated) SQL query.

Given the error message, I assume(!) that the tutor_id is used together with a varchar/text column.

However Postgres will refuse to compare integer and string values.
That would be similar to writing "someStringVariable.equals(42)" in Java - you wouldn't do that either.

So what we need from you in order to be able to help you is:

* The actual generated and complete SQL string of the query you are building.
  Add System.out.println(sql1) to your code and then show us that result
* The definition of the table columns that are used together with the parameters (the "?" in the printed SQL string)




Thomas

Sent with Mozilla Thunderbird


Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Karen Goh
In reply to this post by Andrew Gierth



Sent from Yahoo Mail for iPhone

On Tuesday, July 16, 2019, 4:54 PM, Andrew Gierth <[hidden email]> wrote:

>>>>> "Karen" == Karen Goh <[hidden email]> writes:

Karen> Can I know which forum to post to cos I think this may be the
Karen> wrong forum.

This is good enough (though the -general list would probably be better).

But you still need to show us the actual SQL text that gets sent to the
server, NOT just the java code that generates that SQL. You can get the
statement from the server logs (by default, the statement text is logged
alongside any error).

Ok. Thanks. Just to confirm, I need log4j2 or SL4J to generate the log right? 

Please at least make some effort to do that before asking again.

--
Andrew (irc:RhodiumToad)

Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Andrew Gierth
>>>>> "Karen" == Karen Goh <[hidden email]> writes:

 >> You can get the statement from the server logs (by default, the
 >> statement text is logged alongside any error).
 
 Karen> Ok. Thanks. Just to confirm, I need log4j2 or SL4J to generate
 Karen> the log right?

No.

PostgreSQL writes its own logs. Most installs have some degree of
logging enabled by default, though this does depend on what package was
installed and how the server was started. In some cases you can figure
out where the log files are from the following server settings (use the
SHOW statement to display them):

1. If log_destination is "syslog", then whether a log file exists and
   where it is depends on the system's syslog.conf file.

2. If log_destination is "eventlog", then this is a Windows system, and
   log messages are in the Windows event log.

3. If log_destination is neither of the above, and logging_collector is
   enabled, then the log_directory setting shows where the log files are
   (if this is a relative path, it's relative to data_directory).

4. If log_destination is "stderr" and logging_collector is _disabled_,
   then the logs (if any) are written to wherever the startup script
   directed them. This depends on the OS and packaging.

--
Andrew (irc:RhodiumToad)


Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Karen Goh



Sent from Yahoo Mail for iPhone

On Tuesday, July 16, 2019, 5:36 PM, Andrew Gierth <[hidden email]> wrote:

>>>>> "Karen" == Karen Goh <[hidden email]> writes:

>> You can get the statement from the server logs (by default, the
>> statement text is logged alongside any error).

Karen> Ok. Thanks. Just to confirm, I need log4j2 or SL4J to generate
Karen> the log right?

No.

PostgreSQL writes its own logs. Most installs have some degree of
logging enabled by default, though this does depend on what package was
installed and how the server was started. In some cases you can figure
out where the log files are from the following server settings (use the
SHOW statement to display them):

1. If log_destination is "syslog", then whether a log file exists and
  where it is depends on the system's syslog.conf file.

2. If log_destination is "eventlog", then this is a Windows system, and
  log messages are in the Windows event log.

3. If log_destination is neither of the above, and logging_collector is
  enabled, then the log_directory setting shows where the log files are
  (if this is a relative path, it's relative to data_directory).

4. If log_destination is "stderr" and logging_collector is _disabled_,
  then the logs (if any) are written to wherever the startup script
  directed them. This depends on the OS and packaging.


How do you guys use PostgreSQL ? I do not know  other ways except PGADMIN4. Is there a tutorial I can read up so that my database that I have created can be access via PostgreSQL? 

Last time when my MYSQL was still working, I can just write MySQL d something like that but PostGreSQL I examined the bin there is not command line tool whatsoever....:(

--
Andrew (irc:RhodiumToad)


Reply | Threaded
Open this post in threaded view
|

Re: Fw: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Andrew Gierth
>>>>> "Karen" == Karen Goh <[hidden email]> writes:

 Karen> How do you guys use PostgreSQL ? I do not know other ways except
 Karen> PGADMIN4.

This isn't relevant to your question - the process of finding the server
log files would be exactly the same even if you were using the "psql"
command-line tool.

 Karen> Is there a tutorial I can read up so that my database that I
 Karen> have created can be access via PostgreSQL?

This question does not make sense - if you created a database then it is
accessible.

 Karen> Last time when my MYSQL was still working, I can just write
 Karen> MySQL d something like that but PostGreSQL I examined the bin
 Karen> there is not command line tool whatsoever....:(

Every commonly-used packaging of PostgreSQL includes all the
command-line tools. (Remember that pgadmin4 is a _separate project_ from
PostgreSQL itself.)

As far as I can tell, in all of this exchange you have not told us what
operating system(s) you are using, whether you're running the database
server locally or remotely, what version of what packages you installed
(and where you obtained them). How can we give you advice without
knowing any of these details?

--
Andrew (irc:RhodiumToad)


Reply | Threaded
Open this post in threaded view
|

Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Karen Goh





On Tuesday, July 16, 2019, 7:19:47 PM GMT+8, Andrew Gierth <[hidden email]> wrote:


>>>>> "Karen" == Karen Goh <[hidden email]> writes:

Karen> How do you guys use PostgreSQL ? I do not know other ways except
Karen> PGADMIN4.

This isn't relevant to your question - the process of finding the server
log files would be exactly the same even if you were using the "psql"
command-line tool.

Karen> Is there a tutorial I can read up so that my database that I
Karen> have created can be access via PostgreSQL?

This question does not make sense - if you created a database then it is
accessible.

Karen> Last time when my MYSQL was still working, I can just write
Karen> MySQL d something like that but PostGreSQL I examined the bin
Karen> there is not command line tool whatsoever....:(

Every commonly-used packaging of PostgreSQL includes all the
command-line tools. (Remember that pgadmin4 is a _separate project_ from
PostgreSQL itself.)

As far as I can tell, in all of this exchange you have not told us what
operating system(s) you are using, whether you're running the database
server locally or remotely, what version of what packages you installed
(and where you obtained them). How can we give you advice without
knowing any of these details?

OK. I am at my desktop now. Yahoo now has a hide message hence I wasn't able to type like that before.

Do you mind tell me where do I download PostgreSQL? I am using Windows 10 as OS. Something is wrong with my browser...keep jumping off half way...

--
Andrew (irc:RhodiumToad)


Reply | Threaded
Open this post in threaded view
|

Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Steve Midgley-3


On Tue, Jul 16, 2019 at 1:46 PM Karen Goh <[hidden email]> wrote:





On Tuesday, July 16, 2019, 7:19:47 PM GMT+8, Andrew Gierth <[hidden email]> wrote:


>>>>> "Karen" == Karen Goh <[hidden email]> writes:

Karen> How do you guys use PostgreSQL ? I do not know other ways except
Karen> PGADMIN4.

This isn't relevant to your question - the process of finding the server
log files would be exactly the same even if you were using the "psql"
command-line tool.

Karen> Is there a tutorial I can read up so that my database that I
Karen> have created can be access via PostgreSQL?

This question does not make sense - if you created a database then it is
accessible.

Karen> Last time when my MYSQL was still working, I can just write
Karen> MySQL d something like that but PostGreSQL I examined the bin
Karen> there is not command line tool whatsoever....:(

Every commonly-used packaging of PostgreSQL includes all the
command-line tools. (Remember that pgadmin4 is a _separate project_ from
PostgreSQL itself.)

As far as I can tell, in all of this exchange you have not told us what
operating system(s) you are using, whether you're running the database
server locally or remotely, what version of what packages you installed
(and where you obtained them). How can we give you advice without
knowing any of these details?

OK. I am at my desktop now. Yahoo now has a hide message hence I wasn't able to type like that before.

Do you mind tell me where do I download PostgreSQL? I am using Windows 10 as OS. Something is wrong with my browser...keep jumping off half way...

--
Andrew (irc:RhodiumToad)


If you google "Postgres Windows Download" the first link is the right one (at least for me). It is: https://www.postgresql.org/download/windows/ 
Reply | Threaded
Open this post in threaded view
|

Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Andrew Gierth
In reply to this post by Karen Goh
>>>>> "Karen" == Karen Goh <[hidden email]> writes:

 Karen> Do you mind tell me where do I download PostgreSQL? I am using
 Karen> Windows 10 as OS.

https://www.postgresql.org/download/windows/

This links to the EnterpriseDB installer package, which is the one you
want (so it'll take you to the EnterpriseDB site).

(But I have to ask, is this part of some actual plan to solve your
original problem? You clearly already have a postgresql server that you
are connecting to, otherwise you wouldn't get that error.)

--
Andrew (irc:RhodiumToad)


Reply | Threaded
Open this post in threaded view
|

Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Karen Goh





On Tuesday, July 16, 2019, 10:11:13 PM GMT+8, Andrew Gierth <[hidden email]> wrote:


>>>>> "Karen" == Karen Goh <[hidden email]> writes:

Karen> Do you mind tell me where do I download PostgreSQL? I am using
Karen> Windows 10 as OS.

https://www.postgresql.org/download/windows/

This links to the EnterpriseDB installer package, which is the one you
want (so it'll take you to the EnterpriseDB site).

(But I have to ask, is this part of some actual plan to solve your
original problem? You clearly already have a postgresql server that you
are connecting to, otherwise you wouldn't get that error.)

Yes. I have downloaded and it is inside my Program Files. Hence, I wonder where to check the log you have mentioned.
Can you tell me where to look for the server ?
And now I am getting another error :

org.postgresql.util.PSQLException: ERROR: operator does not exist: text = character varying[]

Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Position: 69

But, I check stackoverflow, it is mentioned that text is the best definition. And this is what I used for subject_name which is a list I am getting from the In clause.


--
Andrew (irc:RhodiumToad)


Reply | Threaded
Open this post in threaded view
|

Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

Andrew Gierth
>>>>> "Karen" == Karen Goh <[hidden email]> writes:

 Karen> Yes. I have downloaded and it is inside my Program Files.

What exactly is in your Program Files?

 Karen> And now I am getting another error :

 Karen> org.postgresql.util.PSQLException: ERROR: operator does not exist: text = character varying[]

Someone just asked this a few minutes ago on the IRC channel but left
without acknowledging my response; was that you?

 Karen> But, I check stackoverflow, it is mentioned that text is the
 Karen> best definition. And this is what I used for subject_name which
 Karen> is a list I am getting from the In clause.

character varying[] means _array of varchar_, of course you can't
compare an array directly against a scalar.

If you want to pass an array value as a parameter, you can't use IN (x), you
have to use  = ANY (x)  instead.

--
Andrew (irc:RhodiumToad)


12