Skip site navigation (1) Skip section navigation (2)

Re: SELECT <all fields except "bad_field"> from mytbl;

From: Erwin Brandstetter <brsaweda(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT <all fields except "bad_field"> from mytbl;
Date: 2007-05-30 05:28:09
Message-ID: 1180502889.101098.267550@p47g2000hsd.googlegroups.com (view raw or flat)
Thread:
Lists: pgsql-general
On May 30, 6:48 am, Rodrigo De León <rdele(dot)(dot)(dot)(at)gmail(dot)com> wrote:
> On May 29, 11:35 pm, Erwin Brandstetter <brsaw(dot)(dot)(dot)(at)gmail(dot)com> wrote:
>
> > EXECUTE
> > 'SELECT '
> > || (SELECT array_to_string(ARRAY(
> > SELECT a.attname
> >  FROM pg_class c, pg_namespace nc, pg_attribute a
> >  WHERE c.relname = 'v_event'
> >    AND c.relnamespace = nc.oid
> >    AND nc.nspname = 'stdat'
> >    AND a.attrelid = c.oid
> >    AND a.attname <> 'log_up'), ', '))
> >    || ' FROM stdat.v_event';
>
> You might want to add:
>
>      AND a.attnum >=1
>
> to remove "tableoid" and friends from the output.

Hmmm .. I don't get "tableoid" and friends in my results as it is
(without "AND a.attnum >=1")
Maybe because all my tables are created "WITHOUT OIDS"?
I have to test this another time ..

Regards
Erwin


In response to

pgsql-general by date

Next:From: PFCDate: 2007-05-30 05:42:29
Subject: Re: SELECT <all fields except "bad_field"> from mytbl;
Previous:From: novnovDate: 2007-05-30 04:53:29
Subject: Re: function retuning refcursor, order by ignored?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group