Search Postgresql Archives

Re: Create function problem

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

 



Ron St-Pierre wrote:
Check your spelling of public:
SELECT * FROM f_describe_tables('pubilc', 'mil_cien_diez');

Ron

*OK thank you, you right, but after write "public" I receive again an empty row, Why??.
By the way I wrote a short function:*

/mydb=> SELECT c.column_name, c.data_type
mydb-> FROM information_schema.columns c
mydb-> WHERE c.table_schema = 'public' AND c.table_name = 'mil_cien_diez';
column_name | data_type
-------------+-----------
miles       | smallint
cientos     | smallint
decenas     | smallint
(3 rows)

mydb=> CREATE OR REPLACE FUNCTION f_describe_tables (v_tbl_scm text, v_tbl_name text,
mydb(> OUT  text, OUT text) as
mydb-> $$ SELECT c.column_name, c.data_type
mydb$> FROM information_schema.columns c
mydb$> WHERE c.table_schema = 'v_tbl_schm' AND c.table_name = 'v_tbl_name'
mydb$> $$ LANGUAGE SQL;
CREATE FUNCTION
mydb=> SELECT * FROM f_describe_tables('public', 'mil_cien_diez');
column1 | column2
---------+---------
        |
(1 row)
/


[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