pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Santosh Bhujbal (sabhujba) <sabhujba@cisco.com>
To: Thom Brown <thom@linux.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: Queyring for columns which are exist in table.
Date: Thu, 27 Jan 2011 15:23:14 +0530
Message-ID: <B439CD362EF4414F83E2317F5EF6FD7F01E39679@XMB-BGL-416.cisco.com> (raw)
In-Reply-To: <AANLkTi=Xsevz14zZ8nrY5BfWXWPO-zbO34TwTb+DTpGf@mail.gmail.com>
References: <B439CD362EF4414F83E2317F5EF6FD7F01E395F0@XMB-BGL-416.cisco.com>
	<AANLkTi=Xsevz14zZ8nrY5BfWXWPO-zbO34TwTb+DTpGf@mail.gmail.com>

Hi Thom,

Thank you for your response.

I have a application which is periodically gathering diff stats from
diff devices and put them into database.
Tables are created per stat, per device and per day.
e.g. stat1_dev1_20100125, stat1_dev1_20100126, stat1_dev1_20100127, etc.
     stat1_dev2_20100125, stat1_dev2_20100126, stat1_dev2_20100127, etc.
     stat2_dev1_20100125, stat2_dev1_20100126, stat2_dev1_20100127, etc.
     stat2_dev2_20100125, stat2_dev2_20100126, stat2_dev2_20100127, etc.

Now when I am upgrading my application with new version then there are
some tables which are having some additional columns.
In this case I have to alter each and every old tables in database with
new column and it's default value.
As there are large number of tables, the upgrade process is taking too
much time (in days).

To avoid above upgrade process I want to write a SQL statements such
that it take care of newly added columns.

Thanks,
Santosh.

-----Original Message-----
From: Thom Brown [mailto:thom@linux.com] 
Sent: Thursday, January 27, 2011 3:09 PM
To: Santosh Bhujbal (sabhujba)
Cc: pgsql-sql@postgresql.org; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Queyring for columns which are exist in table.

On 27 January 2011 07:52, Santosh Bhujbal (sabhujba)
<sabhujba@cisco.com> wrote:
> Hi All,
>
>
>
> I want to fire a query such that if the particular column does not
exist
> then query should return some default value.

Why do you want to do this?  What is it you using this for?

-- 
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935



view thread (8+ messages)  latest in thread

Message-ID: <B439CD362EF4414F83E2317F5EF6FD7F01E39679@XMB-BGL-416.cisco.com>
Permalink:  ../B439CD362EF4414F83E2317F5EF6FD7F01E39679@XMB-BGL-416.cisco.com/
Also on:    postgresql.org/message-id/B439CD362EF4414F83E2317F5EF6FD7F01E39679@XMB-BGL-416.cisco.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sabhujba@cisco.com, thom@linux.com, pgsql-general@postgresql.org
  Subject: Re: Queyring for columns which are exist in table.
  In-Reply-To: <B439CD362EF4414F83E2317F5EF6FD7F01E39679@XMB-BGL-416.cisco.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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