Search Postgresql Archives

Re: find column name that has under score (_)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Try just using the string function “position”.  You’ll need to check the documentation or wait for others to determine which specific system views you will need to obtain the column name (if you do not already know that part).

 

position(substring in string) int

 

Non-Zero (or maybe >= 0) indicates the substring was found – though I would test with some known sample data just to make sure before running it on the column names.

 

Dave

 

From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of akp geek
Sent: Thursday, February 17, 2011 1:56 PM
To: pgsql-general
Subject: find column name that has under score (_)

 

Hi all -

 

          I am trying to write a query to find all the column names in database that has a underscore in it (_) example souce_id. I know like will not work , if where column_name like '%_%' Can you please help?

 

Regards

 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux