From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
---|---|
To: | Reynier Perez Mira <rperezm(at)uci(dot)cu> |
Cc: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: Schemas en PostgreSQL |
Date: | 2008-02-19 15:26:43 |
Message-ID: | 20080219152643.GJ7652@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Reynier Perez Mira escribió:
> Leyendo e investigando cosas sobre PostgreSQL me he topado con el
> concepto de "Schema" que no conocía hasta ahora y me ha fascinado.
> Estoy realizando una aplicación en la cual este concepto me va de
> maravillas. Bien he creado un schema que se llama "app_licencias".
> Tengo un script .sql en el cual tengo las tablas a generar. Más o
> menos el mismo contiene esto:
>
> SET search_path TO app_licencias;
>
> CREATE TABLE "autor" (
> "idautor" SERIAL NOT NULL,
> "nombre" varchar(250) NOT NULL,
> PRIMARY KEY("idautor")
> );
Hmm, me suena a un bug. ¿Qué versión de Postgres tienes?
Acá en 8.2.6 no puedo reproducirlo: la secuencia se crea en el mismo
schema de la tabla:
alvherre=# create schema reynier;
CREATE SCHEMA
alvherre=# set search_path to reynier;
SET
alvherre=# create table autor (a serial);
NOTICE: CREATE TABLE will create implicit sequence "autor_a_seq" for serial column "autor.a"
CREATE TABLE
alvherre=# \d autor*
Table "reynier.autor"
Column | Type | Modifiers
--------+---------+---------------------------------------------------
a | integer | not null default nextval('autor_a_seq'::regclass)
Sequence "reynier.autor_a_seq"
Column | Type
---------------+---------
sequence_name | name
last_value | bigint
increment_by | bigint
max_value | bigint
min_value | bigint
cache_value | bigint
log_cnt | bigint
is_cycled | boolean
is_called | boolean
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
From | Date | Subject | |
---|---|---|---|
Next Message | Reynier Perez Mira | 2008-02-19 15:34:52 | RE: Schemas en PostgreSQL |
Previous Message | Rodriguez Fernando | 2008-02-19 15:14:48 | Re: unir tablas encima de otras |