pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedoracle to postgres migration question
13+ messages / 7 participants
[nested] [flat]
* oracle to postgres migration question
@ 2010-06-15 19:09 Joshua Gooding <JGooding@ttitech.net>
0 siblings, 3 replies; 13+ messages in thread
From: Joshua Gooding @ 2010-06-15 19:09 UTC (permalink / raw)
To: pgsql-sql
Hello,
I'm looking for the postgres equivalent of oracles: set numwidth
command. Is there an equivalent?
Thanks in advance!
- Josh
--
Joshua Gooding
Software Engineer
TTi Technologies Wheeling, WV 26003
w: 304-233-5680 x 308
c: 304-794-8341
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-15 19:54 Bruce Momjian <bruce@momjian.us>
parent: Joshua Gooding <JGooding@ttitech.net>
2 siblings, 1 reply; 13+ messages in thread
From: Bruce Momjian @ 2010-06-15 19:54 UTC (permalink / raw)
To: Joshua Gooding <JGooding@ttitech.net>; +Cc: pgsql-sql
Joshua Gooding wrote:
> Hello,
>
> I'm looking for the postgres equivalent of oracles: set numwidth
> command. Is there an equivalent?
If we knew what it did, we might be able to help you.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ None of us is going to be here forever. +
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-15 20:07 Scott Marlowe <scott.marlowe@gmail.com>
parent: Joshua Gooding <JGooding@ttitech.net>
2 siblings, 0 replies; 13+ messages in thread
From: Scott Marlowe @ 2010-06-15 20:07 UTC (permalink / raw)
To: Joshua Gooding <JGooding@ttitech.net>; +Cc: pgsql-sql
On Tue, Jun 15, 2010 at 1:09 PM, Joshua Gooding <JGooding@ttitech.net> wrote:
> Hello,
>
> I'm looking for the postgres equivalent of oracles: set numwidth command.
> Is there an equivalent?
Psql uses dynamic formatting for such things. Not sure there's really
a big need for it. Can you give an example of what you're trying to
accomplish? (and as Bruce mentioned, you'd get more bites if you gave
a reference like
http://www.oracle.com/technology/support/tech/sql_plus/htdocs/sub_var4.html#4_1_6
so people would know what you're asking for.)
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-15 20:17 Stephen Frost <sfrost@snowman.net>
parent: Joshua Gooding <JGooding@ttitech.net>
2 siblings, 0 replies; 13+ messages in thread
From: Stephen Frost @ 2010-06-15 20:17 UTC (permalink / raw)
To: Joshua Gooding <JGooding@ttitech.net>; +Cc: pgsql-sql
* Joshua Gooding (JGooding@ttitech.net) wrote:
> I'm looking for the postgres equivalent of oracles: set numwidth
> command. Is there an equivalent?
Nothing really equivalent, I don't believe.. You would need to wrap
the column(s) you care about using to_char().
Thanks,
Stephen
Attachments:
signature.asc (application/pgp-signature, 196B) download
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-15 20:19 Stephen Frost <sfrost@snowman.net>
parent: Bruce Momjian <bruce@momjian.us>
0 siblings, 2 replies; 13+ messages in thread
From: Stephen Frost @ 2010-06-15 20:19 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Joshua Gooding <JGooding@ttitech.net>; pgsql-sql
* Bruce Momjian (bruce@momjian.us) wrote:
> Joshua Gooding wrote:
> > Hello,
> >
> > I'm looking for the postgres equivalent of oracles: set numwidth
> > command. Is there an equivalent?
>
> If we knew what it did, we might be able to help you.
Changes the display-width for numeric values. SQL*Plus will then
right-justify the number based on the numwidth value.
Stephen
Attachments:
signature.asc (application/pgp-signature, 196B) download
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-15 21:10 Reinoud van Leeuwen <reinoud.v@n.leeuwen.net>
parent: Stephen Frost <sfrost@snowman.net>
1 sibling, 0 replies; 13+ messages in thread
From: Reinoud van Leeuwen @ 2010-06-15 21:10 UTC (permalink / raw)
To: pgsql-sql
On Tue, Jun 15, 2010 at 04:19:15PM -0400, Stephen Frost wrote:
> * Bruce Momjian (bruce@momjian.us) wrote:
> > Joshua Gooding wrote:
> > > Hello,
> > >
> > > I'm looking for the postgres equivalent of oracles: set numwidth
> > > command. Is there an equivalent?
> >
> > If we knew what it did, we might be able to help you.
>
> Changes the display-width for numeric values. SQL*Plus will then
> right-justify the number based on the numwidth value.
Are you migrating the server or the client? This sounds like a client
issue to me..
Reinoud
--
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen reinoud.v@n.leeuwen.net
http://reinoud.van.leeuwen.net kvk 27320762
__________________________________________________
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-15 21:14 Scott Marlowe <scott.marlowe@gmail.com>
parent: Stephen Frost <sfrost@snowman.net>
1 sibling, 1 reply; 13+ messages in thread
From: Scott Marlowe @ 2010-06-15 21:14 UTC (permalink / raw)
To: Stephen Frost <sfrost@snowman.net>; +Cc: Bruce Momjian <bruce@momjian.us>; Joshua Gooding <JGooding@ttitech.net>; pgsql-sql
On Tue, Jun 15, 2010 at 2:19 PM, Stephen Frost <sfrost@snowman.net> wrote:
> * Bruce Momjian (bruce@momjian.us) wrote:
>> Joshua Gooding wrote:
>> > Hello,
>> >
>> > I'm looking for the postgres equivalent of oracles: set numwidth
>> > command. Is there an equivalent?
>>
>> If we knew what it did, we might be able to help you.
>
> Changes the display-width for numeric values. SQL*Plus will then
> right-justify the number based on the numwidth value.
Note that psql automagically right justifies numerics and dynamically
sizes all columns so you don't have to do as much of this stuff.
Oracle always made me feel like I was operating the machine behind the
curtain in the Wizard of Oz, lots of handles and switches and knobs I
had to mess with to get useful output.
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-15 22:45 Bruce Momjian <bruce@momjian.us>
parent: Scott Marlowe <scott.marlowe@gmail.com>
0 siblings, 2 replies; 13+ messages in thread
From: Bruce Momjian @ 2010-06-15 22:45 UTC (permalink / raw)
To: Scott Marlowe <scott.marlowe@gmail.com>; +Cc: Stephen Frost <sfrost@snowman.net>; Joshua Gooding <JGooding@ttitech.net>; pgsql-sql
Scott Marlowe wrote:
> Note that psql automagically right justifies numerics and dynamically
> sizes all columns so you don't have to do as much of this stuff.
> Oracle always made me feel like I was operating the machine behind the
> curtain in the Wizard of Oz, lots of handles and switches and knobs I
> had to mess with to get useful output.
Yeah, I have heard that description many times in other forms.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ None of us is going to be here forever. +
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-16 05:02 silly sad <sad@bankir.ru>
parent: Bruce Momjian <bruce@momjian.us>
1 sibling, 1 reply; 13+ messages in thread
From: silly sad @ 2010-06-16 05:02 UTC (permalink / raw)
To: pgsql-sql
On 06/16/10 02:45, Bruce Momjian wrote:
> Scott Marlowe wrote:
>> Note that psql automagically right justifies numerics and dynamically
>> sizes all columns so you don't have to do as much of this stuff.
>> Oracle always made me feel like I was operating the machine behind the
>> curtain in the Wizard of Oz, lots of handles and switches and knobs I
>> had to mess with to get useful output.
>
> Yeah, I have heard that description many times in other forms.
count me in :-)
i even suspect this exactly is a Secret of the oracle Power.
"higher performance through lower level of control"
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-16 11:50 Joshua Gooding <JGooding@ttitech.net>
parent: silly sad <sad@bankir.ru>
0 siblings, 0 replies; 13+ messages in thread
From: Joshua Gooding @ 2010-06-16 11:50 UTC (permalink / raw)
To: pgsql-sql
On 6/16/2010 1:02 AM, silly sad wrote:
> On 06/16/10 02:45, Bruce Momjian wrote:
>> Scott Marlowe wrote:
>>> Note that psql automagically right justifies numerics and dynamically
>>> sizes all columns so you don't have to do as much of this stuff.
>>> Oracle always made me feel like I was operating the machine behind the
>>> curtain in the Wizard of Oz, lots of handles and switches and knobs I
>>> had to mess with to get useful output.
>>
>> Yeah, I have heard that description many times in other forms.
>
> count me in :-)
>
> i even suspect this exactly is a Secret of the oracle Power.
> "higher performance through lower level of control"
>
>
sorry for the delay guys, and thank you for all the replies.
The problem I was having, is the data in field 'track_start' was a
number type in oracle. I switched it out to a real in postgres, however
when I displayed the column (via psql) it was printing out for example
(1.23546e12). I know you could format the output via Sql Plus but I was
not sure what (if anything) you could do in postgres for that. That
being said, I then re-modified the field type and it displays properly.
I went from a real to a integer type and it seemed to clear up every
issue I was having (both displaying and programatically)
--
Joshua Gooding
Software Engineer
TTi Technologies Wheeling, WV 26003
w: 304-233-5680 x 308
c: 304-794-8341
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-16 12:28 Stephen Frost <sfrost@snowman.net>
parent: Bruce Momjian <bruce@momjian.us>
1 sibling, 1 reply; 13+ messages in thread
From: Stephen Frost @ 2010-06-16 12:28 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Scott Marlowe <scott.marlowe@gmail.com>; Joshua Gooding <JGooding@ttitech.net>; pgsql-sql
* Bruce Momjian (bruce@momjian.us) wrote:
> Scott Marlowe wrote:
> > Note that psql automagically right justifies numerics and dynamically
> > sizes all columns so you don't have to do as much of this stuff.
> > Oracle always made me feel like I was operating the machine behind the
> > curtain in the Wizard of Oz, lots of handles and switches and knobs I
> > had to mess with to get useful output.
>
> Yeah, I have heard that description many times in other forms.
ehh, but we provide formatting functions and you can change the output
format in psql to something more useful if you want (and there's always
COPY too). tbh, I'm alot happier w/ psql than SQL*Plus in that regard.
People who are trying to parse psql's output directly should realize
they probably are going about it the wrong way. :)
Stephen
Attachments:
signature.asc (application/pgp-signature, 196B) download
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-16 19:42 Chris Browne <cbbrowne@acm.org>
parent: Stephen Frost <sfrost@snowman.net>
0 siblings, 1 reply; 13+ messages in thread
From: Chris Browne @ 2010-06-16 19:42 UTC (permalink / raw)
To: pgsql-sql
sfrost@snowman.net (Stephen Frost) writes:
> People who are trying to parse psql's output directly should realize
> they probably are going about it the wrong way. :)
There's a set of people I need to tell that to...
--
select 'cbbrowne' || '@' || 'cbbrowne.com';
http://cbbrowne.com/info/internet.html
"MS apparently now has a team dedicated to tracking problems with
Linux and publicizing them. I guess eventually they'll figure out
this back fires... ;)" -- William Burrow <aa126@DELETE.fan.nb.ca>
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: oracle to postgres migration question
@ 2010-06-16 20:53 Scott Marlowe <scott.marlowe@gmail.com>
parent: Chris Browne <cbbrowne@acm.org>
0 siblings, 0 replies; 13+ messages in thread
From: Scott Marlowe @ 2010-06-16 20:53 UTC (permalink / raw)
To: Chris Browne <cbbrowne@acm.org>; +Cc: pgsql-sql
On Wed, Jun 16, 2010 at 1:42 PM, Chris Browne <cbbrowne@acm.org> wrote:
> sfrost@snowman.net (Stephen Frost) writes:
>> People who are trying to parse psql's output directly should realize
>> they probably are going about it the wrong way. :)
>
> There's a set of people I need to tell that to...
If you're at least making the output something like tab, space, pipe
delimited you can parse it. On systems with only bash to play with,
I've done that before because it and psql were the only tools I had to
work with. I wouldn't try to write some masterpiece artwork of code
around psql output, but for some short scripts it's usable, and way
easier than dealing with Oracle.
^ permalink raw reply [nested|flat] 13+ messages in thread
end of thread, other threads:[~2010-06-16 20:53 UTC | newest]
Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-06-15 19:09 oracle to postgres migration question Joshua Gooding <JGooding@ttitech.net>
2010-06-15 19:54 ` Bruce Momjian <bruce@momjian.us>
2010-06-15 20:19 ` Stephen Frost <sfrost@snowman.net>
2010-06-15 21:10 ` Reinoud van Leeuwen <reinoud.v@n.leeuwen.net>
2010-06-15 21:14 ` Scott Marlowe <scott.marlowe@gmail.com>
2010-06-15 22:45 ` Bruce Momjian <bruce@momjian.us>
2010-06-16 05:02 ` silly sad <sad@bankir.ru>
2010-06-16 11:50 ` Joshua Gooding <JGooding@ttitech.net>
2010-06-16 12:28 ` Stephen Frost <sfrost@snowman.net>
2010-06-16 19:42 ` Chris Browne <cbbrowne@acm.org>
2010-06-16 20:53 ` Scott Marlowe <scott.marlowe@gmail.com>
2010-06-15 20:07 ` Scott Marlowe <scott.marlowe@gmail.com>
2010-06-15 20:17 ` Stephen Frost <sfrost@snowman.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox