Обсуждение: Table Names

Поиск
Список
Период
Сортировка

Table Names

От
Rob
Дата:
I have a table name SYS_Keyword, but everytime I try to query it, postgres
converts it to sys_keyword and then can't find it.  Why does it do this
and is there any way around it?

Thanks

Rob

--
He who dies with the most toys ...

                    ... still dies


Re: Table Names

От
Oliver Elphick
Дата:
On Fri, 2002-01-25 at 16:08, Rob wrote:
> I have a table name SYS_Keyword, but everytime I try to query it, postgres
> converts it to sys_keyword and then can't find it.  Why does it do this
> and is there any way around it?

A table name is a SQL identifier; all identifiers are case-insensitive
unless they are enclosed in double quotes (").  So long as you are
consistent, there is no problem because all unquoted identifiers are
converted to lower case.

It seems that you must have created the table with quotes around its
name  CREATE TABLE "SYS_Keyword" (...) ; therefore you must always now
refer to it as "SYS_Keyword" in order to be able to find it.

In general it is a good idea not to try to mix case in identifiers; it
only leads to confusion.
--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C

     "My little children, let us not love in word, neither
      in tongue; but in deed and in truth."
                                            I John 3:18

Вложения

Re: Table Names

От
"Steve Boyle \(Roselink\)"
Дата:
Rob,

Search Google for 'postgres case sensitivity' for loads of links re this.

(in summary to keep case sensitivity use double quotes for object names in
your SQL)

hih

steve boyle
----- Original Message -----
From: "Rob" <rob@obsidian.co.za>
To: <pgsql-novice@postgresql.org>
Sent: Friday, January 25, 2002 4:08 PM
Subject: [NOVICE] Table Names


> I have a table name SYS_Keyword, but everytime I try to query it, postgres
> converts it to sys_keyword and then can't find it.  Why does it do this
> and is there any way around it?
>
> Thanks
>
> Rob
>
> --
> He who dies with the most toys ...
>
> ... still dies
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


Re: Table Names

От
"Jules Alberts"
Дата:
On 25 Jan 2002 at 11:08, Rob wrote:
> I have a table name SYS_Keyword, but everytime I try to query it,
> postgres converts it to sys_keyword and then can't find it.  Why does it
> do this and is there any way around it?

AFAIK postgresql is case-insensitive and works internally with
lowercase characters. you could use double quotes but for table names,
that way the uppercase remains, but you would have to use the quotes
every time you use the table name.

--
Jules Alberts.

Email on Commit

От
denis@coralindia.com
Дата:
Hi

I have a TABLE (say "test"). I want to write a trigger which shall generate
and send an Email.

Trigger fires for ROW or STATEMENT level. I want to send mail for bunch of
records and not for every insert.

Is there any way to FIRE TRIGGER FOR EVERY COMMIT and not for any DML ???

e.g.
BEGIN;
INSERT INTO test VALUES (1,'Denis');
INSERT INTO test VALUES (2,'Denis');
INSERT INTO test VALUES (3,'Denis');
COMMIT;

I want to send an email with following text (as body)
"User xxx has inserted 3 records as details below :
        1,Denis
        2,Denis
        3,Denis"

AS SINGLE EMAIL.


Thanx

Denis