# Binding variables

**URL:** <https://www.ruby-forum.com/t/binding-variables/182767>\
**Category:** Ruby\
**Created:** [February 2, 2010, 3:46pm UTC](https://www.ruby-forum.com/t/binding-variables/182767 "2010-02-02T15:46:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcarlson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mcarlson](https://www.ruby-forum.com/u/mcarlson)\
**Post date:** [February 2, 2010, 3:46pm UTC](https://www.ruby-forum.com/t/binding-variables/182767/1 "2010-02-02T15:46:56Z")

</div>

Hi,

Just trying to pick up ruby and have a problem with binding variables to  
postgres query.

I have  
query = conn.exec(“SELECT id FROM xxx where id=$1”,4)

However, get “Exception: uninitialized constant Postgres” . I am using  
the ruby-pg gem.

Any suggestions

Thanks
