Re: [HACKERS] Show type in psql SELECT

2013-02-24 Thread Craig Ringer
On 02/25/2013 08:54 AM, Mike Toews wrote: > On 25 February 2013 12:48, Craig Ringer > wrote: > > However, the thing I want most couldn't be provided by this patch > > because it seems to be a deeper server limitation: the ability to get > > typmod data from calculatio

Re: [HACKERS] Show type in psql SELECT

2013-02-24 Thread Mike Toews
On 25 February 2013 12:48, Craig Ringer wrote: > However, the thing I want most couldn't be provided by this patch > because it seems to be a deeper server limitation: the ability to get > typmod data from calculation results like > > NUMERIC(8,3) '11.131' + NUMERIC(8,3) '12.123' But is the d

Re: [HACKERS] Show type in psql SELECT

2013-02-24 Thread Greg Stark
On Sun, Feb 24, 2013 at 11:14 PM, Peter Eisentraut wrote: > On Sat, 2013-02-23 at 12:09 +1300, Mike Toews wrote: >> Has anyone else thought this was a missing feature? > > I have. It never occurred to me before what exactly was missing but I did regularly have to do CREATE TABLE AS (query...) jus

Re: [HACKERS] Show type in psql SELECT

2013-02-24 Thread Craig Ringer
On 02/25/2013 07:14 AM, Peter Eisentraut wrote: > On Sat, 2013-02-23 at 12:09 +1300, Mike Toews wrote: >> Has anyone else thought this was a missing feature? > I have. As have I, repeatedly. This would be a nice convenience, though pg_typeof can be used to achieve a similar effect a bit more clumsi

Re: [HACKERS] Show type in psql SELECT

2013-02-24 Thread Peter Eisentraut
On Sat, 2013-02-23 at 12:09 +1300, Mike Toews wrote: > Has anyone else thought this was a missing feature? I have. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Show type in psql SELECT

2013-02-23 Thread Stephen Frost
David, * David Fetter (da...@fetter.org) wrote: > Not everyone uses libpq, so my argument for making it available at the > SQL level stands. Ok, if they're not using libpq then presumably they're using some custom-written app which speaks the PostgreSQL protocol- and guess what, this information

Re: [HACKERS] Show type in psql SELECT

2013-02-23 Thread David Fetter
On Sat, Feb 23, 2013 at 12:07:35PM -0800, Jeff Janes wrote: > On Sat, Feb 23, 2013 at 9:55 AM, David Fetter wrote: > > On Sat, Feb 23, 2013 at 12:09:51PM +1300, Mike Toews wrote: > > > Hi hackers, > > > > > > Type info can be viewed with "\d mytable", however often I'd > > > like to see the type (

Re: [HACKERS] Show type in psql SELECT

2013-02-23 Thread Jeff Janes
On Sat, Feb 23, 2013 at 9:55 AM, David Fetter wrote: > On Sat, Feb 23, 2013 at 12:09:51PM +1300, Mike Toews wrote: > > Hi hackers, > > > > Type info can be viewed with "\d mytable", however often I'd like to > > see the type (and typmod) info in SELECT queries with psql, similar > > to pgAdmin II

Re: [HACKERS] Show type in psql SELECT

2013-02-23 Thread David Fetter
On Sat, Feb 23, 2013 at 12:09:51PM +1300, Mike Toews wrote: > Hi hackers, > > Type info can be viewed with "\d mytable", however often I'd like to > see the type (and typmod) info in SELECT queries with psql, similar > to pgAdmin III. For example: I'm thinking we should add it as a SET parameter

Re: [HACKERS] Show type in psql SELECT

2013-02-22 Thread Erik Rijkers
On Sat, February 23, 2013 00:09, Mike Toews wrote: > > Type info can be viewed with "\d mytable", however often I'd like to see > the type (and typmod) info in SELECT queries with psql, similar to pgAdmin > III. For example: > > my_db=# \pset type > my_db=# SELECT * FROM my_table; > gid | desc

[HACKERS] Show type in psql SELECT

2013-02-22 Thread Mike Toews
Hi hackers, Type info can be viewed with "\d mytable", however often I'd like to see the type (and typmod) info in SELECT queries with psql, similar to pgAdmin III. For example: my_db=# \pset type my_db=# SELECT * FROM my_table; gid | description| width integer | character varyi