ment?
Thanks,
Santosh.
*From:*pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] *On Behalf Of *Sim Zacks
*Sent:* Thursday, January 27, 2011 4:26 PM
*To:* pgsql-general@postgresql.org
*Subject:* Re: [GENERAL] Queyring for columns which are exist in table.
On 01/
On 01/27/2011 09:52 AM, Santosh Bhujbal (sabhujba) wrote:
CREATE OR REPLACE FUNCTION ColumnAlreadyExists(name, name) RETURNS
INTEGER AS E'
DECLARE columnCount INTEGER;
BEGIN
SELECT COUNT (pg_attribute.attname) into columnCount FROM
pg_attribute,pg_class, pg_type WHERE
((pg_attribute.attrel
On 27 January 2011 09:53, Santosh Bhujbal (sabhujba) wrote:
> 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_20100
lumns which are exist in table.
On 27 January 2011 07:52, Santosh Bhujbal (sabhujba)
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 th
On 27 January 2011 07:52, Santosh Bhujbal (sabhujba) 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
Hi All,
I want to fire a query such that if the particular column does not exist
then query should return some default value.
For that I have tried following experiment.
SETUP details: Platform : Sun Solaris 5.10
Postgres : 8.3.7
CREATE TABLE tbl (
c1 integer,
Hi All,
I want to fire a query such that if the particular column does not exist
then query should return some default value.
For that I have tried following experiment.
CREATE TABLE tbl (
c1 integer,
c2 integer,
c3 integer
);
INSERT INTO tbl VALUES (1, 2, 3);
INSERT I