Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7928255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:41:15+00:00 2026-06-03T19:41:15+00:00

I need to do this query: SELECT * FROM property_select(ARRAY[8,9,10,11,12,13,14,15,16,17,19,20,26,28]) using PHP function pg_query_params($prepared,

  • 0

I need to do this query:

SELECT * FROM property_select(ARRAY[8,9,10,11,12,13,14,15,16,17,19,20,26,28])  

using PHP function pg_query_params($prepared, $params).

Prepared query is:

SELECT * FROM property_select($1);

Params are: ["ARRAY[8,9,10,11,12,13,14,15,16,17,19,20,26,28]"]
How can I pass the params to pg_query_params() as array?

It’s not possible to use '{8,9,10,11,12,13,14,15,16,17,19,20,26,28}' postgres arrays (because it may contain strings and strings inside this array may contain , and “).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T19:41:16+00:00Added an answer on June 3, 2026 at 7:41 pm

    Find the detailed requirements for PostgreSQL Array Input and Output Syntax in the manual.

    Basically, you need to enclose array elements with special characters in double quotes "". You can double-quote all elements, but you don’t have to. And, I quote the manual (see above):

    To put a double quote or backslash in a quoted array element value,
    use escape string syntax and precede it with a backslash.

    There is a piece of PHP code posted by a user in the manual:

      //$t is array to be escaped. $u will be string literal.
      $tv=array();
      foreach($t as $key=>$val){
        $tv[$key]="\"" .
          str_replace("\"",'\\"', str_replace('\\','\\\\',$val)) . "\"
    ";
      }
      $u= implode(",",$tv) ;
      $u="'{" . pg_escape_string($u) . "}'";
    

    There is also a related answer here on SO:

    Also consider the setting of standard_conforming_strings. Backslashes may need to be doubled, but PHP’s pg-modules should do that for you automatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to make a query like this: SELECT PNPDeviceID FROM Win32_NetworkAdapter WHERE AdapterTypeId
I need to do a query like this: SELECT wposts.ID FROM posts wposts WHERE
I need to get UserCarId(int) from this query and assign to int type variable.
I have this query in MySQL: SELECT pr.*, pr7.value AS `room_price_high` FROM `jos_hp_properties` pr
I have this query: select top(2) property_id_ref ,image_file ,property_name from property_master a inner join
I need to replicate the following working HQL query using criteria API. session.CreateQuery( select
I am building an ObjectQuery like this: string query = select value obj from
This LINQ to SQL query From g In Db.Context.Current.Groups Select g.GroupID generates this SQL:
I need this query - update last but one record. UPDATE changes SET checked=''
what wrong with this Query ??? i need this Query. UPDATE user_preferences SET user_preferences_value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.