Re: [SQL] column names with - and (

2008-08-01 Thread maria s
-- *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *maria s *Sent:* Tuesday, July 29, 2008 12:07 PM *To:* Osvaldo Rosario Kussama; pgsql-sql@postgresql.org; Pavel Stehule; Ivan Sergio Borgonovo *Subject:* [SQL] column names with - and ( Hi All

[SQL] column names with - and (

2008-07-29 Thread maria s
Hi All, When I am fetching the data from a table, I am giving the column names with - and ( and ) like IL-a, IL-a(p30) etc.. select x1 as IL-a, x2 as IL-a(p30) from abc But I am getting ERROR: syntax error at or near - and also t ( , ) Can anyone help me to fix this? Thank you, Maria

Re: [SQL] column names with - and (

2008-07-29 Thread Oliveiros Cristina
; Pavel Stehule ; Ivan Sergio Borgonovo Sent: Tuesday, July 29, 2008 5:06 PM Subject: [SQL] column names with - and ( Hi All, When I am fetching the data from a table, I am giving the column names with - and ( and ) like IL-a, IL-a(p30) etc.. select x1 as IL-a, x2 as IL-a(p30) from

Re: [SQL] column names with - and (

2008-07-29 Thread maria s
Stehule [EMAIL PROTECTED] ; Ivan Sergio Borgonovo [EMAIL PROTECTED] *Sent:* Tuesday, July 29, 2008 5:06 PM *Subject:* [SQL] column names with - and ( Hi All, When I am fetching the data from a table, I am giving the column names with - and ( and ) like IL-a, IL-a(p30) etc.. select x1 as IL

Re: [SQL] column names with - and (

2008-07-29 Thread Oliveiros Cristina
, July 29, 2008 5:27 PM Subject: Re: [SQL] column names with - and ( Maria, The minus, open bracket and close bracket are illegal as identifier names http://www.postgresql.org/docs/8.3/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS Best, Oliveiros - Original Message

Re: [SQL] column names with - and (

2008-07-29 Thread maria s
, 2008 5:27 PM *Subject:* Re: [SQL] column names with - and ( Maria, The minus, open bracket and close bracket are illegal as identifier names http://www.postgresql.org/docs/8.3/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS Best, Oliveiros - Original Message - *From:* maria

Re: [SQL] column names with - and (

2008-07-29 Thread Igor Neyman
; Pavel Stehule; Ivan Sergio Borgonovo Subject: [SQL] column names with - and ( Hi All, When I am fetching the data from a table, I am giving the column names with - and ( and ) like IL-a, IL-a(p30) etc.. select x1 as IL-a, x2 as IL-a(p30) from abc But I am getting ERROR: syntax error

Re: [SQL] column names, types, properties for a table

2005-09-08 Thread thomas.silvi
Hello, there is the view columns in the schema information_schema that can give you most of the informations you need ( for PosgreSQL version = 7.4.8 if I'm right). SELECT * FROM information_schema.columns WHEREtable_name = 'mytable'; See

[SQL] column names, types, properties for a table

2005-09-07 Thread Roger Tannous
Hi, Is it possible to issue an SQL query that lists column names, types (int, varchar, boolean, etc.), properties (like NOT NULL or UNIQUE) for a given table name ? Regards, Roger Tannous. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the

Re: [SQL] column names, types, properties for a table

2005-09-07 Thread Philip Hallstrom
Is it possible to issue an SQL query that lists column names, types (int, varchar, boolean, etc.), properties (like NOT NULL or UNIQUE) for a given table name ? Start psql with the -E option. Then \d yourtable. It will print out the queries that are run internally to show you the table

Re: [SQL] column names, types, properties for a table

2005-09-07 Thread Roger Tannous
OK, I found the solution ( after a little bit of research and testing :) ) Does anyone have recommendations regarding the following query ? SELECT pg_attribute.attname, pg_attribute.attnotnull, pg_attribute.atthasdef, pg_type.typname, pg_attrdef.adsrc AS default_value, pg_constraint.contype,