Thread: column and table names

column and table names

From
"stephen`"
Date:

Hi

 

I am trying to find sql to get table and column names.  I found these:

 

 

 

SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'

 

This one works, but the column name one below doesn’t. 

 

 

SELECT column_name FROM information_schema.columns WHERE table_name ='marketLayout'

 

Can anyone tell me how to get the wording right?

 

Stephen Choularton

0413 545 182

02 9999 2226

 

 

 

Re: column and table names

From
John DeSoi
Date:
The column query should work assuming the table name is correct. Your
table name may be case folded, so try with a lowercase 'L', e.g.
'marketlayout'

John




On Apr 26, 2007, at 3:53 AM, stephen` wrote:

> SELECT table_name FROM information_schema.tables WHERE table_schema
> = 'public'
>
>
>
> This one works, but the column name one below doesn’t.
>
>
>
>
>
> SELECT column_name FROM information_schema.columns WHERE table_name
> ='marketLayout'
>
>
>
> Can anyone tell me how to get the wording right?



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


Re: column and table names

From
"Phillip Smith"
Date:

Try using double quotes:

… WHERE table_name =”marketLayout”

 

-----Original Message-----
From: pgsql-novice-owner@postgresql.org [mailto:pgsql-novice-owner@postgresql.org] On Behalf Of stephen`
Sent:
Thursday, 26 April 2007 17:54
To: pgsql-novice@postgresql.org
Subject: [NOVICE] column and table names

 

This one works, but the column name one below doesn’t. 

 

SELECT column_name FROM information_schema.columns WHERE table_name ='marketLayout'


*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email.

Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments