Re: Planner forces seq scan when select without quoting its values

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alex Lai <mlai(at)sesda2(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Planner forces seq scan when select without quoting its values
Date: 2012-09-13 13:59:37
Message-ID: 25641.1347544777@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alex Lai <mlai(at)sesda2(dot)com> writes:
> "EXPLAIN insert into alex1 (fileid, archiveset) select 35352974, 10003;"
> [vs]
> "EXPLAIN insert into alex1 (fileid, archiveset) select '35352974', '10003';"

You might be happier using INSERT ... VALUES instead of INSERT
... SELECT for this. In the former, the parser is going to be more
aggressive about forcing values to the correct datatype, which is the
root of your difficulties here.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2012-09-13 15:30:56 Re: Where do I get pgAdmin 1.16 for openSuSE?
Previous Message Yelai, Ramkumar IN BLR STS 2012-09-13 13:33:09 Need help in reclaiming disk space by deleting the selected records