pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
type unknown?
4+ messages / 2 participants
[nested] [flat]

* type unknown?
@ 2008-09-18 20:29  Carol Walter <walterc@indiana.edu>
  0 siblings, 1 reply; 4+ messages in thread

From: Carol Walter @ 2008-09-18 20:29 UTC (permalink / raw)
  To: pgsql-admin

Greetings one and all,

I am porting all my databases from a 32 bit Postgres engine to 64 bit  
Postgres.  To do this, I did a pg_dumpall and I'm restoring.  I got  
an error on the restoration as follows:

psql:/dbsdisk/data_load/dbdev_all_080915.sql:3920581: WARNING:   
column "collection" has type "unknown"
DETAIL:  Proceeding with relation creation anyway.

The view that was being processes when the error occurred is:

     View "public.v_cos_master_year_count"
    Column    |       Type        | Modifiers
-------------+-------------------+-----------
  collection  | text              |
  year        | character varying |
  entry_count | bigint            |
View definition:
  SELECT 'cos'::text AS collection, cos_master.year_published AS  
"year", count(cos_master.id) AS entry_count
    FROM cos_master
   GROUP BY cos_master.year_published, cos_master.collection
   ORDER BY cos_master.year_published;

There are a number of views in this particular database where  
"collection" is used in this way and they all get this warning.  Text  
is a valid type, albeit nonstandard.  What is triggering this warning?

Thanks,
Carol




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: type unknown?
@ 2008-09-18 21:01  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Carol Walter <walterc@indiana.edu>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2008-09-18 21:01 UTC (permalink / raw)
  To: Carol Walter <walterc@indiana.edu>; +Cc: pgsql-admin

Carol Walter <walterc@indiana.edu> writes:
> Postgres.  To do this, I did a pg_dumpall and I'm restoring.  I got  
> an error on the restoration as follows:

> psql:/dbsdisk/data_load/dbdev_all_080915.sql:3920581: WARNING:   
> column "collection" has type "unknown"
> DETAIL:  Proceeding with relation creation anyway.

AFAIK the only way to get that warning is with an undecorated literal
constant:

regression=# create view foo as select 'bar' as collection;
WARNING:  column "collection" has type "unknown"
DETAIL:  Proceeding with relation creation anyway.
CREATE VIEW
regression=# \d foo
        View "public.foo"
   Column   |  Type   | Modifiers 
------------+---------+-----------
 collection | unknown | 
View definition:
 SELECT 'bar' AS collection;

... which is not what you're showing here:

> The view that was being processes when the error occurred is:

>      View "public.v_cos_master_year_count"
>     Column    |       Type        | Modifiers
> -------------+-------------------+-----------
>   collection  | text              |
>   year        | character varying |
>   entry_count | bigint            |
> View definition:
>   SELECT 'cos'::text AS collection, cos_master.year_published AS  
> "year", count(cos_master.id) AS entry_count
>     FROM cos_master
>    GROUP BY cos_master.year_published, cos_master.collection
>    ORDER BY cos_master.year_published;

Are you sure you correctly identified which view is drawing the warning?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: type unknown?
@ 2008-09-18 22:14  Carol Walter <walterc@indiana.edu>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Carol Walter @ 2008-09-18 22:14 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin

Well, it''s a guess.  A "CREATE VIEW" follows the line that specifies  
the warning.  (An "ALTER TABLE" immediately precedes it.)  This made  
me think that is was on a view; then I went through the views till I  
found one with a column called "collection".  Is there another way I  
can isolate what's happening?

Carol

On Sep 18, 2008, at 5:01 PM, Tom Lane wrote:

> Carol Walter <walterc@indiana.edu> writes:
>> Postgres.  To do this, I did a pg_dumpall and I'm restoring.  I got
>> an error on the restoration as follows:
>
>> psql:/dbsdisk/data_load/dbdev_all_080915.sql:3920581: WARNING:
>> column "collection" has type "unknown"
>> DETAIL:  Proceeding with relation creation anyway.
>
> AFAIK the only way to get that warning is with an undecorated literal
> constant:
>
> regression=# create view foo as select 'bar' as collection;
> WARNING:  column "collection" has type "unknown"
> DETAIL:  Proceeding with relation creation anyway.
> CREATE VIEW
> regression=# \d foo
>         View "public.foo"
>    Column   |  Type   | Modifiers
> ------------+---------+-----------
>  collection | unknown |
> View definition:
>  SELECT 'bar' AS collection;
>
> ... which is not what you're showing here:
>
>> The view that was being processes when the error occurred is:
>
>>      View "public.v_cos_master_year_count"
>>     Column    |       Type        | Modifiers
>> -------------+-------------------+-----------
>>   collection  | text              |
>>   year        | character varying |
>>   entry_count | bigint            |
>> View definition:
>>   SELECT 'cos'::text AS collection, cos_master.year_published AS
>> "year", count(cos_master.id) AS entry_count
>>     FROM cos_master
>>    GROUP BY cos_master.year_published, cos_master.collection
>>    ORDER BY cos_master.year_published;
>
> Are you sure you correctly identified which view is drawing the  
> warning?
>
> 			regards, tom lane




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: type unknown?
@ 2008-09-18 23:03  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Carol Walter <walterc@indiana.edu>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2008-09-18 23:03 UTC (permalink / raw)
  To: Carol Walter <walterc@indiana.edu>; +Cc: pgsql-admin

Carol Walter <walterc@indiana.edu> writes:
> Well, it''s a guess.  A "CREATE VIEW" follows the line that specifies  
> the warning.  (An "ALTER TABLE" immediately precedes it.)  This made  
> me think that is was on a view; then I went through the views till I  
> found one with a column called "collection".  Is there another way I  
> can isolate what's happening?

Try doing the restore with log_min_error_statement set to WARNING;
that would at least confirm whether you're looking at the right view
definition.

BTW, what PG version is this?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2008-09-18 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-09-18 20:29 type unknown? Carol Walter <walterc@indiana.edu>
2008-09-18 21:01 ` Tom Lane <tgl@sss.pgh.pa.us>
2008-09-18 22:14   ` Carol Walter <walterc@indiana.edu>
2008-09-18 23:03     ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox