Re: Two novice questions

Поиск
Список
Период
Сортировка
Искать
От
Sean Davis
Тема
Re: Two novice questions
Дата
Msg-id
264855a00807140846o1e2ba3f7v2f5f4b59fc5850ac@mail.gmail.com
Ответ на
Two novice questions (Wm.A.Stafford)
Список
Дерево обсуждения
Two novice questions "Wm.A.Stafford" <stafford@marine.rutgers.edu>
Re: Two novice questions "Sean Davis" <sdavis2@mail.nih.gov>
Re: Two novice questions Tom Lane <tgl@sss.pgh.pa.us>
libpq question "Wright, George" <George.Wright@infimatic.com>
Re: libpq question "Wright, George" <George.Wright@infimatic.com>
Re: Two novice questions Shane Ambler <pgsql@Sheeky.Biz>
On Mon, Jul 14, 2008 at 11:08 AM, Wm.A.Stafford
 wrote:
> I have received a collection of scripts to be used to build a PostgreSQL db
> and I can't figure out the following.
>
> 1.  Usage of quotes in the scripts.
> The following comes from a script to build and populate a table:
> gid serial PRIMARY KEY,
> "fid_" int4,
> Why is the second column name in quotes, i.e. what is the difference between
> fid_ int4 and "fid_" int 4.
>
> In a similar vein, this comes from a  script that creates a couple of
> tables:
> create table schema1."cache" ( ...
> create table schema1.cache2 ( ...
> Here one schema name is quoted and the other is not.

The quoting is used to specify a literal name.  In particular, if you
specify something like:

Name varchar(32)

Without the quotes, this will be case-folded to all lower-case name.
If you use the quotes, the name will not be case-folded.  As a general
RULE, if you use quotes anywhere, you should use them everywhere.  Do
not mix-and-match or you will likely get into trouble.

> 2.  How does one run a script from PGAdmin?  I have been 'opening' the
> script file then hitting the run button.  Is there a way to just specify the
> path to the script?

I don't think so.  You will probably want to look at using the psql
executable for mass- or automatic-processing of scripts.

Sean
В списке pgsql-novice по дате отправления
От: Wm.A.Stafford
Дата:
Сообщение: Two novice questions
От: Tom Lane
Дата:
Сообщение: Re: Two novice questions
FAQ