Re: Some Questions

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Some Questions
Дата
Msg-id 20030612072513.O25608-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Some Questions  (Ludwig Lim <lud_nowhere_man@yahoo.com>)
Список pgsql-sql
On Thu, 12 Jun 2003, Ludwig Lim wrote:

>     I would like to ask the following questions:
> a) Are foreign key constraint triggers guaranteed to
> execute first before any ordinary "BEFORE
> INSERT/UPDATE/DELETE" trigger is executed? (This is
> assuming that the foreign keys are declared as "NOT
> DEFERRABLE")

No.  Before triggers are going to get run before the action
occurs, the constraint triggers are in general going to run
after the action occurs (before triggers might change
information about the new row). It'll currently run in
the after triggers where it false in name order so you
can place after triggers before or after the constraint
trigger.

> b) Is "varchar" (without upper limit) the same as
> "text"?

Not quite, but it's close (there might still be issues
with mismatching set returning function returns and probably
some other similar cases).

>    I do notice that when I create a view :
>    create view v_test as (select 'test'::varchar(10)
> union select 'test1'::varchar(10));
>
>    a "\d v_test" on the psql prompt would always say
> the only only column the view is of type "character
> varying". Does a union of a varchar(n) column and a
> another varchar(n) column would automatically cast it
> to "character varying" (w/o upper limit) even if the
> upper limit of the 2 varchar columns are the same?

As a side note, in 7.4, create view reports the type as
character varying and a create table as reports it as
character varying(10).



В списке pgsql-sql по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: control structures in plpgsql
Следующее
От: Robert Treat
Дата:
Сообщение: Re: control structures in plpgsql