literal strings coming out at <other>

View: New views
2 Messages — Rating Filter:   Alert me  

literal strings coming out at <other>

by Jason Baucom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm running squirrel 3.0.2 against a Postgres DB and trying to select a string constant as follows:

select 'hi' as mycolumn from tableX

I'm getting the following results:

mycolumn
<Other>
<Other>
<Other>
<Other>
<Other>
<Other>

I've tried searching but so far come up with nothing. I'm new to Squirrel, so is there some setting to correct this? I've done some searching so far and come up with nothing yet.

Thanks!

Re: literal strings coming out at <other>

by manningr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That would be because the postgres driver is marking the column type
with code 1111 which in JDBC terms means "Other" type (non-standard
type code that can be used to represent any type that is
database-specific).  It's not ideal that the driver does this.  It
could be considered a bug since literal strings usually have a type of
(or are compatible for casting to) varchar which has a JDBC type code
of 12.  Perhaps you could file this a bug/feature request against the
pg jdbc driver (I'm assuming you are using the latest version of both
server and driver).  I did my test with a reasonably recent version
(PostgreSQL 8.3 JDBC4 with SSL (build 603)), but you will definitely
want to make sure that you can reproduce the problem with the latest
version of the driver before filing a report.  You can view the column
type info in the results tab by clicking the Metadata tab and looking
at the column in question (represented here as a row) and the column
with the header "getColumnType".

As a work-around, perhaps you can do something like the following:

select cast( 'hi' as varchar ) as mycolumn from tableX

Rob


On Tue, Sep 29, 2009 at 4:12 PM, Jason Baucom <jasonbaucom@...> wrote:

>
> I'm running squirrel 3.0.2 against a Postgres DB and trying to select a
> string constant as follows:
>
> select 'hi' as mycolumn from tableX
>
> I'm getting the following results:
>
> mycolumn
> <Other>
> <Other>
> <Other>
> <Other>
> <Other>
> <Other>
>
> I've tried searching but so far come up with nothing. I'm new to Squirrel,
> so is there some setting to correct this? I've done some searching so far
> and come up with nothing yet.
>
> Thanks!
> --
> View this message in context: http://www.nabble.com/literal-strings-coming-out-at-%3Cother%3E-tp25670040p25670040.html
> Sent from the squirrel-sql-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Squirrel-sql-users mailing list
> Squirrel-sql-users@...
> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Squirrel-sql-users mailing list
Squirrel-sql-users@...
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users