Skip site navigation (1) Skip section navigation (2)

insert a -1 into a bigint ?

From: kevin kempter <kevin(at)kevinkempterllc(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: insert a -1 into a bigint ?
Date: 2008-05-20 18:14:26
Message-ID: B93EDA1C-3B80-4949-B0C2-36F9EBCF6411@kevinkempterllc.com (view raw or flat)
Thread:
Lists: pgsql-admin
Hi All:


I have this table:

# \d seg_id_tmp7
                 Table "public.seg_id_tmp7"
      Column      |            Type             | Modifiers
-----------------+-----------------------------+-----------
  customer_srcid  | bigint                      |
  show_srcid      | bigint                      |
  show_name       | character varying           |
  season_srcid    | bigint                      |
  season_name     | character varying           |
  episode_srcid   | bigint                      |
  episode_name    | character varying           |
  segment_type_id | bigint                      |
  segment_type    | character varying           |
  segment_srcid   | bigint                      |
  segment_name    | character varying           |
  create_dt       | timestamp without time zone |



I want to insert some data along with a -1 for two of the bigint  
columns. like this:

insert into seg_id_tmp7
(   customer_srcid,
	show_srcid,
	show_name,
	season_srcid,
	season_name,
	episode_srcid,
	episode_name,
	segment_type_id,
	segment_type,
	segment_srcid,
	segment_name,
	create_dt  )
select
	t8.customer_srcid,
	t8.show_srcid,
	t8.show_name,
	t8.season_srcid,
	t8.season_name,
	t8.episode_srcid,
	t8.episode_name
	-1::bigint ,
	'none',
	-1::bigint ,
	'none',
	(select start_dt from load_start_date)
from
	seg_id_tmp8 t8
;



I've also tried without the ::bigint cast on the above query.


I always get this error:

sql:load_sl_cd_segment_dim.sql:237: ERROR:  operator does not exist:  
character varying - bigint
LINE 22:  -1::bigint ,
           ^
HINT:  No operator matches the given name and argument type(s). You  
might need to add explicit type casts.





Thanks in advance for any help, advice, etc..


/Kevin



Responses

pgsql-admin by date

Next:From: kevin kempterDate: 2008-05-20 18:16:36
Subject: Re: insert a -1 into a bigint ?
Previous:From: Scott MarloweDate: 2008-05-20 17:38:38
Subject: Re: how i can restrict databaseusers ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group