{"record":{"id":"9481871a07438642","repo":"projectdiscovery/nuclei","slug":"not-a-postgres-service","errorCode":null,"errorMessage":"not a postgres service","messagePattern":"not a postgres service","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/js/libs/postgres/postgres.go","lineNumber":90,"sourceCode":"}\n\n// Connect connects to Postgres database using given credentials.\n// If connection is successful, it returns true.\n// If connection is unsuccessful, it returns false and error.\n// The connection is closed after the function returns.\n// @example\n// ```javascript\n// const postgres = require('nuclei/postgres');\n// const client = new postgres.PGClient;\n// const connected = client.Connect('acme.com', 5432, 'username', 'password');\n// ```\nfunc (c *PGClient) Connect(ctx context.Context, host string, port int, username string, password string) (bool, error) {\n\tok, err := c.IsPostgres(ctx, host, port)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif !ok {\n\t\treturn false, fmt.Errorf(\"not a postgres service\")\n\t}\n\texecutionId := ctx.Value(\"executionId\").(string)\n\treturn memoizedconnect(ctx, executionId, host, port, username, password, \"postgres\")\n}\n\n// ExecuteQuery connects to Postgres database using given credentials and database name.\n// and executes a query on the db.\n// If connection is successful, it returns the result of the query.\n// @example\n// ```javascript\n// const postgres = require('nuclei/postgres');\n// const client = new postgres.PGClient;\n// const result = client.ExecuteQuery('acme.com', 5432, 'username', 'password', 'dbname', 'select * from users');\n// log(to_json(result));\n// ```\nfunc (c *PGClient) ExecuteQuery(ctx context.Context, host string, port int, username string, password string, dbName string, query string) (*utils.SQLResult, error) {\n\tok, err := c.IsPostgres(ctx, host, port)\n\tif err != nil {","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/js/libs/postgres/postgres.go#L72-L108","documentation":"Error \"not a postgres service\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/js/libs/postgres/postgres.go:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}