Re: When To Use Quotes - Mailing list pgsql-sql

From Plugge, Joe R.
Subject Re: When To Use Quotes
Date
Msg-id BD69807DAE0CE44CA00A8338D0FDD0830311CD51BE@oma00cexmbx03.corp.westworlds.com
Whole thread Raw
In response to When To Use Quotes  (Carlos Mennens <carlos.mennens@gmail.com>)
List pgsql-sql
Should match to the data type of the filtered value, so CHAR,VARCHAR,All DATE TYPES should be quoted.  INTEGER, BIGINT,
SMALLINTshould not .... 

-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Carlos Mennens
Sent: Thursday, January 05, 2012 7:56 AM
To: PostgreSQL (SQL)
Subject: [SQL] When To Use Quotes

I'm trying to understand when in SELECT statements should and should I not use single quotes to filter my results. For
example:

SELECT * FROM people
WHERE fname = 'James';

or

SELECT * FROM price
WHERE msrb
BETWEEN 50 AND 100;

Now is it correct to say that in PostgreSQL or ANSI SQL in general I should use 'single quotes' when the condition is
strictlya numerical data type value and everything else should be inside 'single quotes'? 

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


pgsql-sql by date:

Previous
From: Carlos Mennens
Date:
Subject: When To Use Quotes
Next
From: Carlos Mennens
Date:
Subject: DECIMAL or NUMERIC Data Types